JPH06149556A - Automatic specification generating system - Google Patents
Automatic specification generating systemInfo
- Publication number
- JPH06149556A JPH06149556A JP4294244A JP29424492A JPH06149556A JP H06149556 A JPH06149556 A JP H06149556A JP 4294244 A JP4294244 A JP 4294244A JP 29424492 A JP29424492 A JP 29424492A JP H06149556 A JPH06149556 A JP H06149556A
- Authority
- JP
- Japan
- Prior art keywords
- variable
- substitution
- assignment
- variables
- converting
- 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.)
- Granted
Links
Landscapes
- Stored Programmes (AREA)
Abstract
(57)【要約】
【目的】 互いに関係の強い代入処理を一個の表にまと
めることにより、より理解しやすい仕様書を生成するこ
と。
【構成】 プログラム1の代入文における代入先変数
を、その変数の命名規約、あるいは、データ構造を利用
して、カテゴリ別に分類し、同種の変数を代入先に持つ
代入文の集合を抽出する。ついで、表に変換できる変数
について、関係の強い変数毎に表のパターンに変換す
る。また、条件分岐によって分割されている代入文につ
いては、条件で代入文列を分類する。さらに、上記のよ
うにして変換された連続する表の中の代入先に相当する
変数が同種であるとき、これらの表を1個の表に合成す
る。表に変換された代入文は日本語等の自然言語に変換
され、カテゴリ別に分類された表を持つ仕様書2が生成
される。
(57) [Summary] [Purpose] To create a specification that is easier to understand by putting together the substitution processes that have a strong relationship with each other in a single table. [Structure] Variables to be assigned in the assignment statement of program 1 are classified into categories using the variable naming convention or data structure, and a set of assignment statements having variables of the same type as the assignment destination is extracted. Then, for variables that can be converted into a table, the patterns of the table are converted for each variable having a strong relationship. For assignment statements divided by conditional branching, assignment statement strings are classified according to conditions. Furthermore, when the variables corresponding to the substitution destinations in the continuous tables converted as described above are of the same type, these tables are combined into one table. The assignment statement converted into a table is converted into a natural language such as Japanese and a specification 2 having a table classified according to categories is generated.
Description
【0001】[0001]
【産業上の利用分野】既存のプログラムの保守作業を容
易にするため、その仕様書を電子的に管理し、参照検索
を容易にすることが要求されている。ところが、既存の
プログラムの仕様書は多くが手書きであり、その作成に
は人手を要していた。このような手間を省き、電子的に
管理できる仕様書を作るためには、プログラムから仕様
書を抽出して仕様書を自動的に生成する機能が必要とな
る。[Industrial application] In order to facilitate the maintenance work of existing programs, it is required to electronically manage the specifications and facilitate reference retrieval. However, many of the specifications of existing programs are handwritten, and it takes manpower to create them. In order to save such trouble and create a specification that can be managed electronically, a function of extracting the specification from the program and automatically generating the specification is required.
【0002】本発明は上記のように、既存のプログラム
からその仕様書を自動的に生成する仕様書生成方式に関
し、特に本発明は既存のプログラムに用いられている変
数を表に変換して自然言語表現に置き換えることができ
る仕様書自動生成方式に関するものである。As described above, the present invention relates to a specification generation method for automatically generating specifications from an existing program, and in particular, the present invention converts variables used in an existing program into a table and converts them into a table. The present invention relates to an automatic specification generation method that can be replaced with a language expression.
【0003】[0003]
【従来の技術】従来の仕様書生成方式は、プログラムを
そのまま自然言語化するものが多い。また、プログラム
中に用いられている変数を表形式に変換する場合におい
ても、データ宣言の変換テーブルや、デシジョン・テー
ブルを生成するものはあるが、変数の代入先に着目し、
同種の代入をまとめて表に変換するものは知られていな
い。2. Description of the Related Art In many conventional specification generation methods, a program is converted into a natural language as it is. Also, when converting the variables used in the program to the table format, there are some that generate a conversion table for data declaration and a decision table, but pay attention to the variable substitution destination,
It is not known to convert the same kind of substitution into a table.
【0004】[0004]
【発明が解決しようとする課題】上記したように、従来
においては、プログラム中の代入先に着目して、同種の
代入をまとめて表に変換するものは知られていなかっ
た。本発明は上記した従来技術の問題点に鑑みなされた
ものであって、仕様書を生成するに際して、互いに関係
の強い代入処理を一個の表にまとめることにより、より
理解しやすい仕様書を生成する仕様書自動生成方式を提
供することを目的とする。As described above, hitherto, there has not been known a method of collectively converting substitutions of the same kind into a table by paying attention to substitution destinations in a program. The present invention has been made in view of the above-mentioned problems of the prior art. When generating a specification, the substitution processes having a strong relationship with each other are put together in one table to generate a specification that is easier to understand. The purpose is to provide an automatic specification generation method.
【0005】[0005]
【課題を解決するための手段】図1は本発明の原理ブロ
ツク図である。同図において、1は入力されるプログラ
ム、2は生成された仕様書を示している。上記課題を解
決するため、本発明の請求項1の発明は、プログラム1
を自然言語に変換し、仕様書2を自動生成する仕様書自
動生成方式において、図1に示すように、変数の命名規
約を利用して変数をカテゴリ別に分類し、同種の変数を
代入先に持つ代入文の集合を抽出し、抽出された代入文
を表に変換して、仕様書2を自動生成するようにしたも
のである。FIG. 1 is a block diagram showing the principle of the present invention. In the figure, 1 is a program to be input, and 2 is a generated specification document. In order to solve the above problems, the invention of claim 1 of the present invention provides a program 1
In the specification automatic generation method for converting the specification into a natural language and automatically generating the specification 2, as shown in FIG. 1, variables are classified into categories by using the variable naming convention, and variables of the same kind are assigned to the substitution destination. A set of substitution statements that it has is extracted, the extracted substitution statements are converted into a table, and the specification 2 is automatically generated.
【0006】本発明の請求項2の発明は、プログラム1
を自然言語に変換し、仕様書2を自動生成する仕様書自
動生成方式において、図1に示すように、変数のデータ
構造を利用して変数をカテゴリ別に分類して、同種の変
数を代入先に持つ代入文の集合を抽出し、抽出された代
入文を表に変換して、仕様書2を自動生成するようにし
たものである。According to a second aspect of the present invention, there is provided a program 1
In the automatic specification generation method for converting the specification into a natural language and automatically generating the specification 2, as shown in FIG. 1, the variables are classified into categories using the data structure of the variables, and variables of the same kind are assigned to A set of assignment statements having the above is extracted, the extracted assignment statements are converted into a table, and the specification 2 is automatically generated.
【0007】本発明の請求項3の発明は、プログラム1
を自然言語に変換し、仕様書2を自動生成する仕様書自
動生成方式において、図1に示すように、変数の命名規
約を利用して変数をカテゴリ別に分類して、条件分岐に
よって分割されている代入文列のうち、同種の変数を代
入先に持つ代入文の集合を抽出し、条件により代入文列
を分類して表に変換して、仕様書2を自動生成するよう
にしたものである。According to a third aspect of the present invention, there is provided a program 1
In the automatic specification generation method for converting the specification into a natural language and automatically generating the specification 2, as shown in FIG. 1, variables are classified into categories by using a variable naming convention, and are divided by conditional branching. A set of assignment statements that have the same type of variable as the assignment destination is extracted from the assigned assignment statement sequences, the assignment statement sequences are classified according to the conditions, converted into a table, and specification 2 is automatically generated. is there.
【0008】本発明の請求項4の発明は、プログラム1
を自然言語に変換し、仕様書2を自動生成する仕様書自
動生成方式において、図1に示すように、変数のデータ
構造を利用して変数をカテゴリ別に分類して、条件分岐
によって分割されている代入文列のうち、同種の変数を
代入先に持つ代入文の集合を抽出し、条件により代入文
列を分類して表に変換して、仕様書2を自動生成するよ
うにしたものである。According to a fourth aspect of the present invention, there is provided a program 1
In the automatic specification generation method for converting the specification into a natural language and automatically generating the specification 2, as shown in FIG. 1, variables are classified into categories by using a variable data structure, and are divided by conditional branching. A set of assignment statements that have the same type of variable as the assignment destination is extracted from the assigned assignment statement sequences, the assignment statement sequences are classified according to the conditions, converted into a table, and specification 2 is automatically generated. is there.
【0009】本発明の請求項5の発明は、プログラム1
を自然言語に変換し、仕様書2を自動生成する仕様書自
動生成方式において、図1に示すように、変数の命名規
約もしくは変数のデータ構造を利用して変数をカテゴリ
別に分類し、同種の変数を代入先に持つ代入文の集合を
抽出して第1の表に変換するととともに、条件分岐によ
って分割されている代入文列のうち、同種の変数を代入
先に持つ代入文の集合を抽出し、条件により代入文列を
分類して第2の表に変換し、連続する第1および第2の
表の中で代入先に相当する変数が同種である場合に、上
記第1の表および第2の表を一個の表に合成して、仕様
書2を自動生成するようにしたものである。According to a fifth aspect of the present invention, there is provided a program 1
In the automatic specification generation method for converting the specification into a natural language and automatically generating the specification 2, as shown in FIG. 1, variables are classified into categories by using the naming convention of variables or the data structure of variables, and Extracts a set of assignment statements that have variables as assignment destinations and converts them to the first table, and also extracts a set of assignment statements that have the same type of variables as assignment destinations from the assignment statement sequence divided by conditional branching Then, the assignment statement strings are classified according to conditions and converted into the second table, and when the variables corresponding to the assignment destinations in the consecutive first and second tables are of the same type, The second table is combined into one table, and the specification 2 is automatically generated.
【0010】[0010]
【作用】プログラム1の代入文における代入先変数を、
その変数の命名規約、あるいは、データ構造を利用し
て、カテゴリ別に分類し、同種の変数を代入先に持つ代
入文の集合を抽出する。ついで、表に変換できる変数に
ついて、関係の強い変数毎に表のパターンに変換する。
また、条件分岐によって分割されている代入文について
は、条件で代入文列を分類し表に変換する。さらに、上
記のようにして変換された連続する表の中の代入先に相
当する変数が同種であるとき、これらの表を1個の表に
合成する。表に変換された代入文は日本語等の自然言語
に変換され、代入先変数により代入文列を分類した表を
持つ仕様書が生成される。[Function] The substitution destination variable in the substitution statement of program 1 is
By using the variable naming convention or the data structure, the variables are classified into categories and a set of assignment statements having the same type of variable as the assignment destination is extracted. Then, for variables that can be converted into a table, the patterns of the table are converted for each variable having a strong relationship.
For assignment statements divided by conditional branching, assignment statement strings are classified by conditions and converted into tables. Furthermore, when the variables corresponding to the substitution destinations in the continuous tables converted as described above are of the same type, these tables are combined into one table. The assignment statement converted into the table is converted into a natural language such as Japanese, and a specification having a table in which the assignment statement string is classified according to the assignment destination variable is generated.
【0011】本発明の請求項1ないし請求項5の発明に
おいては、上記のようにして仕様書を自動生成するよう
にしたので、仕様書中において同種の代入先変数を持つ
代入文を一個の表に変換することができ、より理解し易
い仕様書を作成することができる。According to the first to fifth aspects of the present invention, since the specifications are automatically generated as described above, one assignment statement having the same type of assignment destination variable is specified in the specifications. It can be converted into a table, and a specification that is easier to understand can be created.
【0012】[0012]
【実施例】図2は本発明の実施例の全体構成を示す図で
あり、11は入力される、例えば、COBOL等の言語
で書かれたプログラム、12はプログラム11を解析し
て、構文構造とデータ構造を表現する中間表現を生成す
る構文解析部、13は構文解析部12において生成され
た中間表現、14は中間表現13の一部を表のパターン
に変換する表変換部、15はその中間表現、16はプロ
グラム中の識別子に対応する意味を表す名前を格納した
名標辞書、17は名標辞書16の情報を基に、中間表現
15を自然言語と自然言語で表現された表に置き換える
自然言語生成部、18は作成された仕様書を示してい
る。FIG. 2 is a diagram showing the overall construction of an embodiment of the present invention, in which 11 is a program written in a language such as COBOL, 12 is a program 11, and the syntax structure is analyzed. And 13 is a syntactic analysis unit that generates an intermediate expression that represents a data structure, 13 is an intermediate expression generated by the syntactic analysis unit 12, 14 is a table conversion unit that converts a part of the intermediate expression 13 into a table pattern, and 15 is the An intermediate expression, 16 is a name tag dictionary storing names representing meanings corresponding to identifiers in the program, and 17 is an intermediate expression 15 based on the information in the name tag dictionary 16 and is a table expressed in natural language and natural language. The replacement natural language generation unit, 18 indicates the created specifications.
【0013】図3、図4はCOBOLで記述された入力
プログラム11の一例を示す図であり、同プログラム中
において、「MOVE…」で記述された代入文が、本実
施例において表変換と対象となる部分であり、例えば、
図4のプログラムの2行目の「MOVE XHIHII
TO XLWCDT」において、代入先の変数「XL
WCDT」が抽出され、変数とその値が、そのカテゴリ
(種類)毎にまとめて表に変換される。FIG. 3 and FIG. 4 are diagrams showing an example of the input program 11 written in COBOL. In this program, the assignment statement written in "MOVE ..." Is the part that becomes
The second line of the program in FIG. 4, "MOVE XHIHII
In "TO XLWCDT", the variable "XL
WCDT ”is extracted, and the variables and their values are collectively converted into a table for each category (type).
【0014】また代入先の変数のカテゴリが同種である
か否かは、例えば、次の方法で判定される。 変数の命名規約情報を利用する方法 変数の命名は、業務や用途によって分類できるように規
定されている場合があり、例えば、変数名の頭3文字
(例えば、「TMP−」が頭3文字に付く変数は「一時
変数」に対応する等)によってその種類が表される。Further, whether or not the categories of the substitution destination variables are of the same type is determined by, for example, the following method. Method of using variable naming convention information Variable naming may be specified so that it can be classified according to business or use. For example, the first three letters of the variable name (for example, "TMP-" are the first three letters). The type of the variable to be attached is represented by "corresponding to" temporary variable ").
【0015】したがって、この場合には、変数名の頭3
文字によってその種類を判定することができる。 変数のデータ構造情報を利用する方法 変数を命名する場合に、例えば、変数「XXXV1」の
下位の変数を「XXXV11」、「XXXV12」、…
とし、さらに、変数「XXXV11」の下位の変数を
「XXXV111」とするように、変数を階層構造と
し、その種類と階層に応じた構造を持つ変数名を付ける
場合がある。このように、データ構造により変数の種類
が分類されている場合には、その変数の構造を見ること
により、その変数のカテゴリを判定することができる。Therefore, in this case, the prefix 3 of the variable name
The type can be determined by the character. Method of Using Data Structure Information of Variables When naming a variable, for example, variables lower than the variable “XXXV1” are “XXXV11”, “XXXV12”, ...
Further, the variable may have a hierarchical structure such that the variable under the variable “XXXV11” is “XXXV111”, and a variable name having a structure according to its type and hierarchy may be given. In this way, when the types of variables are classified by the data structure, the category of the variable can be determined by looking at the structure of the variable.
【0016】図2において、構文解析部12は、例え
ば、図3、図4に示すプログラム11を解析して、その
構文構造とデータ構造を表現する中間表現13を生成す
る。図5ないし図7は構文解析部12において生成され
た中間表現13の一例を示す図であり、同図は、図3、
図4に示したCOBOLで記述されたプログラムよりL
ISPで記述された中間表現を生成した場合を示したも
のである。In FIG. 2, the syntactic analysis unit 12 analyzes the program 11 shown in FIGS. 3 and 4, for example, and generates an intermediate representation 13 expressing the syntactic structure and data structure. 5 to 7 are diagrams showing an example of the intermediate representation 13 generated by the syntax analysis unit 12, which is shown in FIG.
From the program written in COBOL shown in FIG.
It shows a case where an intermediate expression described in ISP is generated.
【0017】構文解析部12において生成された、例え
ば、図5ないし図7に示される中間表現13は表変換部
14に与えられ、表変換部14は、上記した、に示
した判定方法等を用いて、代入文の変数のカテゴリを判
定し、表に変換できる変数について、関係の強い変数毎
に表のパターンに変換して、中間表現15を生成する。For example, the intermediate representation 13 shown in FIGS. 5 to 7 generated in the syntax analysis unit 12 is given to the table conversion unit 14, and the table conversion unit 14 executes the determination method shown in the above. The category of the variable of the assignment statement is determined by using the variable, and the variable that can be converted into the table is converted into the pattern of the table for each variable having a strong relationship to generate the intermediate expression 15.
【0018】自然言語生成部17は中間言語15を名標
辞書16に格納された変数名を用いて自然言語(例え
ば、日本語)に変換し、仕様書18を生成する。図8は
連続する代入文列を表変換した一例を示す図であり、同
図(a)は変換の対象となるCOBOLのプログラム、
同図(b)は構文解析部12において生成されたその中
間表現、同図(c)は、連続して入力される、変数「Y
YYV1」〜「YYYV4」を含む代入文を表変換した
結果を示している。The natural language generator 17 converts the intermediate language 15 into a natural language (for example, Japanese) using the variable names stored in the name dictionary 16 and generates a specification 18. FIG. 8 is a diagram showing an example of table conversion of continuous assignment statement strings. FIG. 8A shows a COBOL program to be converted,
The figure (b) is the intermediate representation generated by the syntax analysis unit 12, and the figure (c) is the variable “Y” that is continuously input.
The result of the table conversion of the assignment statement including "YYV1" to "YYYV4" is shown.
【0019】なお、同図(c)に示す自然言語で表現さ
れた仕様書を生成するに際して、自然言語生成部17
は、名標辞書16に格納された、例えば、次の情報を参
照して変数を自然言語に変換する。 WK1〜WK1 : ワーク1〜ワーク6 XXXV1〜XXXV2 : 変数X1 YYYV1〜YYYV3 : 変数Y1〜変数Y3 ZZZV1 : 変数Z1 図9は連続する代入文列を表変換するフローチャートを
示す図であり、同図により本実施例を説明する。The natural language generation unit 17 is used to generate the specifications expressed in natural language shown in FIG.
Converts a variable into a natural language by referring to the following information stored in the name dictionary 16, for example. WK1 to WK1: Work 1 to Work 6 XXXV1 to XXXV2: Variable X1 YYYV1 to YYYV3: Variable Y1 to variable Y3 ZZZV1: Variable Z1 FIG. This embodiment will be described.
【0020】同図において、ステップS11において、
新規代入文が入力されると、ステップS12において、
代入先変数が抽出される。ステップS13において、カ
テゴリ1と、新しい代入先の変数が同種であるか、また
は、カテゴリ1が値を持たないかが判定される。最初に
代入文が入力されたとき、カテゴリ1は値を持たないの
で、ステップS14に行き、変数を含む代入文を表変換
候補に追加するとともに、抽出された代入先変数と同種
の変数をカテゴリ1として設定する。ついで、ステップ
S15において、文が終了したか否かが判定され、文が
終了していない場合には、ステップS11に戻る。In the figure, in step S11,
When a new assignment statement is input, in step S12,
The substitution target variable is extracted. In step S13, it is determined whether the category 1 and the variable of the new substitution destination are the same type, or whether the category 1 has no value. When the assignment statement is first input, category 1 has no value, so go to step S14 to add the assignment statement including the variable to the table conversion candidate, and to add a variable of the same type as the extracted substitution destination variable to the category. Set as 1. Then, in step S15, it is determined whether or not the sentence is completed. If the sentence is not completed, the process returns to step S11.
【0021】例えば、図8の例において、最初に代入先
変数「XXXV1」が抽出されると、上記変数を含む代
入文が表変換候補として追加されるとともに、上記代入
先変数と同種の代入先変数(この例の場合には、「XX
X」の3文字で始まる代入先変数)がカテゴリ1として
設定される。ついで、ステップS11において、新規代
入文が入力され、ステップS12において、代入先変数
が抽出される。ステップS13において、上記したよう
にカテゴリ1と、新しい代入先の変数が同種であるか、
または、カテゴリ1が値を持たないかが判定される。For example, in the example of FIG. 8, when the assignment destination variable "XXXV1" is first extracted, an assignment statement including the above variable is added as a table conversion candidate, and an assignment destination of the same type as the above assignment destination variable is added. Variable (in this example, "XX
The substitution destination variable starting with the three characters "X") is set as category 1. Next, in step S11, a new assignment statement is input, and in step S12, the assignment destination variable is extracted. In step S13, whether the category 1 and the variable of the new substitution destination are of the same type as described above,
Alternatively, it is determined whether category 1 has no value.
【0022】ここで、抽出された代入先変数が「YYY
V1」の場合には、カテゴリ1と同種ではないので、ス
テップS16に行き、表変換候補が空であるか否かが判
定される。表変換候補が空でない場合(この場合には、
変数「XXXV1」がカテゴリ1として設定されている
ので空ではない)、入力した代入文の前で表は終了する
ので、ステップS17において、表変換候補を変換す
る。なお、同種の代入先変数が連続して入力されない場
合には、表には変換せず、代入文をそのまま自然言語に
変換する。Here, the extracted substitution destination variable is "YYY".
In the case of “V1”, since it is not the same type as category 1, it goes to step S16 and it is determined whether or not the table conversion candidate is empty. If the table conversion candidate is not empty (in this case,
Since the variable "XXXV1" is set as category 1 and is not empty), the table ends before the input assignment statement, so the table conversion candidates are converted in step S17. In addition, when the substitution target variables of the same type are not continuously input, the assignment statement is directly converted to the natural language without being converted into the table.
【0023】例えば、上記のように、代入先変数「XX
XV1」が一つ抽出された後に、異なったカテゴリの代
入先変数である「YYYV1」が抽出された場合には、
「XXX」の3文字で始まる代入先変数は連続しないの
で表変換せず、図8(c)に示すように、「変数X1を
ワーク1に設定する。」と代入文をそのまま自然言語に
変換する。For example, as described above, the substitution destination variable "XX
If "YYYV1" which is a substitution destination variable of a different category is extracted after one "XV1" is extracted,
Since the substitution destination variables starting with the three letters "XXX" are not continuous, they are not converted into a table, and as shown in FIG. 8C, the substitution statement is directly converted to the natural language, such as "set variable X1 to work 1". To do.
【0024】ついで、ステップS18において、次の表
変換の準備をするため、カテゴリ1および表変換候補を
クリアし、ステップS19において文が終了したか否か
が判別され、終了していない場合には、ステップS11
に戻り、代入先変数「YYYV1」を含む代入文につい
て上記と同様の処理を行う。例えば、図8(a)に示す
ように、変数「XXXV1」を含む代入文が入力された
のちに、「YYY」の3文字ではじまる代入先変数を含
む代入文が連続して入力される場合には、これらの代入
先変数を含む代入文が表変換候補として追加され、ステ
ップS17において表変換される。Then, in step S18, to prepare for the next table conversion, category 1 and the table conversion candidates are cleared, and in step S19 it is judged whether or not the sentence has ended. , Step S11
Then, the same processing as above is performed for the assignment statement including the assignment destination variable “YYYV1”. For example, as shown in FIG. 8A, when an assignment statement including a variable “XXXV1” is input, and then an assignment statement including an assignment destination variable that starts with three letters “YYY” is continuously input. Is added as a table conversion candidate, and the table is converted in step S17.
【0025】その結果、代入先変数「YYYV1」、
「YYYV2」、「YYYV3」が対応した自然言語表
現である「変数Y1」、「変数Y2」、「変数Y3」に
変換され、図8(c)に示すように上記代入文が表に変
換される。また、表の前には、「以下の領域に値を設定
する。」が付加される。ついで、代入先変数「ZZZV
1」、「XXXV2」を含む代入文が入力されると、代
入先変数「XXXV1」を含む代入文が入力された場合
と同様、図8(c)に示すように、それらがそれぞれ、
「変数Z1にワーク5を設定する。」、「変数X2にワ
ーク6を設定する。」と変換される。As a result, the substitution destination variable "YYYV1",
"YYYV2" and "YYYV3" are converted into the corresponding natural language expressions "variable Y1", "variable Y2", and "variable Y3", and the assignment statement is converted into a table as shown in FIG. 8C. It In addition, “Set a value in the following area.” Is added in front of the table. Then, the substitution destination variable "ZZZZV
When an assignment statement including "1" and "XXXV2" is input, as in the case where an assignment statement including an assignment destination variable "XXXV1" is input, as shown in FIG.
It is converted into “Set work 5 to variable Z1” and “Set work 6 to variable X2”.
【0026】図10および図11は条件分岐文中の代入
文を表変換した一例を示す図であり、同図(a)は変換
の対象となるCOBOLのプログラム、同図(b)は構
文解析部12において生成されたその中間表現、図11
は、変数「YYYV1」〜「YYYV3」を含む条件分
岐文中の代入文を表変換した結果を示している。図12
は条件分岐文中の代入文を表変換するフローチャートを
示す図であり、同図により本実施例を説明する。FIG. 10 and FIG. 11 are diagrams showing an example of table conversion of the assignment statement in the conditional branch statement. FIG. 10A is a COBOL program to be converted, and FIG. The intermediate representation generated in FIG.
Indicates the result of table conversion of the assignment statement in the conditional branch statement including the variables “YYYV1” to “YYYV3”. 12
FIG. 4 is a diagram showing a flowchart for converting an assignment statement in a conditional branch statement into a table, and this embodiment will be described with reference to FIG.
【0027】ステップS21において、新規条件文を入
力し、ステップS22において、代入文を抽出する。ス
テップS23において代入先変数を抽出し、ステップS
24において、カテゴリ1と変数が同種、またはカテゴ
リ1が値を持たないか否かが判別される。図9のフロー
チャートの場合と同様、最初に代入文が入力されたと
き、カテゴリ1は値を持たないので、ステップS25に
行き、変数を含む代入文を表変換候補に追加するととも
に、抽出された代入先変数と同種の変数をカテゴリ1と
して設定し、代入元には条件を付加する。In step S21, a new conditional sentence is input, and in step S22, an assignment sentence is extracted. In step S23, the substitution destination variable is extracted, and step S
At 24, it is determined whether the variables are the same as the category 1 or the category 1 has no value. As in the case of the flowchart of FIG. 9, when the assignment statement is input for the first time, category 1 has no value, so go to step S25 to add the assignment statement including variables to the table conversion candidates and extract it. A variable of the same type as the substitution destination variable is set as category 1, and a condition is added to the substitution source.
【0028】ついで、ステップS26において、文が終
了したか否かが判定され、文が終了していない場合に
は、ステップS22に戻り、次の代入文を抽出する。例
えば、図10の例において、最初に代入先変数「YYY
V1」が抽出されると、上記変数を含む代入文が表変換
候補として追加されるとともに、上記代入先変数と同種
の代入先変数がカテゴリ1として設定される。また、代
入元には条件として、「IF cond−A THE
N」に対応した「cond−Aの時」という条件が付加
され、文が終了していない場合には、ステップS22に
戻り次の代入文が抽出される。Then, in step S26, it is determined whether or not the sentence is completed. If the sentence is not completed, the process returns to step S22 and the next assignment sentence is extracted. For example, in the example of FIG. 10, first, the substitution destination variable “YYY
When “V1” is extracted, an assignment statement including the above variable is added as a table conversion candidate, and an assignment destination variable of the same type as the above assignment destination variable is set as category 1. In addition, as a condition for the substitution source, “IF cond-A THE
When the condition “cond-A time” corresponding to “N” is added and the statement is not completed, the process returns to step S22 and the next assignment statement is extracted.
【0029】次にステップS24において、ステップS
23において抽出された代入文の代入先変数が、カテゴ
リ1と同種であるかが判定される。ここで、抽出された
代入先変数が、例えば、図10に示すように「YYYV
2」の場合には、カテゴリ1と同種なので、ステップS
25に行き、上記変数を含む代入文が表変換候補として
追加されるとともに、代入元には条件として、「IF
cond−A THEN」に対応した「cond−Aの
時」という条件が付加される。Next, in step S24, step S
It is determined whether the substitution destination variable of the substitution statement extracted in 23 is the same type as category 1. Here, the extracted substitution destination variable is, for example, "YYYV" as shown in FIG.
In the case of “2”, since it is the same type as category 1, step S
25, an assignment statement including the above variables is added as a table conversion candidate, and the assignment source is given a condition of “IF
A condition "time of cond-A" corresponding to "cond-A THEN" is added.
【0030】以下同様にして、代入文が表変換候補とし
て追加され、図10(a)の代入先変数「YYYV3」
を含む代入文が入力されて表変換候補に追加されると、
代入文が終了するので、ステップS27に行く。ステッ
プS27において、表変換候補を表変換するとともに、
同じ代入先を同欄にまとめる。また、ステップS28で
次の表変換の準備をするため、表変換候補とカテゴリ1
をクリアし、ステップS29において、文が終了したか
否かを判別し、文が終了していない場合には、ステップ
S21に戻り、上記処理を繰り返す。Similarly, the assignment statement is added as a table conversion candidate, and the assignment destination variable “YYYV3” in FIG.
When an assignment statement containing is input and added to the table conversion candidates,
Since the assignment statement is completed, the process goes to step S27. In step S27, the table conversion candidates are converted into a table and
Collect the same assignment destinations in the same column. Also, in order to prepare for the next table conversion in step S28, table conversion candidates and category 1
Is cleared, and in step S29, it is determined whether or not the sentence has ended. If the sentence has not ended, the process returns to step S21 and the above process is repeated.
【0031】また、上記ステップS24において、カテ
ゴリ1と抽出された代入先変数が同種でないと判定され
た場合には、ステップS28にいき、上記と同様、次の
表変換の準備をするため、表変換候補とカテゴリ1をク
リアし、ステップS29において、文が終了したか否か
を判別し、文が終了していない場合には、ステップS2
1に戻り、上記処理を繰り返す。If it is determined in step S24 that the category 1 and the extracted substitution target variables are not of the same type, the process proceeds to step S28, and the table conversion is performed to prepare for the next table conversion as described above. The conversion candidate and category 1 are cleared, and in step S29, it is determined whether or not the sentence has ended. If the sentence has not ended, step S2
Returning to 1, the above processing is repeated.
【0032】以上の処理の結果、代入先変数「YYYV
1」、「YYYV2」、「YYYV3」が対応した自然
言語表現である「変数Y1」、「変数Y2」、「変数Y
3」に変換され、図11に示すように代入先に「con
d−Aの時」、「上記以外の時」、「cond−Aでな
い時」という条件が付加されて、上記代入文が代入先変
数毎に表に変換される。また、表の前には、「以下の領
域に値を設定する。」が付加される。As a result of the above processing, the substitution destination variable "YYYV
"Variable Y1", "Variable Y2", "Variable Y" which are natural language expressions corresponding to "1", "YYYV2", and "YYYV3".
3 ”, and as shown in FIG.
The conditions "d-A", "other than the above", and "not con-A" are added, and the assignment statement is converted into a table for each assignment-destination variable. In addition, “Set a value in the following area.” Is added in front of the table.
【0033】図13ないし図15は代入文列と条件分岐
文中の代入文列からなるプログラムを表変換した一例を
示す図であり、図13は変換の対象となるCOBOLの
プログラム、図14は構文解析部12において生成され
たその中間表現、図15は上記中間表現を表変換した結
果を示している。図16は代入文列と条件分岐文中の代
入文列を連続する表に変換するフローチャートを示す図
であり、同図により本実施例を説明する。FIGS. 13 to 15 are views showing an example of table conversion of a program consisting of an assignment statement string and an assignment statement string in a conditional branch statement. FIG. 13 is a COBOL program to be converted, and FIG. 14 is a syntax. The intermediate representation generated in the analysis unit 12, FIG. 15 shows the result of tabular conversion of the intermediate representation. FIG. 16 is a diagram showing a flowchart for converting an assignment statement string and an assignment statement string in a conditional branch statement into a continuous table, and this embodiment will be described with reference to the same figure.
【0034】ステップS31において、新規文を入力
し、ステップS32において、入力文を判定する。入力
文が代入文の連続である場合には、ステップS33にお
いて、図9のフローチャートで示したような処理を行う
ことにより、表変換候補への登録の成否を判別する。表
変換候補への登録が成功した場合には、ステップS34
に行き、文が終了したか否かを判定し、終了していない
場合には、ステップS31に戻り上記処理を繰り返す。
また、ステップS33において、途中で別種の代入先が
現れた場合には、途中で失敗したものとして表変換候補
の登録を中止してステップS37に行き表変換候補を表
変換する。ついで、ステップS38において、次の表変
換の準備をするため、表変換候補とカテゴリ1をクリア
し、ステップS39において、文が終了したか否かを判
別し、文が終了していない場合には、ステップS31に
戻り、上記処理を繰り返す。In step S31, a new sentence is input, and in step S32, the input sentence is judged. If the input sentence is a sequence of assignment sentences, the success or failure of registration as a table conversion candidate is determined in step S33 by performing the processing shown in the flowchart of FIG. If registration to the table conversion candidate is successful, step S34.
Then, it is determined whether or not the sentence is finished. If it is not finished, the process returns to step S31 to repeat the above process.
In step S33, if another type of substitution destination appears in the middle of the process, the table conversion candidate is considered to have failed in the middle, registration of the table conversion candidate is stopped, and the table conversion candidate is converted into the table in step S37. Next, in step S38, to prepare for the next table conversion, the table conversion candidates and category 1 are cleared, and in step S39 it is determined whether or not the sentence has ended. If the sentence has not ended, , And returns to step S31 to repeat the above process.
【0035】また、ステップS32において、入力文が
条件分岐文であると判定された場合には、ステップS3
5に行き、図12のフローチャートで示したような処理
を行うことにより、表変換候補への登録の成否を判別す
る。表変換候補への登録が成功した場合には、ステップ
S34に行き、上記と同様の処理を行う。また、ステッ
プS33において、途中で別種の代入先が現れた場合に
は、その条件分岐文は今までの表とは同じ表にできない
ので、ステップS36に行き、今までの登録をキャンセ
ルして、ステップS37に行き、上記と同様の処理を行
う。If it is determined in step S32 that the input sentence is a conditional branch sentence, step S3.
5, the process as shown in the flowchart of FIG. 12 is performed to determine the success or failure of registration as a table conversion candidate. If the registration to the table conversion candidate is successful, the process goes to step S34 and the same process as above is performed. If another type of assignment destination appears in the middle of step S33, the conditional branch statement cannot be the same table as the table so far, so the procedure goes to step S36 to cancel the registration so far. The process proceeds to step S37 and the same processing as above is performed.
【0036】また、ステップS32において、入力文が
その他の文であると判定された場合には、ステップS3
7に行き、上記と同様の処理を行う。以上の処理の結
果、図13に示したプログラムは、図15に示す表に変
換される。以上のように表の結合を行うと、図15の最
後の変数Y9に対する代入のように、単独では表にでき
ない代入文も表にまとめることができる。If it is determined in step S32 that the input sentence is another sentence, step S3
7, the same processing as above is performed. As a result of the above processing, the program shown in FIG. 13 is converted into the table shown in FIG. When the tables are combined as described above, assignment statements that cannot be made into tables by themselves, such as assignment to the last variable Y9 in FIG. 15, can be put together in the table.
【0037】[0037]
【発明の効果】以上説明したことから明らかなように、
本発明においては、変数の命名規約もしくは変数のデー
タ構造を利用して変数をカテゴリ別に分類し、同種の変
数を代入先に持つ代入文の集合を抽出して表に変換する
とともに、上記のようにして変換された連続する表の中
の代入先に相当する変数が同種であるとき、これらの表
を1個の表に合成して、仕様書を自動生成するようにし
たので、仕様書中において、意味的に同一の代入処理を
1個の表に変換することができ、より理解し易い仕様書
を生成することができる。As is apparent from the above description,
In the present invention, the variables are classified into categories by using the variable naming convention or the variable data structure, a set of assignment statements having the same type of variable as the assignment destination is extracted and converted into a table, and as described above. When the variables corresponding to the substitution destinations in the continuous tables converted by the above are the same type, these tables are combined into one table and the specifications are automatically generated. In, the semantically identical substitution processing can be converted into one table, and a more easily understandable specification can be generated.
【図1】本発明の原理ブロック図である。FIG. 1 is a principle block diagram of the present invention.
【図2】本発明の実施例の全体構成を示す図である。FIG. 2 is a diagram showing an overall configuration of an embodiment of the present invention.
【図3】COBOLで記述された入力プログラムの一例
を示す図である。FIG. 3 is a diagram showing an example of an input program written in COBOL.
【図4】COBOLで記述された入力プログラムの一例
を示す図(続き)である。FIG. 4 is a diagram (continuation) showing an example of an input program described in COBOL.
【図5】構文解析部において生成された中間表現の一例
を示す図である。FIG. 5 is a diagram showing an example of an intermediate expression generated by a syntax analysis unit.
【図6】構文解析部において生成された中間表現の一例
を示す図(続き)である。FIG. 6 is a diagram (continuation) showing an example of an intermediate expression generated by a syntax analysis unit.
【図7】構文解析部において生成された中間表現の一例
を示す図(続き)である。FIG. 7 is a diagram (continuation) showing an example of an intermediate expression generated in the syntax analysis unit.
【図8】連続する代入文列を表変換した一例を示す図で
ある。FIG. 8 is a diagram showing an example of table conversion of continuous assignment statement strings.
【図9】連続する代入文列を表変換するフローチャート
を示す図である。FIG. 9 is a diagram showing a flowchart for converting a continuous substitution statement string into a table.
【図10】条件分岐文中の代入文を表変換した一例を示
す図である。FIG. 10 is a diagram showing an example of table conversion of an assignment statement in a conditional branch statement.
【図11】条件分岐文中の代入文を表変換した一例を示
す図(続き)である。FIG. 11 is a diagram (continuation) showing an example of table conversion of an assignment statement in a conditional branch statement.
【図12】条件分岐文中の代入文を表変換するフローチ
ャートを示す図である。FIG. 12 is a diagram showing a flowchart for converting an assignment statement in a conditional branch statement into a table.
【図13】連続する表を一個の表に変換した一例を示す
図である。FIG. 13 is a diagram showing an example in which a continuous table is converted into one table.
【図14】連続する表を一個の表に変換した一例を示す
図(続き)である。FIG. 14 is a diagram (continuation) showing an example in which a continuous table is converted into one table.
【図15】連続する表を一個の表に変換した一例を示す
図(続き)である。FIG. 15 is a diagram (continuation) showing an example in which a continuous table is converted into one table.
【図16】連続する表を一個の表に変換するフローチャ
ートを示す図である。FIG. 16 is a diagram showing a flowchart for converting a continuous table into one table.
1,11 プログラム 12 構文解析部 13,15 中間表現 14 表変換部 16 名標辞書 17 自然言語生成部 2,18 仕様書 1, 11 program 12 syntax analysis unit 13, 15 intermediate representation 14 table conversion unit 16 name tag dictionary 17 natural language generation unit 2, 18 specifications
───────────────────────────────────────────────────── フロントページの続き (72)発明者 野呂 正明 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Masaaki Noro 1015 Kamiodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Inside Fujitsu Limited
Claims (5)
を自動生成する仕様書自動生成方式において、 変数の命名規約を利用して変数をカテゴリ別に分類し、
同種の変数を代入先に持つ代入文の集合を抽出し、 抽出された代入文を表に変換して、仕様書を自動生成す
ることを特徴とする仕様書自動生成方式。1. In a specification automatic generation method for converting a program into a natural language and automatically generating specifications, variables are classified into categories by using a variable naming convention,
An automatic specification generation method characterized by extracting a set of substitution statements having the same type of variables as the substitution destinations, converting the extracted substitution statements into a table, and automatically generating specifications.
を自動生成する仕様書自動生成方式において、 変数のデータ構造を利用して変数をカテゴリ別に分類し
て、同種の変数を代入先に持つ代入文の集合を抽出し、 抽出された代入文を表に変換して、仕様書を自動生成す
ることを特徴とする仕様書自動生成方式。2. In a specification automatic generation method for converting a program into a natural language and automatically generating a specification, variables are classified into categories using a data structure of variables, and variables of the same kind are used as substitution destinations. An automatic specification generation method characterized by extracting a set of substitution statements, converting the extracted substitution statements into a table, and automatically generating specifications.
を自動生成する仕様書自動生成方式において、 変数の命名規約を利用して変数をカテゴリ別に分類し
て、条件分岐によって分割されている代入文列のうち、
同種の変数を代入先に持つ代入文の集合を抽出し、 条件により代入文列を分類して表に変換して、仕様書を
自動生成することを特徴とする仕様書自動生成方式。3. In a specification automatic generation method for converting a program into a natural language and automatically generating specifications, variables are classified into categories by using a variable naming convention, and substitutions are divided by conditional branching. Of the sentence sequence,
An automatic specification generation method characterized by extracting a set of substitution statements that have the same type of variable as the substitution destination, classifying the substitution statement strings according to conditions, and converting them into a table to automatically generate specifications.
を自動生成する仕様書自動生成方式において、 変数のデータ構造を利用して変数をカテゴリ別に分類し
て、条件分岐によって分割されている代入文列のうち、
同種の変数を代入先に持つ代入文の集合を抽出し、 条件により代入文列を分類して表に変換して、仕様書を
自動生成することを特徴とする仕様書自動生成方式。4. In a specification automatic generation method for converting a program into a natural language and automatically generating specifications, variables are classified into categories by using a variable data structure, and substitution is performed by conditional branching. Of the sentence sequence,
An automatic specification generation method characterized by extracting a set of substitution statements that have the same type of variable as the substitution destination, classifying the substitution statement strings according to conditions, and converting them into a table to automatically generate specifications.
を自動生成する仕様書自動生成方式において、 変数の命名規約もしくは変数のデータ構造を利用して変
数をカテゴリ別に分類し、同種の変数を代入先に持つ代
入文の集合を抽出して第1の表に変換するととともに、
条件分岐によって分割されている代入文列のうち、同種
の変数を代入先に持つ代入文の集合を抽出し、条件によ
り代入文列を分類して第2の表に変換し、 連続する第1および第2の表の中で代入先に相当する変
数が同種である場合に、上記第1の表および第2の表を
一個の表に合成して、仕様書を自動生成することを特徴
とする仕様書自動生成方式。5. In a specification automatic generation method for converting a program into a natural language and automatically generating a specification, variables are classified into categories by using a variable naming convention or a variable data structure, and variables of the same type are generated. While extracting the set of assignment statements at the assignment destination and converting it to the first table,
From the assignment statement sequence divided by the conditional branch, a set of assignment statements having the same type of variable as the assignment destination is extracted, the assignment statement sequence is classified according to the condition, converted into the second table, and the continuous first And when the variables corresponding to the substitution destinations in the second table are of the same type, the first table and the second table are combined into a single table, and the specifications are automatically generated. Automatic specification generation method.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP29424492A JP3390471B2 (en) | 1992-11-02 | 1992-11-02 | Specification generator |
| US08/556,122 US5742827A (en) | 1992-11-02 | 1995-11-09 | Method of automatically forming program specifications and apparatus therefor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP29424492A JP3390471B2 (en) | 1992-11-02 | 1992-11-02 | Specification generator |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06149556A true JPH06149556A (en) | 1994-05-27 |
| JP3390471B2 JP3390471B2 (en) | 2003-03-24 |
Family
ID=17805222
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP29424492A Expired - Fee Related JP3390471B2 (en) | 1992-11-02 | 1992-11-02 | Specification generator |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3390471B2 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11203116A (en) * | 1998-01-14 | 1999-07-30 | Fujitsu Ltd | Variable classifier and storage medium storing the program |
| JP2014123321A (en) * | 2012-12-21 | 2014-07-03 | Ntt Data Corp | Software development support device, software development support method, and software development support program |
-
1992
- 1992-11-02 JP JP29424492A patent/JP3390471B2/en not_active Expired - Fee Related
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11203116A (en) * | 1998-01-14 | 1999-07-30 | Fujitsu Ltd | Variable classifier and storage medium storing the program |
| JP2014123321A (en) * | 2012-12-21 | 2014-07-03 | Ntt Data Corp | Software development support device, software development support method, and software development support program |
Also Published As
| Publication number | Publication date |
|---|---|
| JP3390471B2 (en) | 2003-03-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5555169A (en) | Computer system and method for converting a conversational statement to computer command language | |
| JP2006268375A (en) | Translation memory system | |
| Levendovszky et al. | A novel approach to semi-automated evolution of dsml model transformation | |
| JP2004118374A (en) | Conversion apparatus, conversion method, conversion program, and computer-readable recording medium storing conversion program | |
| JP3390471B2 (en) | Specification generator | |
| Arnon | Scrimshaw: A language for document queries and transformations | |
| CN120258007B (en) | AST analysis-based Web multilingual translation method and apparatus | |
| JP2022090770A (en) | Generation device and test code generation method | |
| CN119782153A (en) | A method and system for generating functional test cases based on large language model | |
| EP1080424A1 (en) | A method and arrangement for translation of information | |
| CN101288072A (en) | Migration and transformation of data structures | |
| KR100280828B1 (en) | Analysis method for converting procedural programs into object-oriented programs | |
| JPH10207896A (en) | Search term expansion method and apparatus and information search method and apparatus | |
| JP3001427B2 (en) | Software coding system | |
| JPH0455938A (en) | Automatic generation system for program specifications | |
| JP3190377B2 (en) | Function name converter | |
| KR100377902B1 (en) | A Method for Constructing Korean Wordnet and A Korean Wordnet Constructed by Using the Same | |
| JPS6027941A (en) | Identifier generation system | |
| JP2002328943A (en) | Semantic information estimation device, semantic information estimation method, program, and storage medium | |
| JPH10269066A (en) | Automatic shell creation device in Japanese | |
| JPS62177627A (en) | Production of parts segmenting program | |
| KR100341397B1 (en) | Method of Solving the Unknown String of Concepts in a Concept-based Machine Translation System | |
| KR20020067106A (en) | SYSTEM AND METHOD FOR THE AUTOMATIC CONVERSION OF IPv4 TO IPv6 SOCKET API | |
| JPH1063665A (en) | Text translation method and apparatus | |
| JPH0922413A (en) | Method and apparatus for generalizing attribute-class relationships |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20030107 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080117 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090117 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100117 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110117 Year of fee payment: 8 |
|
| LAPS | Cancellation because of no payment of annual fees |