JPH05341973A - Program analysis device - Google Patents

Program analysis device

Info

Publication number
JPH05341973A
JPH05341973A JP4152328A JP15232892A JPH05341973A JP H05341973 A JPH05341973 A JP H05341973A JP 4152328 A JP4152328 A JP 4152328A JP 15232892 A JP15232892 A JP 15232892A JP H05341973 A JPH05341973 A JP H05341973A
Authority
JP
Japan
Prior art keywords
statement
program
comment
node
diagram
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP4152328A
Other languages
Japanese (ja)
Inventor
Shiken Yo
志賢 余
Keiin Chin
恵▲いん▼ 陳
Reika Go
玲華 呉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP4152328A priority Critical patent/JPH05341973A/en
Publication of JPH05341973A publication Critical patent/JPH05341973A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

(57)【要約】 【目的】 効率的なプログラム保守のため、原始プログ
ラムの技術ドキュメントを生成するプログラム解析装置
を提供する。 【構成】 プログラム解析部は原始プログラムの非コメ
ント部分の文法解析を行い、ボトムアップ方式でプログ
ラム解析木を求める。命令文を注釈するコメント部分は
コメント抽出部にて抽出し、コメント分類部で分類し、
プログラム解析木における適当なノードを記憶する。プ
ログラム解析木への変換後、図生成部内のプログラム解
析木渡歩部がプログラム解析木を渡り歩き各命令文ノー
ドを検出する。次いで、コメント文ノード検出部が検出
したノード中のコメントを判断する。そして、このコメ
ント部分を定義図式変換部で変換し、原命令文ノードを
一般図式変換部で変換する。その結果、プログラム解析
木は命令文ノードを単位として図的プログラム表現図構
造木に変換され、抽象化深さに応じたプログラム表現図
が描かれる。
(57) [Abstract] [Purpose] To provide a program analysis device for generating a technical document of a source program for efficient program maintenance. [Structure] The program analysis unit performs grammatical analysis of the non-comment portion of the source program and obtains a program analysis tree in a bottom-up method. The comment portion annotating the command statement is extracted by the comment extraction unit and classified by the comment classification unit,
Store the appropriate node in the program parse tree. After the conversion into the program analysis tree, the program analysis tree traversal unit in the diagram generation unit traverses the program analysis tree and detects each statement node. Next, the comment in the node detected by the comment statement node detection unit is determined. Then, the comment part is converted by the definition diagram conversion part, and the original command statement node is converted by the general diagram conversion part. As a result, the program parse tree is converted into a diagrammatic program representation diagram structure tree in units of statement nodes, and a program representation diagram according to the abstraction depth is drawn.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、原始プログラムに関す
る技術ドキュメントを自動的に生成するプログラム解析
装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program analysis device for automatically generating a technical document related to a source program.

【0002】[0002]

【従来の技術】ソフトウェアシステム開発過程におい
て、もっとも工数と経費がかかるのはハードの変更、ハ
ード面の進歩、処理対象の拡張やアルゴリズムの改良等
に伴って、プログラムを変更改良等すること(以下「保
守」という)である。その際、プログラムの内容をプロ
グラマーが完全に理解しないと作業が困難である。この
ため、保守の対象とするプログラム(以下「原始プログ
ラム」という)の理解の助けとするために、原始プログ
ラムの技術内容、論理内容を表現した図を自動的に生成
するプログラム解析装置が提案されている。ところで、
かかるプログラムの構造及び流れをわかり易く説明する
図あるいは表としてはPAD図(Problem An
alysis Diagram)、フローチャート等に
表現する方法がある。一般的に、フローチャートがプロ
グラムを処理する流れのみを示すのに対し、PAD図は
処理の流れ及びプログラムの構造の両方を示せる。この
ため、PAD図の方が多用されているが、従来のPAD
図生成装置としては、例えば本願出願人たる松下電器が
商品化した“C−PADツール”がある。これはソフト
ウェアツール作成装置の一種であり、入力された原始プ
ログラムに対応するPAD図を自動的に生成するもので
ある。従来技術に係るプログラム解析装置の代表とし
て、その“ソフトウェア開発支援システムC−PADツ
ール”のマニュアル(1988年)により、“C−PA
Dツール”を説明する。図22に示すC言語で記載され
たプログラムを例にとると、C−PADツールで処理さ
れた後、図29に示すようなPAD図が生成され、更に
プログラムにおけるコメントはPAD図に独立命令文と
して含まれて生成される。
2. Description of the Related Art In the process of developing a software system, the most man-hours and costs are to change and improve the program as the hardware is changed, the hardware is advanced, the processing object is expanded, and the algorithm is improved. "Maintenance"). At that time, the work is difficult unless the programmer completely understands the contents of the program. Therefore, in order to help understanding of the program to be maintained (hereinafter referred to as "source program"), a program analysis device that automatically generates a diagram expressing the technical content and logical content of the source program is proposed. ing. by the way,
A PAD diagram (Problem An
There is a method of expressing it in a flow chart or the like. Generally, a flow chart shows only the flow of processing a program, whereas a PAD diagram can show both the flow of processing and the structure of a program. For this reason, the PAD diagram is often used, but the conventional PAD
An example of the diagram generation device is a “C-PAD tool” commercialized by Matsushita Electric Co., Ltd., which is the applicant of the present application. This is a kind of software tool creation device, and automatically creates a PAD diagram corresponding to an input source program. As a representative of the program analysis device according to the related art, the "Software Development Support System C-PAD Tool" manual (1988) describes "C-PA".
22. As an example of the program written in the C language shown in FIG. 22, after being processed by the C-PAD tool, a PAD diagram as shown in FIG. Is generated by being included as an independent statement in the PAD diagram.

【0003】次に、本願発明を明細書で開示するにあた
り、プログラム言語としてはC−言語を、その表現図と
してはPAD図を使用するため、これらについて多少言
及しておく。まず、C言語であるが、本C言語は、例え
ば脇英世著 講談社刊 「パソコンC言語入門」、CQ
出版社刊 「トランジスタ技術 SPECIAL No.
14」、CQ出版社刊 「インターフェース1990年
3月号」「同4月号」等いわば技術関係の文庫本や月刊
雑誌等にまで記載されている周知のプログラム言語であ
り、またC言語のプログラムを機械語のプログラムに変
換するCコンパイラー等関連技術も同じく周知である。
このため、本明細書においては、C言語で示されたプロ
グラムの命令内容等をいちいち具体的かつ詳細に説明す
ることはせず、重要な用語の説明等必要最小限にとどめ
る。
Next, in disclosing the present invention in the specification, since the C-language is used as a programming language and the PAD diagram is used as its representation diagram, some mention is made of these. First of all, it is the C language, but this C language is, for example, "Introduction to Personal Computer C Language" published by Hideyo Waki, Kodansha, CQ
Published by Publisher "Transistor Technology SPECIAL No.
14 ”, CQ publisher's“ Interface March 1990 issue ”“ April issue ”, etc., which are well-known programming languages described in technical-related paperback books and monthly magazines. Related techniques such as a C compiler for converting into a machine language program are also well known.
For this reason, in the present specification, the instruction content of the program shown in the C language will not be described in detail and in detail, and the explanation of important terms will be kept to the minimum necessary.

【0004】次に、PAD図について簡単に紹介する。
プログラムにおける各種類の命令文によってPAD図式
は基本型、選択型、ループ型及び命令文定義型の四種類
に分けられる。以下に、これらについて図2を参照しつ
つ順に説明する。 図2(a)は基本型図式:簡単な命令文、例えば演算命
令文である。
Next, a PAD diagram will be briefly introduced.
The PAD diagram is classified into four types of basic type, selection type, loop type and imperative sentence definition type according to each type of imperative sentence in the program. Hereinafter, these will be described in order with reference to FIG. FIG. 2A shows a basic type diagram: a simple statement, for example, an operation statement.

【0005】図2(b)は選択型図式:条件分岐命令文
を示す。詳しく分ければ、2分岐選択と多分岐選択があ
る。 二分岐選択:Qが真であればstatement 1
を、偽であればstatement 2 を、実行す
る。 図2(c)は多重分岐選択:上から下へ条件と値の組み
合わせの適否を順に検査し、真の組合せをただ一つ選択
の上その処理を実行する。
FIG. 2B shows a selection-type diagram: conditional branch statement. More specifically, there are two-branch selection and multi-branch selection. Two-branch selection: state 1 if Q is true
Is executed, and if false, statement 2 is executed. FIG. 2C shows multiple branch selection: from top to bottom, the suitability of the condition and value combination is checked in order, and only one true combination is selected and the processing is executed.

【0006】図2(d)はループ型図式:Qが真の間、
statementを繰り返し実行する。 図2(e)は命令文定義型図式:一つのコメントで表わ
すタスクを完成するための必要な命令文群である。 PAD図は、以上記の四種類の図式からなる。そして、
これら四種の図式を上から下へ連接することにより、命
令文の実行順序を示すことができる。また、左から右へ
連接することにより、入れ子(nest、手続き中に記
入すること)実行構造でプログラムの演算法を示すこと
ができる。
FIG. 2 (d) shows a loop type diagram: while Q is true,
Repeat the statement. FIG. 2E shows an instruction statement definition type diagram: a group of instruction statements necessary for completing a task represented by one comment. The PAD diagram consists of the above four types of diagrams. And
By connecting these four types of diagrams from top to bottom, it is possible to indicate the order of execution of imperative sentences. Also, by connecting from left to right, it is possible to show the operation method of a program by a nested (nest, fill in during procedure) execution structure.

【0007】このように、PAD図はプログラムの流れ
と構造の両方を示すことが可能であり、また伝統的なフ
ローチャートと異なり複雑な流れ線も不必要である。こ
のため、PAD図はフローチャートに比較してプログラ
ムの基本制御構造を明確に表現でき、ひいてはプログラ
ムを表示するのに優れている。
As described above, the PAD diagram can show both the flow and the structure of the program, and unlike the conventional flow chart, the complicated flow line is unnecessary. Therefore, the PAD diagram can express the basic control structure of the program more clearly than the flowchart, and is therefore excellent in displaying the program.

【0008】[0008]

【発明が解決しようとする課題】しかしながら、上記従
来のプログラム解析装置により自動的に生成されたPA
D図は、主に原始プログラムにおける命令文を変換する
ものであり、コメント(/*…*/で挟まれた部分であ
り、人のみが読み、コンパイラは無視する。)を重視し
ていないため内容の理解に不便である。しかるに、実務
ではプログラマが原始プログラムを追跡し解釈する場合
には、ソースコードと共にコメントも参照する。すなわ
ち、簡明なコメントはプログラマがプログラムの設計原
理若しくは基本思想を理解するのに役立つからである。
従って、原始プログラムにおけるコメントをもPAD図
に示すことができるならば、PAD図がより理解し易く
なる。これは、後に詳しく説明するが図22の本発明の
処理対象例としてC言語で示された原始プログラムを図
29に示す“C−PADツール”で生成された従来技術
に係るPAD図と比較参照すれば、コメントの重要性が
わかるであろう。図29の“P−CADツール”では、
一行全てがコメントである場合のみをP−CADツリー
の対象とし、他のタイプのコメントを重視していない。
また、コメントが注釈しようとする命令文を示していな
い。このため、コメントを反映してP−CADツリー化
するという面からはまだまだ不充である。以上より、従
来のプログラム解析装置には以下に示すような問題点が
あるのがわかる。
However, the PA automatically generated by the above-mentioned conventional program analysis device.
Diagram D is mainly for converting the imperative sentence in the source program, it is the part between the comments (/ * ... * /, which is read only by humans and ignored by the compiler). It is inconvenient to understand the contents. However, in practice, when a programmer tracks and interprets a source program, he also refers to the comments along with the source code. That is, simple comments help programmers understand the design principles or basic ideas of programs.
Therefore, if the comments in the source program can also be shown in the PAD diagram, the PAD diagram becomes easier to understand. This will be described in detail later, but a source program shown in C language as an example of the processing object of the present invention in FIG. 22 is compared with the PAD diagram according to the conventional technique generated by the “C-PAD tool” in FIG. 29. Then you will see the importance of comments. In the “P-CAD tool” of FIG. 29,
Only when one line is a comment is the target of the P-CAD tree, and other types of comments are not emphasized.
Also, the comments do not indicate the statement to be annotated. For this reason, it is still unsatisfactory in terms of reflecting the comments and forming a P-CAD tree. From the above, it can be seen that the conventional program analysis device has the following problems.

【0009】(1)コメントとその注釈された文との関
係がはっきりとは示されないこととなり、命令文を解釈
する際のコメントの利用性が低い。 (2)PAD図がプログラムを完全には抽象化していな
い。 本発明はかかる点に鑑みなされたものであり、コメント
とその注釈された命令文との関係をはっきり示し、プロ
グラムを図的プログラム表現図に抽象化するプログラム
解析装置を提供することを目的とする。
(1) Since the relationship between the comment and the annotated sentence is not clearly shown, the comment is less useful in interpreting the imperative sentence. (2) The PAD diagram does not completely abstract the program. The present invention has been made in view of the above points, and an object of the present invention is to provide a program analysis device that clearly shows the relationship between a comment and its annotated statement, and abstracts a program into a schematic program representation diagram. ..

【0010】[0010]

【課題を解決するための手段】上記目的を達成するため
に、請求項1の発明においては入力された原始プログラ
ムからコメント記号によってコメント部分を抽出するコ
メント抽出部と、コメントと命令文との付属関係によっ
てプログラム解析木における適当な位置を定めるべく前
記コメント抽出部で抽出されたコメントの原始プログラ
ムにおける位置により、式命令文のコメントであるか複
合命令文のコメントであるか命令文群のコメントである
かを判断する分類するコメント分類部と、プログラム言
語の文法を記憶するプログラム言語文法記憶部と、入力
された原始プログラムに対してプログラム言語文法記憶
部の記憶する文法によって文法解析を行い、ボトムアッ
プ方式で各命令文で表わす関数のプログラム解析木を求
めるプログラム解析部と、前記プログラム解析部で得ら
れたプログラム解析木と前記コメント分類部で得られた
分類結果を記憶するために、各ノードのデータ構造に対
して当該ノードの性質を表わす文法コードを記憶する文
法コード記憶欄と、終端ノードとソースコードを記憶す
る終端ノードソースコード記憶欄と、式命令文のコメン
トと複合命令文のノードに属する複合命令文のコメント
を記憶する命令文コメント記憶欄と、命令文群に対し対
応するコメントを指向の上記憶する命令文群のコメント
ポインタ欄と、各子ノードを連接する各子ノードポイン
タを記憶する各子ノードポインタ欄とを有するプログラ
ム解析木記憶部と、プログラム解析木記憶部に記憶され
たプログラム解析木における命令文ノード毎に、当該命
令文ノードに対応する図的プログラム表現形式に変換
し、原始プログラムにおけるコメントを命令文定義図的
プログラム表現形式に変換して一関数の図的プログラム
表現図を生成する図生成部とを備えたことを特徴とする
プログラム解析装置としている。
In order to achieve the above-mentioned object, in the invention of claim 1, a comment extraction unit for extracting a comment portion from a inputted source program by a comment symbol, and an attachment of a comment and a statement Depending on the position in the source program of the comment extracted by the comment extraction unit in order to determine an appropriate position in the program analysis tree according to the relationship, it is a comment of an expression statement or a comment of a compound statement or a comment of a statement group. The comment classification unit that classifies whether there is a comment, the program language grammar storage unit that stores the grammar of the program language, and the grammar analysis performed on the input source program by the grammar stored in the program language grammar storage unit. A program solution that obtains a program parse tree for a function represented by each statement in the up method Section, the program analysis tree obtained by the program analyzing section, and the classification result obtained by the comment classifying section, the grammar code representing the property of the node is stored in the data structure of each node. A grammar code storage field, a termination node source code storage field that stores a termination node and source code, and a command statement comment storage field that stores a comment of an expression command statement and a comment of a compound command statement belonging to a node of a compound command statement, A program parse tree storage unit having a comment pointer column of a statement group for directionally storing a comment corresponding to a statement group, and a child node pointer section for storing each child node pointer connecting each child node , For each statement node in the program analysis tree stored in the program analysis tree storage unit, a graphical program corresponding to the statement node As a program analysis device, comprising: a diagram generation unit that converts a comment in a source program into an imperative sentence definition diagrammatic representation form to generate a diagrammatic representation diagram of one function. There is.

【0011】請求項2の発明においては原始プログラム
を解析されて得るプログラム解析木を記憶するために、
各ノードのデータ構造は当該ノードの性質を表わす文法
コードを記憶する文法コード記憶欄、終端ノードとソー
スコードを記憶する終端ノードソースコード記憶欄、式
命令文のコメントと複合命令文のノードに属する複合命
令文のコメントを記憶する命令文のコメント記憶欄、命
令文群に対し対応するコメントを指向の上記憶する命令
文群のコメントポインタ欄、各子ノードを連接する各子
ノードポインタを記憶する各子ノードポインタ欄を有す
るプログラム解析木記憶部と、再帰方式でプログラム解
析木記憶部における各ノードを渡り歩いて命令文ノード
を検出するプログラム解析木渡歩部と、前記プログラム
解析木渡歩部で検出された命令文ノードがコメントを持
っているか否かを判断し、コメントを持っている命令文
ノードを定義図式変換部へ渡し、コメントを持っていな
い命令文ノードを一般図式変換部へ渡すコメント命令文
ノード検出部と、図的プログラム表現形式を記憶するた
めに、各ノードで当該ノードのデータ構造は図式のタイ
プを記憶する図的プログラム表現形式欄と動作しようと
する命令文を記憶する図的プログラム表現形式説明欄
と、子ノードの数を記憶する子ノードの数記憶欄と、分
岐毎に各子ノードの分岐条件を処理の上記憶する各子ノ
ード説明欄と、各子ノードポインタの分岐の開始を記憶
する各子ノードポインタ欄と、実行順序が次のノードを
指向して連接の上記憶する次のノードポインタ欄を有す
る図的プログラム表現図構造木記憶部と、前記コメント
命令文ノード検出部で検出されたコメントを持っている
命令文ノードのコメント部分を定義図的プログラム表現
形式ノードに変換して前記図的プログラム表現図構造木
記憶部に記憶し、原命令文ノードを一般図式変換部に渡
す定義図式変換部と、前記コメント命令文ノード検出部
で検出されたコメントを持っていない命令文ノード或い
は前記定義図式変換部から渡された命令文ノードを木構
造対応関係によって一般図的プログラム表現形式ノード
に変換して図的プログラム表現図構造木記憶部に記憶す
る一般図式変換部と、前記図的プログラム表現図構造木
記憶部から読み込まれた図的プログラム表現図構造木が
使用者の設定するプログラム抽象化深さによってコメン
ト命令文を隠すか否かを決定し、違う抽象化程度の図的
プログラム表現図を生成する抽象化図描画部とを備えた
ことを特徴とするプログラム解析装置としている。
In order to store the program analysis tree obtained by analyzing the source program,
The data structure of each node belongs to a grammar code storage field that stores a grammar code that represents the property of the node, a terminal node source code storage field that stores a terminal node and source code, a comment of an expression command statement, and a node of a compound command statement. It stores a comment storage field for command statements that stores comments for compound command statements, a comment pointer field for command statements that stores a corresponding comment for a command statement group, and a pointer for each child node that links each child node. In the program analysis tree storage unit having each child node pointer column, the program analysis tree transition unit that traverses each node in the program analysis tree storage unit in a recursive method to detect a statement node, and the program analysis tree transition unit Judge whether the detected statement node has a comment and define the statement node that has a comment In order to store the comment command statement node detection unit that passes the command statement node that does not have a comment to the general diagram conversion unit and the schematic program expression format, the data structure of the node at each node is A graphical program expression format field for storing the type, a graphical program expression format description field for storing the statement to be operated, a child node number storage field for storing the number of child nodes, and each child node for each branch Each child node description column for processing and storing the branching condition of the above, each child node pointer column for storing the start of branching of each child node pointer, and the execution order is directed to the next node Of a diagrammatic program representation diagram structure tree having a node pointer column of the above, and a comment part of a command statement node having a comment detected by the comment command statement node detection unit. The program is converted into a program expression format node and stored in the graphic program expression diagram structure tree storage unit, and the definition command conversion unit that passes the original command statement node to the general diagram conversion unit and the comment command statement node detection unit are detected. A command statement node having no comment or a command statement node passed from the definition diagram conversion unit is converted into a general graphic program expression format node by a tree structure correspondence and stored in the graphic program expression diagram structure tree storage unit. The general schematic conversion unit and the schematic program representation diagram structure tree read from the schematic program representation diagram structure storage unit determine whether or not to hide the comment statement according to the program abstraction depth set by the user. The program analysis device is provided with an abstract diagram drawing unit that generates a diagrammatic program representation diagram with a different degree of abstraction.

【0012】請求項3の発明においては図的プログラム
表現図はPAD図であることを特徴とする請求項1記載
のプログラム解析装置としている。請求項4の発明にお
いては図的プログラム表現図はPAD図であることを特
徴とする請求項2記載のプログラム解析装置としてい
る。
According to the third aspect of the invention, the program analysis apparatus according to the first aspect is characterized in that the graphical program representation diagram is a PAD diagram. In the invention of claim 4, the diagrammatic program representation diagram is a PAD diagram.

【0013】[0013]

【作 用】上記構成により、請求項1の発明に係るプロ
グラム解析装置においては、原始プログラムが本装置に
入力されてから、プログラム解析部がプログラム言語文
法記憶部の記憶する文法規則に従って文法解析をした
後、コメントでない部分に対してボトムアップ方式で各
プログラム関数のプログラム解析木を求める。コメント
である部分はコメント抽出部によって抽出されてから、
コメント分類部で分類された後プログラム解析木におけ
る適当なノードに記憶される。プログラム解析木記憶部
における適当なノードに変換の上記憶された原始プログ
ラムは、図生成部で命令文ノード毎に対応する図的プロ
グラム表現形式に変換され、コメントは命令文定義図的
プログラム表現形式に変換され、この上で一関数の図的
プログラム表現図が作成される。
With the above structure, in the program analysis device according to the invention of claim 1, after the source program is input to this device, the program analysis part performs grammatical analysis according to the grammatical rules stored in the program language grammar storage part. After that, the program parse tree of each program function is obtained by the bottom-up method for the part that is not a comment. After the comment is extracted by the comment extractor,
After being classified by the comment classifying unit, it is stored in an appropriate node in the program analysis tree. The primitive program stored after being converted into an appropriate node in the program analysis tree storage unit is converted into a diagrammatic program representation format corresponding to each statement node in the diagram generation unit, and a comment is a statement definition diagrammatic program representation format. Is converted into a schematic program representation diagram of one function.

【0014】請求項2の発明においては、プログラム解
析木記憶部に記憶されたプログラム解析木を対象に、図
生成部におけるプログラム解析木渡歩部がプログラム解
析木を渡り歩いて各命令文ノードを検出する。図生成部
におけるコメント命令文ノード検出部は検出された命令
文ノードがコメントを持っているか否かを判断する。コ
メントを持っている命令文のノードのコメント部分を図
生成部における定義図式変換部で定義図的プログラム表
現形式ノードに変換し、原命令文ノードを一般図式変換
部で処理する。また、コメントを持っていない命令文ノ
ードの子解析木を一般図式変換部でそれに対応する図的
プログラム表現形式ノードに変換する。その結果、プロ
グラム解析木は命令文ノードを単位とし、木構造対応関
係によって図的プログラム表現図構造木に変換される。
当該図的プログラム表現図構造木は抽象化図描画部で設
定された抽象化深さによって対応する抽象化図的プログ
ラム表現図を描く。
According to the second aspect of the present invention, for the program analysis tree stored in the program analysis tree storage unit, the program analysis tree crossover unit in the diagram generation unit walks across the program analysis tree to detect each statement node. To do. The comment command statement node detection unit in the diagram generation unit determines whether or not the detected command statement node has a comment. The comment portion of the node of the imperative sentence having the comment is converted into a definitive diagram representation node by the definition diagram conversion unit in the diagram generation unit, and the original statement sentence node is processed by the general diagram conversion unit. Further, the child parse tree of the imperative sentence node having no comment is converted by the general graphic conversion unit into the corresponding graphical program expression format node. As a result, the program parse tree is converted into a diagrammatic program representation diagram structure tree by the tree structure correspondence in units of statement nodes.
The diagrammatic program representation diagram structure tree draws a corresponding abstract diagrammatic program representation diagram according to the abstraction depth set by the abstract diagram drawing unit.

【0015】請求項3の発明においては、請求項1の発
明において図的プログラム表現としてPAD図が描かれ
る。請求項4の発明においては、請求項2の発明におい
て図的プログラム表現としてPAD図が描かれる。
In the third aspect of the invention, the PAD diagram is drawn as the graphical program representation in the first aspect of the invention. In the invention of claim 4, a PAD diagram is drawn as a graphical program expression in the invention of claim 2.

【0016】[0016]

【実施例】以下に、本発明を実施例に基づき説明する。
図1は本発明に係るプログラム解析装置の一実施例のブ
ロック図である。原始プログラム10は命令文を単位と
して、入力部30により入力される。〔従来の技術〕欄
で説明したように、コメントのない命令文はプログラム
解析部60でプログラム言語文法記憶部20での文法規
則によってその意味内容を理解した上での文法解析が行
われ、その結果適用文法規則に対応する解析木のノード
が作られ、プログラム解析木記憶部70によって記憶さ
れる。プログラム解析木記憶部70における各ノードは
図1の70に示すデータ構造を持っている。解析木を作
る過程において、ノードは終端ノードと中間ノードに分
けられる。ここに、終端ノードは原始プログラムの基本
記号を記憶するものである。また基本記号とはTerm
inalとも呼ばれているものであり、例えば、変数、
常数、演算子などである。中間ノードは文法規則によっ
て簡略(Reduced)された中間文法記号(Non
terminal)を記録する。そのため、プログラム
解析木における各ノードの構造にノードのTermin
al/Nonterminalのコードを記録するデー
タ欄がある。また、terminal文字列欄は原始プ
ログラムの文字列を記録するものである。四つの子ノー
ドポインタ欄は中間文法要素における子要素に対応する
ノードを指向の上記憶する。このような結び方で解析木
を多次元木構造にする。原始プログラムにおけるコメン
トはコメント抽出部40で抽出される。その抽出された
コメントはコメント分類部50で分類される。そのうえ
で、文法解析過程において、解析木における適当な命令
文ノードに置かれる。以上の作業で解析された原始プロ
グラムの全体の解析木はプログラム解析木記憶部70に
記憶される。PAD図生成部80はプログラム解析木を
PAD図に変換する。PAD図生成部80においては、
先ず、プログラム解析木渡歩部81によって記憶された
プログラム解析木を再帰方式で渡り歩く(tree w
alk)。これにより、プログラム解析木記憶部70に
おける命令文ノードを検出する。コメント命令文ノード
検出部82は当該ノードがコメントを持っているか否か
を判断する。コメントを持っていない命令文ノードは一
般図式変換部84でプログラム解析木とPAD図構造木
との木対応関係によって変換される。コメントを持って
いる命令文ノードのコメント部分は定義図式変換部83
で命令文定義PAD図式に変換される。しかる後、命令
文の部分を一般図式変換部84で処理する。変換された
PAD図構造木はPAD図構造木記憶部90に記憶され
る。PAD図が描かれる前に、プログラム解析木を図1
の90に示すデータ構造を有するPAD図構造木に変換
の上記憶することが必要である。PAD図構造木におけ
るノード毎に、一PAD図式に対応する。そのうち、P
AD図構造木記憶部90における各ノードの構造はPA
D図式欄が図式のタイプを記録し、PAD図式説明欄が
基本PAD図式に対して実行する命令文を記憶する。ほ
かのタイプのPAD図式は子ノードの数記憶欄が一図式
の分岐の数を記録し、分岐毎に子ノード説明欄でその分
岐条件を記録し、子ノードポインタ欄が分岐の開始ノー
ドを指向の上記憶し、次のノードポインタが順序実行の
次のノードを指向の上記憶する。抽象化PAD図描画部
85で、PAD図構造木記憶部90によってPAD図構
造木に対応するPAD図110を描く。しかる後、出力
部100から出力する。
EXAMPLES The present invention will be described below based on examples.
FIG. 1 is a block diagram of an embodiment of a program analysis device according to the present invention. The source program 10 is input by the input unit 30 in units of statements. As described in the [Prior Art] section, the statement without comments is subjected to grammatical analysis by the program analysis unit 60 after understanding the meaning of the semantic content according to the grammatical rules in the program language grammar storage unit 20. A parse tree node corresponding to the result application grammar rule is created and stored by the program parse tree storage unit 70. Each node in the program analysis tree storage unit 70 has a data structure 70 shown in FIG. In the process of creating a parse tree, nodes are divided into end nodes and intermediate nodes. Here, the terminal node stores the basic symbol of the source program. The basic symbol is Term
It is also called internal, for example, variables,
Constants, operators, etc. The intermediate node is an intermediate grammar symbol (Non) reduced by the grammar rule.
Record the terminal). Therefore, in the structure of each node in the program analysis tree, the term
There is a data field for recording the al / Nonterminal code. The terminal character string column records the character string of the source program. The four child node pointer fields are used to store the nodes corresponding to the child elements in the intermediate grammar element in an oriented manner. The parse tree is made into a multidimensional tree structure by such a knotting method. The comment in the source program is extracted by the comment extraction unit 40. The extracted comments are classified by the comment classifying unit 50. Then, it is placed in an appropriate statement node in the parse tree in the grammar analysis process. The entire analysis tree of the source program analyzed by the above work is stored in the program analysis tree storage unit 70. The PAD diagram generation unit 80 converts the program analysis tree into a PAD diagram. In the PAD diagram generator 80,
First, the program analysis tree stored by the program analysis tree walking unit 81 is walked in a recursive manner (tree w).
alk). As a result, the statement node in the program analysis tree storage unit 70 is detected. The comment statement node detector 82 determines whether or not the node has a comment. A statement node having no comment is converted by the general diagram conversion unit 84 according to the tree correspondence between the program analysis tree and the PAD diagram structure tree. The comment part of the statement node that has a comment is the definition diagram conversion part 83.
Is converted into a statement definition PAD diagram. After that, the general graphic conversion unit 84 processes the part of the imperative sentence. The converted PAD diagram structure tree is stored in the PAD diagram structure tree storage unit 90. Before the PAD diagram is drawn, the program parse tree is shown in Figure 1.
It is necessary to convert the data into a PAD diagram structure tree having the data structure shown in 90 of FIG. Each node in the PAD diagram structure tree corresponds to one PAD diagram. Of which P
The structure of each node in the AD diagram structure tree storage unit 90 is PA
The D-scheme column records the type of diagram, and the PAD-scheme description column stores the statements to execute for the basic PAD diagram. In other types of PAD diagrams, the number of child nodes storage column records the number of branches in one diagram, the branch condition is recorded in the child node description column for each branch, and the child node pointer column points to the start node of the branch. And the next node pointer points to the next node of the sequential execution. In the abstracted PAD diagram drawing unit 85, the PAD diagram structure tree storage unit 90 draws the PAD diagram 110 corresponding to the PAD diagram structure tree. Then, the output unit 100 outputs the data.

【0017】図4は本実施例のフローチャートである。
以下、これにもとづいて説明する。(S1)原始プログ
ラムは本発明に係る−ログラム解析装置に入力された
後、ファイルが終了か否かを判断する。(S2)終了で
はない場合、プログラムの命令文を読み込む。(S3)
当該命令文がコメントであるか否かを判断する。
FIG. 4 is a flow chart of this embodiment.
Hereinafter, description will be given based on this. (S1) The source program according to the present invention is input to the program analyzer, and then it is determined whether or not the file ends. (S2) If it is not finished, the command statement of the program is read. (S3)
It is determined whether the statement is a comment.

【0018】(S8)コメントではない場合、文法規則
により文法解析を行う。本実施例ではC言語を採用して
おり、その文法規則を以下に示す。 translation unit :external declaration |external declaration translation unit external declaration :function definition |declaration function definition :declaration specifiers declarator declaration list compound statement |declarator declaration list compound statement |declaration specifiers declarator compound statement |declarator compound statement declaration :declaration specifiers init declarator list';' |declaration specifiers';' declaration list :declaration |declaration list declaration declaration specifiers :storage class specifier specifier qualifie list |storage class specifier |specifier qualifie list storage class specifier : AUTO |REGISTER |STATIC |EXTERN |TYPEDEF type specifier :VOID |CHAR |SHORT |INT |LONG |FLOAT |DOBLE |UNSIGNED |struct or union specifier |enum specifier |typedef name type qualifier :CONST |VOLATILE struct or union specifier :struct or union identifier '{'struct declaration list' }' |struct or union '{'struct declaration list' }' |struct or union identifier struct or union :STRUCT |UNION struct declaration list :struct declaration |struct declaration list struct declaration init declarator list :init declarator |init declarator list ','init declarator init declarator :declarator |declarator '='initializer struct declaration :specifier qualifier list struct declarator list';' specifier qualifier list :type qualifier |type qualifier specifier qualifier list |type specifier |type specifier specifier qualifier list struct declarator list :struct declarator |struct declarator list','struct declarator struct declarator :declarator |declarator','constant expression |','constant expression enum specifier :ENUM identifier'{'enumerator list' }' |ENUM identifier'{'enumerator list',''}' |ENUM'{'enumerator list' }' |ENUM'{'enumerator list',''}' |ENUM identifier emunerator list :enumerator |enumerator list','enumerator enumerator :identifier |identifier'='constant expression declarator :pointer direct declarator |direct declarator direct declarator :identifier |'('declarator')' |direct declarator' 'constant expression' ' |direct declarator' '' ' |direct declarator'('parameter type list')' |direct declarator'('identifier list')' |direct declarator'('')' pointer :'*' |'*'type qualifier list |'*'type qualifier list pointer |'*' pointer type qualifier list :type qualifier |type qualifier list type qualifier parameter type list :parameter list |parameter list',''.''.''.' parameter list :parameter declaration |parameter list','parameter declaration parameter declaration :declaratio specifiers declarator |declaration specifiers abstract declarator |declaration specifiers identifier list :identifier |identifier list','identifier initializer :assignment expression |'{'initializer list' }' |'{'initializer list',''}' initializer list :initializer |initializer list','initializer type name :specifier qualifier list abstract declarator |specifier qualifier list; abstract declarator :pointer |pointer direct abstract declarator |direct abstract declarator direct abstract declarator :'('abstract declarator')' |direct abstract declarator' 'constant expression' ' |' 'constant expression' ' |direct abstract declarator' '' ' |' '' ' |direct abstract declarator'('parameter type list')' |'('parameter type list')' |direct abstract declarator'('')' |'('')' typedef name :identifier statement :labeled statement |case statement |expression statement |compound statement |if statement |switch statement |while statement |do while statement |for statement |goto statement |continue statement |return statement |break statement |COMMENT STATEMENT labeled statement :identifier':'statement case statement :CASE constant expression':'statement |DEFAULT':'statement expression statement :expression';' |';' compound statement :'{'declaration list statement list'}' |'{'statement list' }' |'{'declaration list '}' |'{''}' statement list :statement |statement statement list if statement :IF'('expression')'statement ELSE statement |IF'('expression')'statement switch statement :SWITCH'('expression')'statement while statement :WHILE'('expression')'statement do while statement :DO statement WHILE'('expression')'';' for statement :FOR'('expression';'expression';'expression ')'statement |FOR'('';'expression';'expression')'statement |FOR'('expression';'';' expression ')' statement |FOR'('expression';'expression';'')'statement |FOR'('expression';'';'')'statement |FOR'('';'expression';'')'statement |FOR'('';'';'expression')'statement |FOR'('';'';'')'statement goto statement :GOTO identifier ';' continue statement :CONTINUE ';' break statement :BREAK';' return statement :RETURN';' |RETURN expression';' expression :assignment expression |expression','assignment expression assignment expression :conditional expression |unary expression assignment operator assignment expression assignment operator :'=' |MULBY |DIVBY |MODBY |ADDTO |MINBY |SHRBY |SHLBY |ANDWT |XORWT |ORWT conditional expression :logical OR expression |logical OR expression'?'expression':' conditional expression constant expression :conditional expression logical OR expression :logical AND expression |logical OR expression OR logical AND expression logical AND expression:inclusive OR expression |logical AND expression AND inclusive OR expression inclusive OR expression :exclusive OR expression' |inclusive OR expression ' |'exclusive OR expression exclusive OR expression :AND expression |exclusive OR expression'∧'AND expression(注、∧は上添え字、印字の都合で大 きく示す。) AND expression :equality expression |AND expression '&' equality expression equality expression :relational expression |equality expression EQU relational expression |equality expression NEQU relational expression relational expression :shift expression |relational expression ' <'shift expression |relational expression ' >'shift expression |relational expression LE shift expression |relational expression GE shift expression shift expression :additive expression |shift expression SHL additive expression |shift expression SHR additive expression additive expression :multiplicative expression |additive expression'+'multiplicative expression |additive expression'-'multiplicative expression multiplicative expression :cast expression |multiplicative expression '*'cast expression |multiplicative expression '/ 'cast expression |multiplicative expression '%'cast expression cast expression :unary expression |'('type name')'cast expression buildnode(cast expression,1,1,0,0); ; unary expression :postfix expression |INC unary expression |DEC unary expression |unary operator cast expression |SIZEOF unary expression |SIZEOF'('type name')' unary operator :'&' |'*' |'+' |'-' |'〜' |'!' postfix expression :primary expression |postfix expression' 'expression' ' |postfix expression'('argument expression list')' |postfix expression'('')' |postfix expression'.'identifier |postfix expression ARROW identifier |postfix expression INC |postfix expression DEC primary expression :identifier | constant |'('expression')' argument expression list :assignment expression |argument expression list','assignment expression constant :INT CONST |CHAR CONST |STR CONST |FLT CONST identifier :ID (S9)プログラム解析部60がボトムアップ方式(B
ottom−up、木構造の下から作業をすすめる。)
によって前に読み込まれたプログラム命令文に対応する
プログラム解析木のノードを作る。
(S8) Grammar rule if not a comment
Grammar analysis is performed by. In this embodiment, C language is adopted.
And the grammatical rules are shown below. translation unit: external declaration | external declaration translation unit external declaration: function definition | declaration function definition: declaration specifiers declarator declaration list compound statement | declarator declaration list compound  statement | declaration specifiers declarator compound statement | declarator compound statement declaration: declaration specifiers init declarator list ';' | declaration specifiers ';' declaration list : declaration | declaration list declaration declaration specifiers: storage class specifier specifier qualifie list | storage class specifier | specifier qualifie list storage class specifier: AUTO | REGISTER | STATIC | EXTERN | TYPEDEF type  specifier : VOID | CHAR | SHORT | INT | LONG | FLOAT | DOBLE | UNSIGNED | struct or union specifier | enum specifier | typedef name type  qualifier : CONST | VOLATILE struct  or union  specifier: struct or union identifier '{' struct declaration list '}' | struct or union '{' struct  declaration list '}' | struct or union identifier struct  or union: STRUCT | UNION struct  declaration list: struct declaration | struct declaration list struct  declaration init  declarator list: init declarator | init declarator list ',' init  declarator init  declarator: declarator | declarator '=' initializer struct  declaration: specifier qualifier list struct  declarator list ';' specifier qualifier list: type qualifier | type qualifier specifier  qualifier  list | type specifier | type specifier specifier qualifier  list struct  declarator list: struct declarator | struct declarator list ',' struct  declarator struct  declarator: declarator | declarator ',' constant expression | ',' constant expression enum  specifier: ENUM identifier '{' enumerator list '}' | ENUM identifier '{' enumerator list ',' '}' | ENUM '{' enumerator list '}' | ENUM '{' enumerator list ',' '}' | ENUM identifier emunerator  list : enumerator | enumerator list ',' enumerator enumerator: identifier | identifier '=' constant  expression declarator: pointer direct declarator | direct declarator direct  declarator: identifier | '(' declarator ')' | direct declarator '' constant  expression '' | direct declarator '' '' | direct declarator '(' parameter type  list ')' | direct declarator '(' identifier list ')' | direct declarator '(' ')' pointer: '*' | '*' type qualifier list | '*' type qualifier list pointer | '*' pointer type  qualifier  list: type qualifier | type qualifier list type qualifier parameter type  list: parameter list | parameter list ',' '.' '.' '.' parameter list: parameter declaration | parameter list ',' parameter declaration parameter declaration: declaration specifiers declarator | declaration specifiers abstract  declarator | declaration specifiers identifier  list : identifier | identifier list ',' identifier initializer: assignment expression | '{' initializer list '}' | '{' initializer list ',' '}' initializer list : initializer | initializer list ',' initializer type  name: specifier qualifier list abstract  declarator | specifier qualifier list; abstract  declarator : pointer | pointer direct abstract declarator | direct abstract declarator direct  abstract declarator: '(' abstract declarator ')' | direct abstract declarator '' constant  expression '' | '' constant expression '' | direct abstract declarator '' '' | '' '' '' | direct abstract declarator '(' parameter type list ')' | '(' parameter type list ')' | direct abstract declarator '(' ')' | '(' ')' typedef name: identifier statement: labeled statement | case statement | expression statement | compound statement | if statement | switch statement | while statement | do while statement | for statement | goto statement | continue statement | return statement | break statement | COMMENT STATEMENT labeled statement: identifier ':' statement case  statement: CASE constant expression ':' statement | DEFAULT ':' statement expression  statement: expression ';' | ';' compound  statement: '{' declaration list statement  list '}' | '{' statement list '}' | '{' declaration list '}' | '{' '}' statement list : statement | statement statement list if  statement: IF '(' expression ')' statement ELSE statement | IF '(' expression ')' statement switch  statement: SWITCH '(' expression ')' statement while statement: WHILE '(' expression ')' statement do  while  statement: DO statement WHILE '(' expression ')' ';' for statement: FOR '(' expression ';' expression ';' expression ')' statement | FOR '(' ';' expression ';' expression ')' statement | FOR '(' expression ';' ';' expression ' ) 'statement | FOR' ('expression'; 'expression'; '') 'statement | FOR' ('expression'; ''; '') 'statement | FOR' (''; 'expression'; '') 'statement | FOR' (''; ''; 'expression') 'statement | FOR' (''; ''; '') 'statement goto  statement: GOTO identifier ';' continue  statement: CONTINUE ';' break statement: BREAK ';' return  statement : RETURN ';' | RETURN expression ';' expression : assignment expression | expression ',' assignment expression assignment expression: conditional expression | unary expression assignment operator assignment expression assignment operator: '=' | MULBY | DIVBY | MODBY | ADDTO | MINBY | SHRBY | SHLBY | ANDWT | XORWT | ORWT conditional expression: logical OR expression | logical OR expression '?' expression ':' conditional expression constant  expression: conditional expression logical OR  expression: logical AND expression | logical OR expression OR logical AND expression logical AND expression: inclusive OR expression | logical AND expression AND inclusive  OR expression inclusive OR expression: exclusive OR expression '| inclusive OR expression '|' exclusive  OR expression exclusive OR expression: AND expression | exclusive OR expression'∧ 'AND  expression (Note, ∧ is an upper subscript, and is shown for convenience of printing.) AND expression: equality expression | AND expression '&' equality expression equality  expression: relational expression | equality expression EQU relational  expression | equality expression NEQU relational  expression relational  expression: shift expression | relational expression '<' shift  expression | relational expression '>' shift  expression | relational expression LE shift  expression | relational expression GE shift  expression shift expression: additive expression | shift expression SHL additive  expression | shift expression SHR additive  expression additive  expression: multiplicative expression | additive expression '+' multiplicative  expression | additive expression '-' multiplicative  expression multiplicative expression: cast expression | multiplicative expression '*' cast  expression | multiplicative expression '/' cast  expression | multiplicative expression '%' cast  expression cast  expression: unary expression | '(' type name ')' cast expression buildnode (cast expression, 1,1,0,0);; unary expression: postfix expression | INC unary expression | DEC unary expression | unary operator cast expression | SIZEOF unary expression | SIZEOF '(' type name ')' unary operator: '&' | '*' | '+' | '-' | '~' | '!' postfix expression: primary expression | postfix expression '' expression '' | postfix expression '(' argument expression list ')' | postfix expression '(' ')' | postfix expression '.' identifier | postfix expression ARROW identifier | postfix expression INC | postfix expression DEC primary expression: identifier | constant | '(' expression ')' argument  expression list: assignment expression | argument expression list ',' assignment  expression constant : INT CONST | CHAR CONST | STR CONST | FLT CONST identifier: ID (S9) The program analysis unit 60 uses the bottom-up method (B
opt-up, work from below the tree structure. )
Corresponds to the program statement previously read by
Create a node of the program analysis tree.

【0019】(S4)(S2)のステップで読み込まれ
た命令文がコメントであると(S3)のステップで判断
すれば、コメント分類部50にてその種類が以下のいず
れであるかが判断された上で分類される。その際の分類
規則を次に示す。 1.式命令文(expression)のコメント:命
令文の後に直ぐ付くコメントである(即ち、当該命令文
との間を非空白文字或いは改行で区切るのではない)。
例えば、図3に示す/*Assemble the c
ompletefile name*/、/*Prep
rocess a source program f
ile*/、/*Check the syntax
of asource program file*/
である。前の式命令文を解釈するものである。
If it is determined in the step (S3) that the command statement read in the steps (S4) and (S2) is a comment, the comment classification unit 50 determines which one of the following types. It is classified according to the above. The classification rules in that case are shown below. 1. Expression statement comment: A comment that immediately follows the statement (that is, it is not separated from the statement by non-whitespace characters or line breaks).
For example, as shown in FIG. 3, / * Assemble the c
completefile name * /, / * Prep
process a source program f
ile * /, / * Check the syntax
of source program file * /
Is. It interprets the previous expression statement.

【0020】2.複合命令文のコメント:複合命令文の
左の大きい括弧の後に直ぐ付くコメントである(即ち、
当該複合命令文との間を非空白文字或いは改行で区切る
のではない)。例えば、(図3)に示す/*Parsi
ng a source program file*
/である。複合命令文(左の大きい括弧と右の大きい括
弧との間の文)を解釈する。
2. Compound statement comment: A comment that immediately follows the large bracket to the left of the compound statement (ie,
It is not separated from the compound statement by non-whitespace characters or line breaks). For example, / * Parsi shown in (Fig. 3)
ng a source program file *
/ Interpret compound statements (statements between left and right big brackets).

【0021】3.命令文群のコメント:一行の開始はコ
メントである。(即ち、その前は非空白文字がない)そ
の後に付く命令文群(空白行或いは他のコメント群ま
で)を解釈するのである。例えば、(図3)の第2行目
に示す/*Prepare asource prog
ram file for parsing*/であ
る。当該コメントは空白行(第5行目)によって区切ら
れた命令文群(第3行目及び第4行目の文を含む)を解
釈する。
3. Comment of statement group: The start of one line is a comment. (That is, there is no non-whitespace character before it) Interpret the statement group (up to a blank line or other comment group) that follows it. For example, in the second line of (Fig. 3) / * Prepare assured prog
ram file for parsing * /. The comment interprets a command statement group (including statements on the third and fourth lines) separated by a blank line (fifth line).

【0022】4.以上の規則に適合しなければコメント
を処理しない。 (S8)(S3)のステップで当該命令文がコメントで
はないと判断した場合には、本ステップでプログラム解
析部60が文法解析を行う。(S9)プログラム言語文
法のある文法規則を満せば、そして当該文法規則が引用
された場合には、当該文法規則によって対応するプログ
ラム解析木のノードを作る。図5に、if命令文が処理
された後、それに対応するプログラム解析木における子
木を示す。if命令文は五つの部分からなる。それはキ
ーワードif、左括弧’(’、条件式(express
ion)、右括弧’)’、複合命令文である。そのう
ち、if、左括弧、右括弧はif命令文毎に定まるいわ
ば固定された部分であるためわざわざ特別なノードで記
憶する必要はない。一方、条件式と複合命令文は、それ
ぞれ子部分があるためそれぞれのノードで記憶する。こ
のため、図5における各ノードから発する各実線はそれ
ぞれ子ノードポインタに対応し、また実線にて接続され
たノードは当該ノードの子ノードである。破線と破線で
連接された部分は固定部分であるので、子ノードが存在
しない。終端ノードにおける括弧内の文字列は当該ノー
ドにおける終端ノードソースコード記録欄に記録されて
いる値である。
4. Comments are not processed unless the above rules are met. When it is determined that the statement is not a comment in steps (S8) and (S3), the program analysis unit 60 performs grammar analysis in this step. (S9) If a certain grammatical rule of the program language grammar is satisfied, and if the grammatical rule is quoted, a node of the program parse tree corresponding to the grammatical rule is created. FIG. 5 shows a child tree in the program parse tree corresponding to the processed if statement. The if statement consists of five parts. It is keyword if, left parenthesis '(', conditional expression (express
Ion), right parenthesis ')', compound statement. Of these, if, left parenthesis, and right parenthesis are so-called fixed parts that are determined for each if statement, so they do not need to be stored in a special node. On the other hand, since the conditional expression and the compound statement have child parts, they are stored in each node. Therefore, each solid line emitted from each node in FIG. 5 corresponds to a child node pointer, and the node connected by the solid line is a child node of the node. Since the part connected by the broken line and the broken line is a fixed part, there are no child nodes. The character string in parentheses at the end node is the value recorded in the end node source code recording field at the node.

【0023】(S5)(S4)のステップによってコメ
ントが分類された後、各コメントはプログラム解析木に
相応して変換の上プログラム解析木記憶部70に記憶さ
れる。図1の70に示すデータ構造における命令文のコ
メント欄と命令文群のコメントポインタ欄はコメント処
理のために付加し拡張されたものである。そして、命令
文のノードを処理する場合だけ作用する。
After the comments are classified in steps (S5) and (S4), each comment is converted and stored in the program analysis tree storage unit 70 in accordance with the program analysis tree. The comment column of the command statement and the comment pointer column of the command statement group in the data structure 70 shown in FIG. 1 are added and expanded for comment processing. And it works only when processing a node of a statement.

【0024】(S6)命令文ノードに対して、命令文群
のコメントポインタ欄は属する命令文群のコメントに対
応するノードを指向の上記憶する。すなわち、同じ命令
文群に属する各命令文ノードに対し命令文群のコメント
ポインタ欄は同じ命令文群のコメントノードを指向の上
記憶する。同じく命令文のコメント記憶欄は式命令文の
ノードに属する式命令文のコメントと、複合命令文のノ
ードに属する複合命令文のコメントを記憶する。
(S6) For the command statement node, the comment pointer column of the command statement group stores the node corresponding to the comment of the command statement group to which it belongs. That is, for each statement node belonging to the same statement group, the comment pointer column of the statement group stores the comment node of the same statement group while pointing. Similarly, the comment storage column of the command statement stores the comment of the formula command statement that belongs to the node of the formula command statement and the comment of the compound command statement that belongs to the node of the compound command statement.

【0025】(S7)(S5)(S6)のステップで式
命令文或いは複合命令文のコメントが判断されたなら
ば、プログラム解析木における適当な命令文ノードを選
択する。そして、コメントを選択された命令文ノードに
置く。(S8)(S5)のステップで命令文群のコメン
トであると判断したなら、文法解析を行う。
When the comment of the expression command statement or the compound command statement is judged in the steps (S7), (S5) and (S6), an appropriate command statement node in the program analysis tree is selected. Then, the comment is placed at the selected statement node. If it is determined in the steps (S8) and (S5) that the comment is a statement group, grammar analysis is performed.

【0026】続いて前記三種類のコメントがどのように
プログラム解析木に記憶されるのかを説明する。なお、
式命令文のコメントは主に式命令文を解釈するのに使用
される。(S6)式命令文のコメントが読み込まれてか
ら、当該コメントの前に式命令文が簡略されたものであ
るか否かを判断する。
Next, how the above three types of comments are stored in the program analysis tree will be described. In addition,
Expression statement comments are primarily used to interpret expression statements. (S6) After the comment of the expression command statement is read, it is determined whether the expression command statement is simplified before the comment.

【0027】(S7)もし、そうであれば、コメントを
当該式命令文に対応するノードにおける命令文のコメン
ト欄に記憶する。なければ、当該コメントを処理しな
い。これを図5を参照しつつ具体的に説明する。本図に
おいて、/*multiplya by b */は分
類規則によって式命令文のコメントであると判断され
る。そして、その前のproduct=a*bはまた式
命令文があるので、このコメントをそれに対応する式命
令文ノードに記憶する。もし、複合命令文のコメントが
読み込まれたら、(S6)と(S7)のステップでは、
当該コメントをそれが属する複合命令文の簡略された後
のノードにおける命令文のコメント欄に記憶する。例え
ば、本図の/*compute product*/は
規則によって複合命令文のコメントであり、その属する
複合命令文の簡略された後のノードにおける命令文のコ
メント欄に記憶する。
(S7) If so, the comment is stored in the comment field of the command statement in the node corresponding to the expression command statement. If not, the comment is not processed. This will be specifically described with reference to FIG. In the figure, / * multiplya by b * / is determined to be a comment of the expression command statement according to the classification rule. Then, since the preceding product = a * b also has an expression statement, this comment is stored in the corresponding expression statement node. If the comment of the compound statement is read, in steps (S6) and (S7),
The comment is stored in the comment column of the command statement in the node after the simplified command statement to which it belongs. For example, / * compute product * / in the figure is a comment of a compound command statement according to a rule, and is stored in the comment field of the command statement in the node after the compound command statement to which it belongs.

【0028】もし、命令文群のコメントであれば、複雑
な処理の必要がある。何故ならば、前に述べたように本
発明は命令文群のコメントを特殊文と見なすからであ
る。即ち、コメント命令文である。以下、これについて
説明する。(S8)(S5)ステップで抽出された後、
文法解析を行う。本ステップでは、命令文として解析す
るので、プログラミング言語の文法に次の文法規則を加
える。statement:COMMENT_STAT
EMENT;命令文群のコメントは(S2)のステップ
で読み込まれてから、前記の文法規則によって本ステッ
プで簡略される。
If the comment is a statement group, complicated processing is required. This is because, as described above, the present invention regards comments in a group of imperative sentences as special sentences. That is, it is a comment command statement. This will be described below. After being extracted in steps (S8) and (S5),
Perform grammar analysis. In this step, since it is analyzed as an imperative sentence, the following grammar rule is added to the grammar of the programming language. statement: COMMENT_STAT
The comment of the command group is read in the step (S2) and then simplified in this step by the grammatical rules described above.

【0029】(S9)でプログラム解析木にコメント命
令文ノードを作られる。図6にこれらを例示する。本図
において、一行目の/*factorial comp
utation*/は簡略されてコメント命令文になっ
たうえに、コメント命令文ノードを作られる。なお、命
令文群は連続の命令文が同一レベルに属する命令文の集
まりと定義されている。同一のレベルに属する命令文群
と命令文群の間は空白行或いはコメント命令文で区切ら
れる。本図の第2、3、4行目における命令文は即ち第
1行目の、/*factorial computat
ion*/を命令文群のコメントとする命令文群であ
る。第6行目はもう一つの命令文群である。同一の命令
文群における命令文毎に、図4の(S8)のステップに
よって簡略された後に、(S9)のステップで当該命令
文のノードを作る場合、当該ノードの命令文群のコメン
トポインタ欄は属する命令文群のコメントノードを指向
の上記憶する。このため、図6の第2、3、4行目にお
ける命令文に対応するノード命令文群のコメントポイン
タ欄は同一命令文群のコメントノードを指向する(即
ち、/*factorial computation
*/から形成した命令文群のコメントノード)。この三
つのノードを解析木における連接関係ができるようにす
る。
At (S9), a comment statement node is created in the program analysis tree. FIG. 6 illustrates these. In this figure, the first line / * factual comp
notation * / is simplified into a comment statement, and a comment statement node is created. The command statement group is defined as a group of command statements in which consecutive command statements belong to the same level. A command line group and a command line group belonging to the same level are separated by a blank line or a comment command line. The command statement on the second, third, and fourth lines of this figure is the / * factual compute command on the first line.
It is an instruction statement group in which ion * / is a comment of the instruction statement group. The sixth line is another statement group. For each statement in the same statement group, when the node of the statement is created in step (S9) after being simplified by the step (S8) of FIG. 4, the comment pointer column of the statement group of the node Stores the comment node of the statement group to which it belongs in an oriented manner. Therefore, the comment pointer column of the node statement group corresponding to the statement on the second, third, and fourth lines of FIG. 6 points to the comment node of the same statement group (that is, / * factual computation).
Comment node of the statement group formed from * /). The three nodes will be connected in the parse tree.

【0030】図4の(S8)と(S9)のステップを経
て原始プログラムのプログラム解析木が得られる。そし
て、プログラム解析木をPAD図構造木に変換する。次
に図7から図10(図7から図10は本来1の図番を採
用するのが妥当であるが、電子出願の都合で4分割す
る。)にC言語の命令文と各PAD図式との対応関係
を、各PAD図式に該当する各ノードのデータ構造で示
す。なお、原始プログラムにおける順序実行命令文はP
AD図で上方から下方へ連接するPAD図式によって表
わす。入れ子構造を持っている命令文、例えばIF(条
件判断)、SWITCH(多重分岐の1)、ループ、に
対応するPAD図式は階層関係を生成する。そして、P
AD図はただ左へ、下へ展開して木構造となる。命令文
定義PAD図式は、文の定義によって原始プログラムに
おけるコメントがPAD図に含まれて表示される。その
結果、プログラマに対する説明性がより良好となる。本
図7〜図10にも三種類のコメントに対応する命令文定
義PAD図式を示す。各図の一番右の所に示すのは記憶
される各図式のPAD図式のデータ構造である。
The program analysis tree of the source program is obtained through the steps (S8) and (S9) of FIG. Then, the program analysis tree is converted into a PAD diagram structure tree. Next, in FIG. 7 to FIG. 10 (in FIG. 7 to FIG. 10, it is proper to adopt the drawing number of 1 originally, but it is divided into four for convenience of electronic filing). The correspondence relation of is shown by the data structure of each node corresponding to each PAD scheme. The sequential execution statement in the source program is P
This is represented by a PAD diagram which is connected from the upper side to the lower side in the AD diagram. PAD diagrams corresponding to a statement having a nested structure, for example, IF (conditional judgment), SWITCH (1 of multiple branch), and loop generate a hierarchical relationship. And P
The AD diagram just expands to the left and down to form a tree structure. The statement definition PAD diagram is displayed by including the comment in the source program in the PAD diagram according to the definition of the statement. As a result, the description to the programmer is better. 7 to 10 also show command statement definition PAD diagrams corresponding to three types of comments. The rightmost part of each figure shows the data structure of the stored PAD diagram of each diagram.

【0031】プログラム解析木からPAD図構造木への
木構造対応変換過程は図4の(S10)のステップから
始まり、プログラム解析木渡歩部81が再帰方式でプロ
グラム解析木の根ノードから渡り歩く。(S11)プロ
グラム解析木渡歩部81により命令文ノードが検出さ
れ、コメント命令文ノード検出部82が当該ノードがコ
メントを持っているか否かを判断する。
The tree structure correspondence conversion process from the program analysis tree to the PAD diagram structure tree starts from step (S10) in FIG. 4, and the program analysis tree walking unit 81 walks from the root node of the program analysis tree in a recursive manner. (S11) The command analysis node is detected by the program analysis tree walking unit 81, and the comment command statement node detection unit 82 determines whether or not the node has a comment.

【0032】(S13)もっていないと判断されたな
ら、当該命令文ノードがどんな命令文ノードであるかを
判断する。(S14)、(S15)命令文のタイプによ
って一般PAD図式変換をする。以下に(S15)のス
テップでの各命令文のタイプに対応した変換を説明す
る。
(S13) If it is determined that the instruction statement node does not exist, it is determined what the instruction statement node is. (S14), (S15) General PAD diagram conversion is performed according to the type of the statement. The conversion corresponding to the type of each statement in the step (S15) will be described below.

【0033】図11に(S14)と(S15)のステッ
プで式命令文とジャンプ命令文(例えば、GOTO、C
ONTINUE、BREAK、RETURN等)を対応
する一般PAD図式に変換する方式を示す。(S14)
適当なノードが検出されたら、原始コード還元手続によ
って前検出された解析木のノードの以下の子解析木を追
跡して、原始コードを還元する。
In FIG. 11, in the steps (S14) and (S15), an expression command statement and a jump command statement (for example, GOTO, C).
(ONTINUE, BREAK, RETURN, etc.) is converted into a corresponding general PAD scheme. (S14)
When an appropriate node is detected, the source code is reduced by tracing the following child parse tree of the node of the parse tree previously detected by the source code reduction procedure.

【0034】(S15)その結果を新生成されたPAD
図式ノードのPAD図式説明欄に置き、変換を終了す
る。図12から図14に(S14)と(S15)のステ
ップで三種類のループ命令文を対応するループPAD図
式に変換方式を示す。C言語におけるループ命令文には
WHILE、DO−WHILE、FORの三種類があ
る。図12はWHILE命令文をループPAD図式に対
応変換する過程を示すものである。本図において、上の
部分はWHILE命令文の解析木である。そのうち、子
解析木expressionとstatementを含
む。
(S15) The result is the newly generated PAD
Place it in the PAD diagram description field of the diagram node and finish the conversion. 12 to 14 show conversion methods of three types of loop command statements into corresponding loop PAD diagrams in steps (S14) and (S15). There are three types of loop command statements in C language: WHILE, DO-WHILE, and FOR. FIG. 12 shows a process of converting a WHILE statement into a loop PAD diagram. In the figure, the upper part is the parse tree of the WHILE statement. Among them, child parse trees expression and statement are included.

【0035】(S14)のステップでの原始コード還元
手続によってexpressionノードの以下の子解
析木に対して還元を行う。(S15)のステップでその
結果を新生成されたループPAD図式ノードの子ノード
説明欄に置く。そして、当該子ノードポインタはsta
tementノードからの(S10)から(S15)ま
でのステップでの再帰変換によって生成されたPAD図
式ノードを指向して、変換を終了する。
Reduction is performed on the following child parse tree of the expression node by the source code reduction procedure in step (S14). In step (S15), the result is placed in the child node description field of the newly generated loop PAD diagram node. The child node pointer is sta
The conversion is terminated by pointing to the PAD diagram node generated by the recursive conversion in the steps (S10) to (S15) from the element node.

【0036】ほかの二種類のループ命令文に対しても同
様の処理をする。違うのはただ子ノード説明欄の記憶す
る条件の内容である。すなわち、(S14)のステップ
でDO−WHILE命令文の対応するPAD図式ノード
に子ノード説明の前に‘do’を入れる。同じく、FO
R命令文に対して三つのexpressionノードを
新たに還元する。それから連接して子ノード説明欄に置
く。
Similar processing is performed for the other two types of loop command statements. The only difference is the content of the conditions stored in the child node description field. That is, in step (S14), "do" is inserted before the child node description in the corresponding PAD diagram node of the DO-WHILE statement. Similarly, FO
Three expression nodes are newly reduced to the R statement. Then connect them and put them in the child node description field.

【0037】以上により、図12から図14までのルー
プ命令文に対する変換説明を終了する。図15から図1
7に(S14)と(S15)のステップで選択命令文を
選択PAD図式に変換する方式を示す。選択PAD図式
は多条件分岐を処理するのである。IF命令文或いはS
WITCH命令文に多条件分岐がある。図15に、図4
の(S14)と(S15)のステップで簡単なIF命令
文を二分岐選択PAD図式ノードに変換する過程を示
す。なお、図15の上の部分はIF命令文の解析木であ
る。図中、IF命令文は一条件式と二つの動作文を含む
ので、(S15)のステップで生成された選択PAD図
式ノードでは、二つの子ノードポインタ欄がそれぞれ当
該二つの動作命令文の対応する子PAD図ノードを指向
の上記憶する。
With the above, the conversion explanation for the loop command statement of FIGS. 12 to 14 is completed. 15 to 1
7 shows a method of converting a selection command statement into a selection PAD diagram in steps (S14) and (S15). The selective PAD scheme handles multi-conditional branches. IF statement or S
There is a multi-condition branch in the WITCH statement. In FIG.
In the steps (S14) and (S15), the process of converting a simple IF statement into a two-branch selection PAD diagram node will be described. The upper part of FIG. 15 is the parse tree of the IF statement. In the figure, the IF command statement includes one conditional expression and two action statements, so in the selected PAD diagram node generated in step (S15), two child node pointer fields correspond to the two action command statements, respectively. The child PAD diagram node to be stored is oriented and stored.

【0038】(S14)のステップで条件式は原始コー
ド還元手続によって還元される。(S15)のステップ
で当該PAD図式ノードにおける第一子ノード説明欄に
置かれる。もし、第二の命令文もIF命令文であれば、
入れ子命令文(Nested IF−statemen
t)になる。そして、その対応する選択PAD図式は多
分岐選択に属する。これを図16に示す。本図に示す如
く、Kレベル(Lebel、Lebel=“heigh
t−depth”)を持っている入れ子IF命令文の解
析木に対して生成された選択PAD図式はK個の子ノー
ドがある。各レベルの命令文の条件式は図4の(S1
4)のステップで原始コード還元手続によって還元さ
れ、(S15)のステップで対応位置の子ノード説明欄
に置かれる。当該子ノードポインタ欄は当該条件式の後
の命令文からの再帰変換によって生成された子ノードを
指向の上記憶する。
In step (S14), the conditional expression is reduced by the source code reduction procedure. In the step (S15), the PAD diagram node is placed in the first child node description field. If the second statement is also an IF statement,
Nested IF-statemen
t). And the corresponding selected PAD scheme belongs to multi-branch selection. This is shown in FIG. As shown in the figure, the K level (Level, Level = “height”
The selected PAD diagram generated for the parse tree of the nested IF statement having t-depth ″) has K child nodes. The conditional expression of the statement at each level is (S1 in FIG.
In step 4), it is reduced by the source code reduction procedure, and in step S15, it is placed in the child node description field at the corresponding position. The child node pointer column directs and stores the child node generated by the recursive conversion from the imperative sentence after the conditional expression.

【0039】図17に(S14)と(S15)のステッ
プでSWITCH命令文を多分岐選択PAD図式に変換
する方式を示す。C言語によって一SWITCH命令文
は一式命令文と一複合命令文を含む。複合命令文におけ
る命令文列はlabeled_statementで沢
山の命令文ブロックを区切られる。各labeled_
statementにおける“case”の後のcon
stant_expressionは条件値である。式
命令文が、あるlabeled_statementの
条件値に相当する場合、属する命令文ブロックはBRE
AK(処理の中断)文命令まで行われる。そのため、選
択PAD図式ノードにおける各子ノード説明欄の内容は
SWITCH命令文の式命令文及びlabeled_s
tatementの条件値を含む。変換過程において、
命令文ブロック、運算式、条件値毎に、それぞれ図2の
(S14)のステップで原始コード還元手続によって還
元して、等号で連接して当該命令文ブロックを行う条件
式を示すのである。そして、図4の(S15)のステッ
プで当該条件式は当該ノードにおける相対順番位置の子
ノード説明欄に置かれる。図17に示すように、当該子
ノードポインタ欄は当該命令文ブロックの開始labe
led_statementにおけるstatemen
tノードからの再帰変換によって生成された子ノードを
指向の上記憶する。
FIG. 17 shows a method of converting a SWITCH statement into a multi-branch selection PAD diagram in steps (S14) and (S15). Depending on the C language, one SWITCH command statement includes one set command statement and one compound command statement. The statement string in the compound statement is labeled_statement, which divides many statement blocks. Each labeled_
con after "case" in the statement
stan_expression is a condition value. When the expression statement corresponds to the condition value of a certain labeled_statement, the statement block to which it belongs is BRE.
Up to the AK (processing interruption) statement command is performed. Therefore, the content of each child node description field in the selected PAD diagram node is the formula command statement of the SWITCH command statement and labeled_s.
Includes the condition value of the term. In the conversion process,
For each statement block, calculation expression, and condition value, the conditional expression for reducing the statement block by the source code reduction procedure in step (S14) of FIG. Then, in the step (S15) of FIG. 4, the conditional expression is placed in the child node description field of the relative order position in the relevant node. As shown in FIG. 17, the child node pointer column indicates the start label of the statement block.
statemen in red_statement
The child node generated by the recursive conversion from the t node is oriented and stored.

【0040】図4において、検出された文ノードは(S
11)のステップでコメントであることが判断されたな
ら、(S12)のステップでは、当該命令文ノードのコ
メント部分を定義PAD図式に変換する。図18及び図
19(図19は本来図18の(c)とすべきであるが、
電子出願の都合で別の図に分割したものである。)に図
4のステップ(S12)で解析木に記憶された三種類の
コメントをどのように定義図式に変換するのかを示す。
図18の(a)は式命令文のコメントの変換方式であ
る。式命令文ノードにおける命令文のコメント欄に当該
式命令文を解釈するコメントが記憶されたならば必ずそ
れに対応する命令文定義PAD図式を生成する。そし
て、式命令文ノードにおける命令文のコメントは命令文
定義PAD図式の子ノード説明欄に置かれる。このよう
にして原式命令文のPAD図式ノードが生成される。な
お、図4の(S13)から(S15)までのステップは
一般命令文とPAD図式との対応変換である。命令文定
義ノードの子ノードポインタによって式命令文PAD図
式ノードを指向する。同図18の(b)は、複合命令文
ノードに対して、複合命令文ノードにおける命令文のコ
メント欄に当該複合命令文を解釈するコメントが記憶さ
れたなら、対応する命令文定義PAD図式を生成する様
子を示すものである。複合命令文ノードにおける命令文
のコメントは命令文定義PAD図式の子ノード説明欄に
置かれる。原複合命令文における命令文リストはPAD
図式ノードリストを生成される。命令文定義解析図式ノ
ードの子ノードポインタによって当該PAD図式ノード
リストの開始ノードを指向する。同図19に命令文群の
コメントの変換方式を示す。前述したように、命令文リ
ストの解析木において、同じ命令文群に属する命令文ノ
ードの命令文群コメントポインタは当該命令文群を解釈
するコメント命令文ノードを指向する。それはその連接
の関係を示すためである。そのため、変換過程におい
て、当該命令文のコメント欄に記憶された命令文群のコ
メントは新生成された命令文定義PAD図式におけるノ
ードの子ノード説明欄に置かれる。当該命令文群に含ま
れている命令文リストは他のPAD図式ノードリストを
生成される。命令文定義PAD図式ノードの子ノードポ
インタによって当該PAD図式ノードリストの開始ノー
ドを指向する。
In FIG. 4, the detected sentence node is (S
If it is determined in step 11) that it is a comment, in step (S12), the comment part of the statement node is converted into a defined PAD diagram. 18 and 19 (FIG. 19 should originally be (c) of FIG. 18,
It is divided into different figures for the convenience of electronic filing. 4) shows how to convert the three types of comments stored in the parse tree in step (S12) of FIG. 4 into a definition diagram.
FIG. 18A shows a comment conversion method of an expression command statement. When a comment for interpreting the expression statement is stored in the comment field of the statement in the expression statement node, the corresponding statement definition PAD diagram is generated. Then, the comment of the imperative sentence in the expression imperative sentence node is placed in the child node explanation column of the imperative sentence definition PAD diagram. In this way, the PAD diagram node of the original statement is generated. The steps from (S13) to (S15) in FIG. 4 are the corresponding conversion between the general statement and the PAD diagram. The child node pointer of the statement definition node points the expression statement PAD diagram node. FIG. 18B shows, for a compound statement node, if a comment for interpreting the compound statement is stored in the comment column of the statement in the compound statement node, the corresponding statement definition PAD diagram is displayed. It shows how to generate. The comment of the statement in the compound statement node is placed in the child node description column of the statement definition PAD diagram. The statement list in the original compound statement is PAD
A schematic node list is generated. The child node pointer of the statement definition analysis schematic node points the start node of the PAD schematic node list. FIG. 19 shows a method of converting a comment of a statement group. As described above, in the parse tree of the imperative statement list, the imperative statement group comment pointers of imperative statement nodes belonging to the same imperative statement group point to the comment imperative statement node that interprets the imperative statement group. It is to show the connection relationship. Therefore, in the conversion process, the comment of the command statement group stored in the comment field of the command statement is placed in the child node description field of the node in the newly created command statement definition PAD diagram. The command statement list included in the command statement group is used to generate another PAD schematic node list. The child node pointer of the statement definition PAD diagram node points to the start node of the PAD diagram node list.

【0041】以上でプログラム解析木とPAD図構造木
との対応関係の説明をおえる。プログラム解析木におけ
る各命令文ノードは上記対照方式によって変換された
後、図1のPAD図構造木記憶部90はPAD図と対等
するPAD図構造木を持っている。それから、図4の
(S16)のステップで、PAD図構造木によってPA
D図を描く。
The above is a description of the correspondence relationship between the program analysis tree and the PAD diagram structure tree. After each statement node in the program parse tree is converted by the above contrast method, the PAD diagram structure tree storage unit 90 of FIG. 1 has a PAD diagram structure tree corresponding to the PAD diagram. Then, in step (S16) of FIG.
Draw a diagram.

【0042】図20はこのPAD図を描画する細部流れ
を示すものである。以下本図のフローを説明する。(S
20)キーボードよりユーザの指定するPAD図の抽象
化深さを入力する。ここに、抽象化深さというのは描画
しようとするPAD図のレーヤ(layer)あるいは
「詳しさ」に近い概念であり、具体的には後に示す。
FIG. 20 shows the detailed flow of drawing this PAD diagram. The flow of this figure will be described below. (S
20) Input the abstraction depth of the PAD diagram specified by the user from the keyboard. Here, the abstraction depth is a concept close to a layer or “detail” of the PAD diagram to be drawn, and will be specifically described later.

【0043】(S21)PAD図の開始図式(BEGI
N)を描画する。(S22)PAD図構造木の開始ノー
ド及びレーヤ=1をパラメータとして図21に示すの再
帰描画手続にてPAD図を描画する。(S23)PAD
図の後に完了図(END)を加えて描画を終了させる。
次に図21に示すのは再帰描画の動作流れを説明する。
(S21) Start diagram of PAD diagram (BEGI
N) is drawn. (S22) A PAD diagram is drawn by the recursive drawing procedure shown in FIG. 21 using the start node of the PAD diagram structure tree and layer = 1 as parameters. (S23) PAD
The drawing is ended by adding a completion drawing (END) after the drawing.
Next, the operation flow of recursive drawing will be described with reference to FIG.

【0044】(S24)再帰描画手続がなされている場
合、PAD図式ノードのパラメータのデータ構造によっ
てPAD図式を描画する。(S25)当該PAD図式ノ
ードは命令文定義PAD図式であることが判断される。
(S26)レーヤの指定する抽象化深さより大きい或い
は相当するのを判断されたら、当該命令文定義PAD図
式の以下の子PAD図は描画されない。これにより、生
成されたPAD図の命令文が細部を重視して作成される
のを避け、簡単なPAD図でプログラム全体の流れ及び
その構造を表わすことができる。
(S24) When the recursive drawing procedure is performed, the PAD diagram is drawn according to the data structure of the parameter of the PAD diagram node. (S25) It is determined that the PAD diagram node is the imperative sentence definition PAD diagram.
(S26) If it is determined that the abstraction depth is larger than or equal to the abstraction depth specified by the layer, the following child PAD diagrams of the statement definition PAD diagram are not drawn. As a result, it is possible to prevent the generated statement of the PAD diagram from being created with emphasis on the details, and to show the flow of the entire program and its structure with a simple PAD diagram.

【0045】以上の条件に合わない場合、現在のPAD
図式ノードの子ノード毎に更にその横に描画を追加す
る。(S27)、(S28)では各子ノードポインタに
よって指向された子ノード及びlayer+1をパラメ
ータとして再帰方式で再帰描画手続をなして描画する。
If the above conditions are not met, the current PAD
Drawing is added beside each child node of the schematic node. In (S27) and (S28), the child node pointed by each child node pointer and layer + 1 are used as parameters to perform the drawing by performing the recursive drawing procedure in the recursive method.

【0046】(S29)PAD図式ノードの子ノードが
描画された後、当該ノードの次のノードポインタによっ
て指向されたPAD図式ノード及びlayerをパラメ
ータとして再帰方式で再帰描画手段を呼び出して縦に子
ノードを描画する。前記の方式によって完備的なPAD
図を描画できる。図4に示す(S16)のステップで、
PAD図が描画された後、(S17)のステップで、出
力される。原始プログラムからPAD図への変換はこれ
で終了する。
(S29) After the child node of the PAD graphic node is drawn, the recursive drawing means is called in a recursive manner by using the PAD graphic node and the layer pointed to by the node pointer next to the node as a parameter to vertically draw the child node. To draw. Complete PAD by the above method
Can draw diagrams. In the step (S16) shown in FIG. 4,
After the PAD diagram is drawn, it is output in the step (S17). This completes the conversion from the source program to the PAD diagram.

【0047】図20におけるPAD図を描画する細部流
れにおいて、抽象化深さはPAD図の詳しさに直接影響
を与える。抽象化深さが大きいと完備な命令文の細部を
反映したPAD図を生成できる。一方抽象化深さが小さ
いと生成されたPAD図はプログラム全体の構造をプロ
グラマが速くて理解できる。このため、プログラマはプ
ログラム抽象化の目的に応じて所望の抽象化深さを設定
する。
In the detailed flow of drawing the PAD diagram in FIG. 20, the abstraction depth directly affects the detail of the PAD diagram. When the abstraction depth is large, it is possible to generate a PAD diagram that reflects the details of a complete statement. On the other hand, when the abstraction depth is small, the generated PAD diagram allows the programmer to quickly understand the structure of the entire program. Therefore, the programmer sets a desired abstraction depth according to the purpose of the program abstraction.

【0048】次に本装置の動作を例をあげて説明する。
図22は、中に典型的なC言語の命令文及び前に述べた
三種類のコメントが含まれているC言語で記述された原
始プログラムである。原始プログラム10は入力部30
によって入力されてから一連の命令文になって、プログ
ラム解析部60でプログラム言語文法記憶部20の記憶
している文法を参照しつつ文法解析を行う。そして、そ
れに対応して生成されたプログラム解析木(図23及び
図24に示す)をプログラム解析木記憶部70が記憶す
る。(なお、図23と図24は本来は1枚の図である
が、電子出願の都合で分割したものである。)原始プロ
グラムにおけるコメントはコメント分類部50で分類さ
れて、当該プログラム解析木の相応位置に配置されて記
憶される。プログラム解析木渡歩部81では再帰方式に
よって記憶されているプログラム解析木を渡り歩く。コ
メントを持っている解析木の命令文ノードにおけるコメ
ント部分は定義図式変換部83で、命令文定義PAD図
式に変換される。コメントを持っていない一般命令文の
ノードを一般図式変換部84で、図4の(S13)から
(S15)までに示すステップにて変換する。その結
果、図23、図24における解析木は図25に示すPA
D図構造木に変換された上でPAD図構造木記憶部90
に記憶される。最後に、抽象化PAD図描画部85でP
AD図構造木を図20、図21に示す手順によって図2
6に示すPAD図110を描画する。なお、この際、前
述のごとく図20の(S20)のステップで、ユーザは
所望のPAD図の抽象化深さを入力できる。
Next, the operation of this apparatus will be described by way of example.
FIG. 22 shows a source program written in the C language, which includes a typical C language command statement and the above-mentioned three types of comments. Source program 10 has input section 30
After being input by, the program analysis unit 60 performs a grammar analysis while referring to the grammar stored in the program language grammar storage unit 20 in the program analysis unit 60. Then, the program analysis tree storage unit 70 stores the program analysis tree (shown in FIGS. 23 and 24) generated correspondingly. (Note that although FIG. 23 and FIG. 24 are originally one figure, they are divided for convenience of electronic filing.) The comments in the source program are classified by the comment classifying unit 50, and the program analysis tree is divided. It is arranged and stored in a corresponding position. The program analysis tree walking unit 81 walks through the program analysis tree stored by the recursive method. The comment portion in the imperative sentence node of the parse tree having the comment is converted into the imperative sentence definition PAD diagram by the definition diagram conversion unit 83. The node of the general command statement having no comment is converted by the general diagram conversion unit 84 in the steps shown from (S13) to (S15) in FIG. As a result, the parse trees in FIGS. 23 and 24 are the PAs shown in FIG.
After being converted into a D diagram structure tree, the PAD diagram structure tree storage unit 90
Memorized in. Finally, in the abstracted PAD diagram drawing unit 85, P
The AD diagram structure tree is shown in FIG. 2 by the procedure shown in FIGS.
6 is used to draw the PAD diagram 110 shown in FIG. At this time, as described above, the user can input the desired abstraction depth of the PAD diagram in the step (S20) of FIG.

【0049】図26に示すのはプログラムの抽象化深さ
を設定していない場合であり、原始プログラムの完備な
PAD図である。図27は抽象化深さ=4によって描画
されたPAD図である。本図は簡潔であるけれども原始
プログラムの本質を持っている。図28に、抽象化深さ
=1の最簡潔なPAD図を示す。プログラマはこのPA
D図によって容易に当該プログラムの関数が二つのタス
クを含むことがわかる。それは、“Parsing a
set of source programfil
es”と“return the number of
program files that canno
t be parsed successfully”
である。
FIG. 26 shows the case where the abstraction depth of the program is not set, and is a complete PAD diagram of the source program. FIG. 27 is a PAD diagram drawn with abstraction depth = 4. This figure is concise but has the essence of a source program. FIG. 28 shows the simplest PAD diagram with abstraction depth = 1. Programmer is this PA
It is easy to see from the diagram D that the function of the program contains two tasks. It is "Parsing a
set of source programfil
es "and" return the number of
program files that that canno
t be succeeded fully ”
Is.

【0050】以上、本発明を実施例に基づき説明した
が、本発明は何も上記実施例に限定されないのは勿論で
ある。すなわち、例えば言語はC言語に限定されず、フ
ォートラン、アルゴル等他のもの、図はPAD図でなく
フローチャートでもよい。またハード面においても、例
えば出力部は印字手段でなくCRT等であってもよいの
は勿論である。
Although the present invention has been described above based on the embodiments, it goes without saying that the present invention is not limited to the above embodiments. That is, for example, the language is not limited to the C language, and other language such as Fortran, Algol, etc., and the diagram may be a flow chart instead of the PAD diagram. Also in terms of hardware, it goes without saying that the output section may be a CRT or the like instead of the printing means.

【0051】[0051]

【発明の効果】以上説明したように本発明に係るプログ
ラム解析装置によれば、原始プログラムから自動的にそ
れに対応する図的プログラム表現図が生成される。その
際、プログラムにおけるコメントは分類されてから、命
令文定義図的プログラム表現形式で図的に表現される。
このため、図的プログラム表現図は多くのコメントを含
めて作成され、プログラムの説明性が高くなる。そのう
え、プログラム抽象化の深さの設定という機能をも有す
るため、異なるプログラム抽象化にてプログラムを解析
することが可能である。
As described above, according to the program analysis apparatus of the present invention, a graphic program representation diagram corresponding to the source program is automatically generated. At this time, the comments in the program are classified and then graphically expressed in the imperative sentence definition graphical program expression format.
For this reason, the graphical program representation diagram is created with many comments, and the descriptiveness of the program is enhanced. In addition, since it also has a function of setting the depth of the program abstraction, it is possible to analyze the program with different program abstractions.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】プログラム中の命令文とPAD図式の対応図で
ある。
FIG. 2 is a correspondence diagram between a statement in a program and a PAD diagram.

【図3】コメント命令文の分類規則を示す。FIG. 3 shows a classification rule of comment command statements.

【図4】上記実施例の動作流れ図である。FIG. 4 is an operation flow chart of the above embodiment.

【図5】C言語で記述された命令文セグメント(式命令
文のコメントと複合命令文のコメントを含む)及びそれ
に対応するプログラム解析木を示す例である。
FIG. 5 is an example showing an imperative sentence segment (including a comment of an expression imperative sentence and a comment of a compound imperative sentence) described in C language and a program parse tree corresponding to it.

【図6】C言語で記述された命令文セグメント(命令文
群のコメントを含む)及びそれに対応するプログラム解
析木を示す例である。
FIG. 6 is an example showing a command statement segment (including a comment of a command statement group) written in C language and a program analysis tree corresponding to the command statement segment.

【図7】C言語の命令文と各PAD図式との対応関係及
び各PAD図式に該当する各ノードのデータ構造図であ
る。(その1)
FIG. 7 is a diagram showing a correspondence relationship between a C language command statement and each PAD diagram, and a data structure diagram of each node corresponding to each PAD diagram. (Part 1)

【図8】同上。(その2)FIG. 8 Same as above. (Part 2)

【図9】同上。(その3)FIG. 9 Same as above. (Part 3)

【図10】同上。(その4)FIG. 10 Same as above. (Part 4)

【図11】式命令文とジャンプ命令文を基本PAD図式
に対応する変換方式である。
FIG. 11 is a conversion method for converting an expression imperative sentence and a jump imperative sentence into a basic PAD diagram.

【図12】WHILEループ命令文をループPAD図式
に対応する変換方式である。
FIG. 12 is a conversion method corresponding to a WHILE loop statement with a loop PAD diagram.

【図13】DO−WHILEループ命令文をループPA
D図式に対応する変換方式である。
FIG. 13 shows a DO-WHILE loop statement in a loop PA
This is a conversion method corresponding to the D diagram.

【図14】FORループ命令文をループPAD図式に対
応する変換方式である。
FIG. 14 is a conversion method that corresponds to a FOR loop statement to a loop PAD diagram.

【図15】簡単IF選択命令文を二分岐選択PAD図式
に対応する変換方式である。
FIG. 15 is a conversion method corresponding to a simple IF selection command statement to a two-branch selection PAD diagram.

【図16】入れ子IF選択命令文を多分岐選択PAD図
式に対応する変換方式である。
FIG. 16 is a conversion system for converting a nested IF selection statement into a multi-branch selection PAD diagram.

【図17】SWITCH選択命令文を多分岐選択PAD
図式に対応する変換方式である。
FIG. 17 is a multi-branch selection PAD for a SWITCH selection statement.
This is a conversion method corresponding to the scheme.

【図18】命令文の三種類のコメントを命令文定義PA
D図式に対応する変換方式である。(その(a)及び
(b))
FIG. 18 is a statement definition PA for three types of comments of statement.
This is a conversion method corresponding to the D diagram. (Parts (a) and (b))

【図19】同上。(その(c))FIG. 19 Same as above. (Part (c))

【図20】図4における(S16)のステップでのPA
D図を描画する細部流れである。
FIG. 20 shows PA in step (S16) in FIG.
It is a detailed flow of drawing the D diagram.

【図21】再帰描画手段を示す流れ図である。FIG. 21 is a flowchart showing a recursive drawing means.

【図22】本発明における一処理例としてのC言語で記
述された原始プログラムである。
FIG. 22 is a source program written in C language as one processing example in the present invention.

【図23】本発明における一処理例としてのプログラム
解析木の図である。(その上部)
FIG. 23 is a diagram of a program analysis tree as one processing example in the present invention. (The upper part)

【図24】同上。(その下部)FIG. 24 Same as above. (At the bottom)

【図25】図23に対応するPAD図構造木の図であ
る。
FIG. 25 is a diagram of a PAD diagram structure tree corresponding to FIG. 23;

【図26】本発明における一処理例としての自動的に生
成する完備なPAD図である。
FIG. 26 is a complete PAD diagram that is automatically generated as an example of processing according to the present invention.

【図27】本発明における一処理例としてのプログラム
抽象化深さ4によって自動的に生成されるPAD図であ
る。
FIG. 27 is a PAD diagram automatically generated by the program abstraction depth 4 as one processing example in the present invention.

【図28】本発明における一処理例としてのプログラム
抽象化深さ1によって自動的に生成されるPAD図であ
る。
FIG. 28 is a PAD diagram automatically generated by the program abstraction depth 1 as one processing example in the present invention.

【図29】従来例の“C−PADツール”によるPAD
図である。
FIG. 29 is a PAD using a conventional “C-PAD tool”.
It is a figure.

【符号の説明】[Explanation of symbols]

10 原始プログラム 20 プログラム言語文法記憶部 30 入力部 40 コメント抽出部 50 コメント分類部 60 プログラム解析部 70 プログラム解析木記憶部 80 PAD図生成部 81 プログラム解析木渡歩部 82 コメント命令文ノード検出部 83 定義図式変換部 84 一般図式変換部 85 抽象化PAD図描画部 90 PAD図構造木記憶部 100 出力部 110 PAD図 10 source program 20 program language grammar storage unit 30 input unit 40 comment extraction unit 50 comment classification unit 60 program analysis unit 70 program analysis tree storage unit 80 PAD diagram generation unit 81 program analysis tree walking unit 82 comment statement node detection unit 83 Definition diagram conversion unit 84 General diagram conversion unit 85 Abstract PAD diagram drawing unit 90 PAD diagram structure tree storage unit 100 output unit 110 PAD diagram

───────────────────────────────────────────────────── フロントページの続き (72)発明者 陳 恵▲いん▼ 台湾タイ・ペイ・シ・ター・アン・チー・ 10628・レン・アイ・ル・サン・トォア ン・136・ハオ・10・ロウ スン・シャ・ ティエン・チ・チ・シュー・カイ・ファ ー・クゥー・フェン・ユウ・シエン・コ ン・スー内 (72)発明者 呉 玲華 台湾タイ・ペイ・シ・ター・アン・チー・ 10628・レン・アイ・ル・サン・トォア ン・136・ハオ・10・ロウ スン・シャ・ ティエン・チ・チ・シュー・カイ・ファ ー・クゥー・フェン・ユウ・シエン・コ ン・スー内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Chen Megumi ▲ In ▼ Taiwan Taipai Shi Tha An Chi 10628 Ren Ren Ile San Toan 136 Hao 10 Law Sun Sha Tien Chi Chi Shu Kai Kai Khu Feng Yu Xi Sieng Kong Su (72) Inventor Reika Wu Taiwan Taipei Pay Ter An Chi 10628 · Len I Le San Touan · 136 · Hao · 10 · Luang Sun Sha Tien Chi Chi Shu Kai Fah Ku Khu Feng Yu Si Sien Con Su

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 入力された原始プログラムからコメント
記号によってコメント部分を抽出するコメント抽出部
と、 コメントと命令文との付属関係によってプログラム解析
木における適当な位置を定めるべく前記コメント抽出部
で抽出されたコメントの原始プログラムにおける位置に
より、式命令文のコメントであるか複合命令文のコメン
トであるか命令文群のコメントであるかを判断の上分類
するコメント分類部と、 プログラム言語の文法を記憶するプログラム言語文法記
憶部と、 入力された原始プログラムに対して前記プログラム言語
文法記憶部の記憶する文法によって文法解析を行い、ボ
トムアップ方式で各命令文で表わす関数のプログラム解
析木を求めるプログラム解析部と、 前記プログラム解析部で得られたプログラム解析木と前
記コメント分類部で得られた分類結果を記憶するため
に、各ノードのデータ構造に対して当該ノードの性質を
表わす文法コードを記憶する文法コード記憶欄と、終端
ノードとソースコードを記憶する終端ノードソースコー
ド記憶欄と、式命令文のコメントと複合命令文のノード
に属する複合命令文のコメントを記憶する命令文コメン
ト記憶欄と、命令文群に対し対応するコメントを指向の
上記憶する命令文群のコメントポインタ欄と、各子ノー
ドを連接する各子ノードポインタを記憶する各子ノード
ポインタ欄とを有するプログラム解析木記憶部と、 プログラム解析木記憶部に記憶されたプログラム解析木
における命令文ノード毎に、当該命令文ノードに対応す
る図的プログラム表現形式に変換し、原始プログラムに
おけるコメントを命令文定義図的プログラム表現形式に
変換して一関数の図的プログラム表現図を生成する図生
成部とを備えたことを特徴とするプログラム解析装置。
1. A comment extraction unit for extracting a comment portion from a inputted source program by a comment symbol, and a comment extraction unit for determining an appropriate position in a program analysis tree according to an adjunct relation between a comment and a statement. Depending on the position of the comment in the source program, the comment classification unit that classifies the comment by determining whether it is a comment of an expression command statement, a comment of a compound command statement, or a comment of a command statement group, and the grammar of the programming language is stored A program language grammar storage unit, and a program analysis for performing a grammatical analysis on the input source program by the grammar stored in the program language grammar storage unit to obtain a program parse tree of a function expressed by each statement in a bottom-up method. Part, and the program analysis tree and the previous obtained by the program analysis part In order to store the classification result obtained by the comment classification unit, a grammar code storage field that stores a grammar code that represents the property of the node with respect to the data structure of each node, and a termination node that stores a termination node and a source code A source code storage field, an instruction statement comment storage field for storing a comment of a formula instruction statement and a comment of a compound instruction statement belonging to a node of a compound instruction statement, and an instruction statement for directionally storing a comment corresponding to an instruction statement group. A program parse tree storage unit having a group comment pointer column and each child node pointer column that stores each child node pointer connecting each child node, and a statement in the program parse tree stored in the program parse tree storage unit For each node, convert it to the graphical program representation format corresponding to the statement node, and add the comment in the source program to the statement Program analysis apparatus characterized by comprising a drawing generation unit for generating a graphical representation of the program diagram of the conversion to one function Gizu programs representation.
【請求項2】 原始プログラムを解析されて得るプログ
ラム解析木を記憶するために、各ノードのデータ構造は
当該ノードの性質を表わす文法コードを記憶する文法コ
ード記憶欄、終端ノードとソースコードを記憶する終端
ノードソースコード記憶欄と、式命令文のコメントと複
合命令文のノードに属する複合命令文のコメントを記憶
する命令文のコメント記憶欄と、命令文群に対し対応す
るコメントを指向の上記憶する命令文群のコメントポイ
ンタ欄と、各子ノードを連接する各子ノードポインタを
記憶する各子ノードポインタ欄とを有するプログラム解
析木記憶部と、 再帰方式でプログラム解析木記憶部における各ノードを
渡り歩いて命令文ノードを検出するプログラム解析木渡
歩部と、 前記プログラム解析木渡歩部で検出された命令文ノード
がコメントを持っているか否かを判断し、コメントを持
っている命令文ノードを定義図式変換部へ渡し、コメン
トを持っていない命令文ノードを一般図式変換部へ渡す
コメント命令文ノード検出部と、 図的プログラム表現形式を記憶するために、各ノードで
当該ノードのデータ構造は図式のタイプを記憶する図的
プログラム表現形式欄と、動作しようとする命令文を記
憶する図的プログラム表現形式説明欄と、子ノードの数
を記憶する子ノードの数記憶欄と、分岐毎に各子ノード
の分岐条件を処理の上記憶する各子ノード説明欄と、各
子ノードポインタの分岐の開始を記憶する各子ノードポ
インタ欄と、実行順序が次のノードを指向して連接の上
記憶する次のノードポインタ欄とを有する図的プログラ
ム表現図構造木記憶部と、 前記コメント命令文ノード検出部で検出されたコメント
を持っている命令文ノードのコメント部分を定義図的プ
ログラム表現形式ノードに変換して前記図的プログラム
表現図構造木記憶部に記憶し、原命令文ノードを一般図
式変換部に渡す定義図式変換部と、 前記コメント命令文ノード検出部で検出されたコメント
を持っていない命令文ノード或いは前記定義図式変換部
から渡された命令文ノードを木構造対応関係によって一
般図的プログラム表現形式ノードに変換して図的プログ
ラム表現図構造木記憶部に記憶する一般図式変換部と、 前記図的プログラム表現図構造木記憶部から読み込まれ
た図的プログラム表現図構造木が使用者の設定するプロ
グラム抽象化深さによってコメント命令文を隠すか否か
を決定し、違う抽象化程度の図的プログラム表現図を生
成する抽象化図描画部とを備えたことを特徴とするプロ
グラム解析装置。
2. In order to store a program analysis tree obtained by analyzing a source program, a data structure of each node stores a grammar code storage field for storing a grammar code representing the property of the node, an end node and a source code. The end node source code storage field, the comment storage field for the command statement that stores the comment of the expression command statement and the comment of the compound command statement that belongs to the node of the compound command statement, and the corresponding comment for the command statement group A program parse tree storage unit having a comment pointer column of a statement group to be stored and each child node pointer column storing each child node pointer connecting each child node, and each node in the program parse tree storage unit in a recursive method A program analysis tree crossing section for detecting a statement node by walking across the statement, and a statement detected by the program analysis tree crossing section Determining whether or not a comment has a comment, passing the statement node that has a comment to the definition diagram conversion unit, and passing the statement node that does not have a comment to the general diagram conversion unit Part, and in order to store the graphical program expression format, the data structure of the node in each node is a graphical program expression format section that stores the type of the graphic, and a graphical program expression that stores the statement to operate. Format description field, child node number storage field that stores the number of child nodes, each child node description field that stores the branching condition of each child node for each branch after processing, and branching of each child node pointer , A diagrammatic program representation diagram structure tree storage unit having each child node pointer column for storing the following, and a next node pointer column for connecting and storing the next node in the execution order pointing to the next node; Comment command statement node detecting unit converts a comment portion of a command statement node having a comment into a definition diagrammatic program representation format node and stores it in the diagrammatic program representation diagram structure tree storage unit A definition diagram conversion unit that passes a node to the general diagram conversion unit, and a statement sentence node that does not have a comment detected by the comment statement sentence node detection unit or a statement sentence node that is passed from the definition diagram conversion unit is tree-structured. A general-scheme conversion unit for converting into a general-scheme program representation form node according to a relationship and storing it in the schematic-program representation diagram structure tree storage unit; and a schematic program representation diagram read from the schematic program representation diagram structure tree storage unit. Depending on the program abstraction depth set by the user, the structure tree determines whether or not to hide the comment statement, and a graphical program with a different degree of abstraction is drawn. Program analysis apparatus characterized by comprising an abstraction diagram drawing section for generating a representation view.
【請求項3】 図的プログラム表現図はPAD図である
ことを特徴とする請求項1記載のプログラム解析装置。
3. The program analysis device according to claim 1, wherein the graphical program representation diagram is a PAD diagram.
【請求項4】 図的プログラム表現図はPAD図である
ことを特徴とする請求項2記載のプログラム解析装置。
4. The program analysis device according to claim 2, wherein the graphical program representation diagram is a PAD diagram.
JP4152328A 1992-06-11 1992-06-11 Program analysis device Pending JPH05341973A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4152328A JPH05341973A (en) 1992-06-11 1992-06-11 Program analysis device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4152328A JPH05341973A (en) 1992-06-11 1992-06-11 Program analysis device

Publications (1)

Publication Number Publication Date
JPH05341973A true JPH05341973A (en) 1993-12-24

Family

ID=15538132

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4152328A Pending JPH05341973A (en) 1992-06-11 1992-06-11 Program analysis device

Country Status (1)

Country Link
JP (1) JPH05341973A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0991125A (en) * 1995-09-27 1997-04-04 Nec Corp Structured symbol input system
WO2024252522A1 (en) * 2023-06-06 2024-12-12 日本電信電話株式会社 Programming assistance device, programming assistance method, and program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0991125A (en) * 1995-09-27 1997-04-04 Nec Corp Structured symbol input system
WO2024252522A1 (en) * 2023-06-06 2024-12-12 日本電信電話株式会社 Programming assistance device, programming assistance method, and program

Similar Documents

Publication Publication Date Title
JP4448881B2 (en) Method and system for generating a computer program
KR101098718B1 (en) System and method for creating, managing and using code segments
US5946488A (en) Method for selectively and incrementally displaying the results of preprocessing
US4860203A (en) Apparatus and method for extracting documentation text from a source code program
US5752058A (en) System and method for inter-token whitespace representation and textual editing behavior in a program editor
US8429525B2 (en) Method and system for reversible design tree transformations
EP0752649A2 (en) System and method for textual editing of structurally-represented computer programs with on-the-fly typographical display
US7237226B2 (en) Method and system for storing pending changes to data
Zhu et al. BiYacc: Roll Your Parser and Reflective Printer into One.
Wuu How to merge program texts
JPH05341973A (en) Program analysis device
JP2000207246A (en) Debugging support apparatus and method, and recording medium recording debug support software
JPH0660067A (en) Document processor
JPH07160490A (en) Coding assistance device
KR20030018720A (en) Method for generating source code browser for software maintenance and system therefor
JP3003459B2 (en) Program creation support device
JPH0981411A (en) compiler
JPH07121379A (en) Multilingual compiler
JPH10269066A (en) Automatic shell creation device in Japanese
JPH04237365A (en) Difference detecting system and automatic editing system for text processor
JPH04248624A (en) Program conversion processor
Cohen Workshop on Fortran Transformations
Jo A design of a structure-oriented editor
Li A syntax directed text editor for a configuration control system
JPH02115968A (en) Input guidance method in editor