JPH0423038A - Automatic generating device for program document - Google Patents

Automatic generating device for program document

Info

Publication number
JPH0423038A
JPH0423038A JP12804990A JP12804990A JPH0423038A JP H0423038 A JPH0423038 A JP H0423038A JP 12804990 A JP12804990 A JP 12804990A JP 12804990 A JP12804990 A JP 12804990A JP H0423038 A JPH0423038 A JP H0423038A
Authority
JP
Japan
Prior art keywords
variable
instruction
file
instructions
contents
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
JP12804990A
Other languages
Japanese (ja)
Inventor
Harumi Mizuse
水瀬 晴美
Kazuhide Kawada
河田 和秀
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP12804990A priority Critical patent/JPH0423038A/en
Publication of JPH0423038A publication Critical patent/JPH0423038A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE:To attain the output of even the use of a variable by applying an analysis in order to identify and sort the instructions using the symbols of the variable names, etc. CONSTITUTION:If a single line read out of a source file 1 is identical with an instruction, it is judged whether the instruction operates a variable or not. If so, an operand part is extracted out of the instruction and the attribute of the operand 'write' or 'read' is added to the variable name according to the group to which the instruction belongs. Then the variable name including the attribute is written into a symbol file 5. When all lines are processed, the contents of the file 5 are outputted after arrangement of the formats.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、コンピュータのプログラムに関するドキュメ
ントの自動生成装置に関し、特にプログラム中で使用し
ている変数の用途を調べてその内容を出力するト′キュ
メントの自動生成装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an automatic generation device for documents related to computer programs, and in particular to a tool for checking the usage of variables used in a program and outputting the contents. The present invention relates to an automatic document generation device.

〔従来の技術〕[Conventional technology]

従来、この種のドキュメント自動生成装置としては、使
用している変数の一覧表を出力する「ンンボルー覧表」
出力装置や、変数名等のシンボルがプログラム中のとこ
で定義され、また、使用されているかを示すしクロス・
リファレンスJ出力装置などが有る。
Conventionally, as this type of automatic document generation device, there was a "Nunboru list" that outputs a list of variables used.
Indicates whether symbols such as output devices and variable names are defined and used in the program.
There is a reference J output device, etc.

シンボル−覧表は、例えばアセンブラ言語で記述された
プログラムの場合は、使用されてし・るシンボルとそれ
に割り当てられているメモリのアドレスの対応が示さh
る。また、クロス・リファレンスは、あるシンボルが定
義されているファイル名およびそのファイル中の行番号
が対応付けられて示される。
For example, in the case of a program written in assembler language, a symbol list shows the correspondence between the symbols used and the memory addresses assigned to them.
Ru. Further, a cross reference is shown in association with the file name in which a certain symbol is defined and the line number in that file.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

プログラムのドキュメントは、フログラムの保守時に必
要性が高い。ドキュメントと駿で明記しなければならな
い項目の1つとして、そこで使用されている変数の用途
のリストがある。
Program documentation is highly needed when maintaining a program. One of the items that must be clearly stated in the documentation is a list of the uses of the variables used there.

上述した従来の[シンボル−覧表j出力装置は、単に使
用している変数名等のシンボルの一覧表の出力であり、
たとえば変数の場合ならば、それが書き換えられるのか
、それとも参照されるだけなのかをそこから知ることは
不可能であった。また、クロス・リファレンス出力装置
は、例えば変数については、それが定義された行番号と
、使用された行番号を出力することが可能であるが、や
はり、その変数の用途まではそこからは読み取ることは
できない。
The conventional [symbol list j output device described above simply outputs a list of symbols such as variable names used,
For example, in the case of variables, it was impossible to know from them whether they were being rewritten or only referenced. Also, for example, the cross-reference output device can output the line number where the variable was defined and the line number where it was used, but the purpose of the variable cannot be read from there. It is not possible.

〔課題を解決するための手段〕[Means to solve the problem]

本発明は、ソース・プログラムを格納する第1の記憶手
段と、第1の記憶手段からソース・プログラムを読み出
す読み出し手段と、前記読み出し手段により読み出した
命令を職別する識別手段と、前記識別手段により識別し
た命令を分類する第1の分類手段と、第1の分類手段で
分類された命令のオペランドを分類する第2の分類手段
と、第2の分類手段により分類された命令のオペランド
を格納する第2の記憶手段と、第2の記憶手段の内容を
出力する出力手段を有する。
The present invention provides a first storage means for storing a source program, a reading means for reading the source program from the first storage means, an identification means for classifying instructions read by the reading means, and an identification means for classifying instructions read by the reading means. a first classification means for classifying the instructions identified by the first classification means; a second classification means for classifying the operands of the instructions classified by the first classification means; and storing the operands of the instructions classified by the second classification means. and an output means for outputting the contents of the second storage means.

かくして、本発明では、変数名等のシンボルが使用され
ている命令を識別し分類するという解析を行うことによ
り、例えば変数名なら、その変数が書き換えられるのか
、それとも参照されるだけなのかという用途までを出力
できる。
Thus, in the present invention, by performing an analysis to identify and classify instructions that use symbols such as variable names, for example, if it is a variable name, whether the variable is rewritten or only referenced is used. It is possible to output up to

〔実施例〕〔Example〕

以下図面を参照しながら本発明の詳細な説明を行う。 The present invention will be described in detail below with reference to the drawings.

第3図は、本実施例で使用するアセンブラ・ソース・プ
ログラムの例である。第3図に示す命令は、変数の観点
から見ると3つのグループに分類できる。第1のグルー
プは、01番地に記述されているMOV命令に見られる
ように、2つのオペランドの両方に変数をもち、第1オ
ペランドにはデータが書き込まれ、第2オペランドに指
定された変数はその内容が参照されるという物である。
FIG. 3 is an example of an assembler source program used in this embodiment. The instructions shown in FIG. 3 can be classified into three groups from the perspective of variables. The first group, as seen in the MOV instruction written at address 01, has variables for both operands, data is written to the first operand, and the variable specified for the second operand is Its contents are referred to.

第2のグループは、02番地のADD命令に見られるよ
うに、変数を1つだけもち、そこにデータが書き込まれ
るというものである。第3のグループは、03番地のJ
Z命令に見られるように、変数を]つだけもちその内容
が参照されるというものである。第4のグループは、0
4番地のJMP命令に見られるように、オペランドに変
数を1つも持たないというものである。以後の説明では
、命令は全てこれら4つのグループに分類できるものと
する。
The second group has only one variable and data is written there, as seen in the ADD instruction at address 02. The third group is J at address 03.
As seen in the Z command, it only has one variable and its contents are referenced. The fourth group is 0
As seen in the JMP instruction at address 4, the operand does not have any variables. In the following description, it is assumed that all instructions can be classified into these four groups.

第1図は本発明の一実施例の全体構成を示す構成図であ
る。ソース・ファイル1には第3図で説明したプログラ
ムが格納されているものとする。
FIG. 1 is a block diagram showing the overall structure of an embodiment of the present invention. It is assumed that the source file 1 stores the program explained in FIG.

命令識別手段2はソース・ファイル1からソース・プロ
グラムを1行毎に読み込み、その行に命令が書かれてい
るか(即ち、命令行か)、それともコメントのみの行か
(即ち、コメント行か)を識別する。
The instruction identification means 2 reads the source program line by line from the source file 1 and identifies whether an instruction is written in that line (i.e., an instruction line) or a line with only a comment (i.e., a comment line). .

命令分類手段3は、命令識別手段2が命令行であると識
別した行を入力し、命令によりそのオペランドを上記の
グループに分類する。オペランド書き込み手段4は、命
令分類手段3により分類されたオペランドをシンボル・
ファイル5に書き込む。シンボル出力手段6は、シンボ
ル・ファイル5の内容を書式を整えて出力する。
The instruction classification means 3 inputs the line identified as an instruction line by the instruction identification means 2, and classifies its operands into the above-mentioned groups according to the instruction. The operand writing means 4 converts the operands classified by the instruction classification means 3 into symbols.
Write to file 5. The symbol output means 6 formats and outputs the contents of the symbol file 5.

第2図は、本発明の一実施例の動作を示すフローチャー
トである。第2図の内箱1図に対応する箇所には同一の
番号を付しである。
FIG. 2 is a flowchart showing the operation of one embodiment of the present invention. The same numbers are assigned to the parts corresponding to those in Figure 1 of the inner box in Figure 2.

まず最初の動作として、ソース・ファイル1から1行を
読みたしく処理11)、その行が命令かどうかを判断し
、もし命令でない場合は処理11に戻り以上の動作を繰
り返す(処理12)。もし、命令ならば、その命令が変
数を操作する命令かどうかを判断し、変数操作命令行で
ない場合は処理11に戻り上記の動作を繰り返す(処理
13)。
First, the first operation is to read one line from the source file 1 (process 11), determine whether that line is an instruction, and if it is not an instruction, return to process 11 and repeat the above operations (process 12). If it is a command, it is determined whether the command is a variable manipulation command, and if it is not a variable manipulation command line, the process returns to process 11 and repeats the above operation (process 13).

処理13で命令が変数操作命令であると判断された場合
は、その命令からオペランド部を抽出しく処理14)、
命令の属するグループによりオペランド「書き込み」ま
たは「読みだし」のに属性を付ける(処理15)。属性
のついた変数名は、シンボル・ファ・イル5に書き出さ
れる(処理16)。
If it is determined in process 13 that the instruction is a variable manipulation instruction, process 14) to extract the operand part from the instruction;
An attribute is attached to the operand "write" or "read" depending on the group to which the instruction belongs (processing 15). The variable name with the attribute is written to the symbol file 5 (process 16).

もし、ソース・ファイルの全ての行を処理し終えていな
い場合は、処理11に戻り上記の動作を繰り返す(処理
17)。もし、全ての行の処理を終えているのならば、
シンボル・ファイル5の内容を書式を整えて出力する(
処理18)。
If all lines of the source file have not been processed, the process returns to process 11 and repeats the above operation (process 17). If all rows have been processed,
Format and output the contents of symbol file 5 (
Processing 18).

第4図に処理16により属性付きの変数名が書き込まれ
たシンボル・ファイルの内容を示す。第5図に、第3図
のソース・プログラムが処理されて出力された例を示す
FIG. 4 shows the contents of the symbol file in which variable names with attributes are written in process 16. FIG. 5 shows an example in which the source program shown in FIG. 3 is processed and output.

第6図は本発明のもう1つの実施例の動作を説明するフ
ローチャートである。第6図の内箱2図と同一の処理に
は同一番号を付し説明を省略する。
FIG. 6 is a flowchart illustrating the operation of another embodiment of the present invention. Processes that are the same as those in the inner box 2 of FIG. 6 are given the same numbers and their explanations will be omitted.

第6図の実施例が第2図のものと異なっているのは、シ
ンボル・ファイル5へのデータの書き込み方式である。
The embodiment shown in FIG. 6 differs from that shown in FIG. 2 in the method of writing data into the symbol file 5.

第2図の実施例では、シンボル・ファイル5へ属性付き
の変数名を書き込んだのに対して、本実施例では属性毎
にシンボル・ファイルの異なる領域にシンボルを書き込
んでいる(処理61)。本実箆例の場合のシンボル・フ
ァイルの内容を第7図に示す。
In the embodiment shown in FIG. 2, variable names with attributes are written in the symbol file 5, whereas in this embodiment, symbols are written in different areas of the symbol file for each attribute (process 61). FIG. 7 shows the contents of the symbol file in this example.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば従来プログラムの
ドキュメントのために人手で作成していた変数の用途の
リストを自動的に作成できるという利点がある。
As described above, the present invention has the advantage that it is possible to automatically create a list of variable uses, which was conventionally created manually for program documentation.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の構成を示す構成図。第2図は、本発明
の第1の実施例の動作を示すフローチャート。第3図は
、本発明の実施例の命令の種類を示すソース・フログラ
ム例。第4図は、第2図の実施例で示されるシンボル・
ファイルの内容を示す図。第5図は、本発明による変数
リスト出力例。 第6図は本発明の第2の実施例の動作を示すフロー・チ
ャート。第7図は、第6図の実施例のシンボル・ファイ
ルの内容を示す図である。 代理人 弁理士  内 原   晋 第1図 第2図 番地 Ol OV :変数へに変数8の内容を代入 DD #5:変数A1:5を加算しAZ:代入MP ;無条件にYtlrjピへ分岐する 第3図 嘗き込1hた変数: 話みださ敷た変数
FIG. 1 is a configuration diagram showing the configuration of the present invention. FIG. 2 is a flowchart showing the operation of the first embodiment of the present invention. FIG. 3 is a source program example showing the types of instructions according to the embodiment of the present invention. FIG. 4 shows the symbols and symbols shown in the embodiment of FIG.
A diagram showing the contents of a file. FIG. 5 is an example of variable list output according to the present invention. FIG. 6 is a flow chart showing the operation of the second embodiment of the present invention. FIG. 7 is a diagram showing the contents of the symbol file in the embodiment of FIG. 6. Agent Susumu Uchihara, Patent Attorney Figure 1 Figure 2 Address OL OV: Assign the contents of variable 8 to variable DD #5: Add variable A1:5 AZ: Assign MP; Branch unconditionally to Ytlrj pi Figure 3: Variables introduced in the first hour: Variables introduced at the beginning of the discussion

Claims (1)

【特許請求の範囲】[Claims] ソース・プログラムを格納する第1の記憶手段と、第1
の記憶手段からソース・プログラムを読み出す読み出し
手段と、前記読み出し手段により読み出した命令を識別
する識別手段と、前記識別手段により識別した命令を分
類する第1の分類手段と、第1の分類手段で分類された
命令のオペランドを分類する第2の分類手段と、第2の
分類手段により分類された命令のオペランドを格納する
第2の記憶手段と、第2の記憶手段の内容を出力する出
力手段を具備することを特徴とするプログラム・ドキュ
メント自動生成装置。
a first storage means for storing a source program;
a reading means for reading a source program from a storage means; an identification means for identifying the instructions read by the reading means; a first classification means for classifying the instructions identified by the identification means; a second classification means for classifying the operands of the classified instructions; a second storage means for storing the operands of the instructions classified by the second classification means; and an output means for outputting the contents of the second storage means. An automatic program/document generation device comprising:
JP12804990A 1990-05-17 1990-05-17 Automatic generating device for program document Pending JPH0423038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12804990A JPH0423038A (en) 1990-05-17 1990-05-17 Automatic generating device for program document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12804990A JPH0423038A (en) 1990-05-17 1990-05-17 Automatic generating device for program document

Publications (1)

Publication Number Publication Date
JPH0423038A true JPH0423038A (en) 1992-01-27

Family

ID=14975237

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12804990A Pending JPH0423038A (en) 1990-05-17 1990-05-17 Automatic generating device for program document

Country Status (1)

Country Link
JP (1) JPH0423038A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11203116A (en) * 1998-01-14 1999-07-30 Fujitsu Ltd Variable classifying device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63201736A (en) * 1987-02-18 1988-08-19 Toshiba Corp Programming device for programmable controller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63201736A (en) * 1987-02-18 1988-08-19 Toshiba Corp Programming device for programmable controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11203116A (en) * 1998-01-14 1999-07-30 Fujitsu Ltd Variable classifying device

Similar Documents

Publication Publication Date Title
US8418053B2 (en) Division program, combination program and information processing method
JP3181994B2 (en) How to automatically create job flow specifications
Halpern XPOP: a meta-language without metaphysics
JPH0423038A (en) Automatic generating device for program document
WO2006071368A2 (en) System and method for information encapsulation for providing multiple deliverable formats from one information source
JP3660390B2 (en) Term dictionary management device
JP6983693B2 (en) Stub generation support device, stub generation support method, and program
JP2740468B2 (en) Software asset reorganization processing apparatus and method
JPH04178829A (en) File definition information editing system in load module
JP2990200B2 (en) Object creation method
JPH06332749A (en) Register analysis processor
JP3114199B2 (en) List output method of language processing system
JPH01205331A (en) Large-scale program link system
JP2001005645A (en) Method and system for automatically checking address allocation
JP2771986B2 (en) Magnetic tape unit
JP2000207187A (en) System and method for managing design information of software mounted on space machine
CN114880986A (en) Method for quickly generating global configuration component
JPS63197235A (en) Unifying system for logical variable
Robertson Anecdotes [relocation bits]
Ramachandran et al. Reusing and Retrieving Software Components: An Object-Oriented Domain Analysis Approach
JP2000259399A (en) Source code structure of computer program and machine device wherein object code generated therefrom is built in as control procedure
JPH07239870A (en) Circuit and system
JPH0540612A (en) Computer prperty conversion processor
JP2000222252A (en) Memory content display system and memory content editing system
JPH03110630A (en) Module specification generating device for computer program