Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2982725B2 - Automatic program generator - Google Patents
[go: Go Back, main page]

JP2982725B2 - Automatic program generator - Google Patents

Automatic program generator

Info

Publication number
JP2982725B2
JP2982725B2 JP8339647A JP33964796A JP2982725B2 JP 2982725 B2 JP2982725 B2 JP 2982725B2 JP 8339647 A JP8339647 A JP 8339647A JP 33964796 A JP33964796 A JP 33964796A JP 2982725 B2 JP2982725 B2 JP 2982725B2
Authority
JP
Japan
Prior art keywords
input
output
pattern
rule
program
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.)
Expired - Fee Related
Application number
JP8339647A
Other languages
Japanese (ja)
Other versions
JPH09231063A (en
Inventor
夏子 野田
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
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP8339647A priority Critical patent/JP2982725B2/en
Publication of JPH09231063A publication Critical patent/JPH09231063A/en
Application granted granted Critical
Publication of JP2982725B2 publication Critical patent/JP2982725B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【発明の属する技術分野】本発明は、入力仕様と出力プ
ログラムの関係を記述した変換規則を内部に持ち、その
変換規則に従って入力仕様からプログラムを生成するプ
ログラム自動生成装置に関し、特に変換規則の一部を外
部情報として切り離し、それらの情報にアクセスして変
換の仕方をダイナミックに切り替えるメタルールを有す
るプログラム自動生成装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an automatic program generation device that internally has a conversion rule describing the relationship between an input specification and an output program and generates a program from the input specification in accordance with the conversion rule. The present invention relates to an automatic program generation device having a meta-rule that separates a part as external information, accesses the information, and dynamically switches a conversion method.

【0001】[0001]

【従来の技術】特開平5−250174号公報には、入
力プログラムを構文解析したものを、構文木の対の集合
で表現される変換規則集合を用いて変換して出力プログ
ラムを生成するプログラム変換方式が記載されている。
2. Description of the Related Art Japanese Unexamined Patent Publication No. 5-250174 discloses a program conversion for generating an output program by converting a syntax analysis of an input program using a conversion rule set represented by a set of syntax tree pairs. The method is described.

【0002】[0002]

【発明が解決しようとする課題】この特開平5−250
174号公報記載の技術においては、入力仕様を入力し
てどのような出力プログラムを生成するのかを、すべて
変換規則に記述する。そのため、入力仕様の形式を追加
するためには、該入力仕様の形式の追加された部分か
ら、どのようなプログラムを出力するかを指示する変換
規則を追加しなければならず、出力プログラムの形式を
変更する場合には、ある入力仕様の形式を該出力プログ
ラムの形式に変換する変換規則を修正しなければならな
い。
The problem to be solved by the present invention is disclosed in Japanese Patent Laid-Open No. Hei 5-250
In the technique described in Japanese Patent Application Publication No. 174, all output programs to be generated by inputting input specifications are described in conversion rules. Therefore, in order to add the format of the input specification, it is necessary to add a conversion rule indicating what program is to be output from the added portion of the format of the input specification. Must be changed, the conversion rules for converting the format of a certain input specification into the format of the output program must be modified.

【0003】すなわち、この従来の技術には、入力仕様
の形式の追加や出力プログラムの形式を変更したい場合
に、その都度プログラム変換規則を追加および修正しな
ければならないという問題点がある。
[0003] That is, this conventional technique has a problem that a program conversion rule must be added and corrected every time it is desired to add an input specification format or change an output program format.

【0004】さらに、該従来の技術には、利用者にとっ
て、変換規則の記述の方法が容易に理解できるものでは
なく、カスタマイズが困難であるという問題点がある。
Further, the conventional technique has a problem that a user cannot easily understand a method of describing a conversion rule and customization is difficult.

【0005】本発明の目的は、入力仕様の形式の追加や
出力プログラムの形式の変更を、変換規則を修正するこ
となく、容易に実施することができるプログラム自動生
成装置を提供することにある。
[0005] It is an object of the present invention to provide an automatic program generation device that can easily add a format of an input specification or change a format of an output program without modifying a conversion rule.

【0006】[0006]

【課題を解決するための手段】本発明の第1のプログラ
ム自動生成装置は、入力装置から入力された仕様データ
をプログラムに変換するプログラム生成部と、前記プロ
グラム生成部により参照される参照部とを備え、前記プ
ログラム生成部が、前記参照部を参照して前記仕様デー
タを前記プログラムに変換するメタルールを含むことを
特徴とする。
According to a first aspect of the present invention, there is provided a program automatic generating apparatus for converting a specification data input from an input device into a program, a reference section referred to by the program generating section, Wherein the program generation unit includes a meta rule for converting the specification data into the program with reference to the reference unit.

【0007】本発明の第2のプログラム自動生成装置
は、第1のプログラム自動生成装置において、前記プロ
グラム生成部が、変換規則集合を含むことを特徴とす
る。
According to a second automatic program generation device of the present invention, in the first automatic program generation device, the program generation section includes a set of conversion rules.

【0008】本発明の第3のプログラム自動生成装置
は、第1のプログラム自動生成装置において、前記メタ
ルールが、前記参照部にアクセスする複数の変換規則を
含むことを特徴とする。
According to a third automatic program generation device of the present invention, in the first automatic program generation device, the meta-rule includes a plurality of conversion rules for accessing the reference section.

【0009】本発明の第4のプログラム自動生成装置
は、第1のプログラム自動生成装置において、前記参照
部が、少なくとも一つの入出力対応表と少なくとも一つ
のテンプレートとを含むことを特徴とする。
According to a fourth automatic program generation device of the present invention, in the first automatic program generation device, the reference section includes at least one input / output correspondence table and at least one template.

【0010】本発明の第5のプログラム自動生成装置
は、第4のプログラム自動生成装置において、前記入出
力対応表が、前記仕様データと前記プログラムとの関係
を定義することを特徴とする。
According to a fifth automatic program generation device of the present invention, in the fourth automatic program generation device, the input / output correspondence table defines a relationship between the specification data and the program.

【0011】本発明の第6のプログラム自動生成装置
は、第4のプログラム自動生成装置において、前記入出
力対応表が、前記仕様データのオブジェクト名と前記テ
ンプレートとの関係を定義することを特徴とする。
According to a sixth automatic program generation device of the present invention, in the fourth automatic program generation device, the input / output correspondence table defines a relationship between an object name of the specification data and the template. I do.

【0012】本発明の第7のプログラム自動生成装置
は、第6のプログラム自動生成装置において、前記メタ
ルールが、前記入出力対応表に定義された関係に対応す
る前記テンプレートをアクセスすることを特徴とする。
According to a seventh automatic program generation device of the present invention, in the sixth automatic program generation device, the meta-rule accesses the template corresponding to the relationship defined in the input / output correspondence table. I do.

【0013】本発明の第8のプログラム自動生成装置
は、入力装置から入力された仕様データをプログラムに
変換するプログラム生成部と、前記仕様データに対する
変換の仕方を予め設定する参照部とを備え、前記プログ
ラム生成部が、前記参照部を参照して変換の仕方を決定
し、決定された変換の仕方にしたがって前記仕様データ
を前記プログラムに変換するメタルールを含むことを特
徴とする。
An eighth automatic program generation apparatus according to the present invention includes a program generation unit for converting specification data input from an input device into a program, and a reference unit for presetting a conversion method for the specification data, The program generation unit may determine a conversion method with reference to the reference unit, and include a meta rule for converting the specification data into the program according to the determined conversion method.

【0014】本発明の第9のプログラム自動生成装置
は、第8のプログラム自動生成装置において、前記プロ
グラム生成部が、さらに前記参照部を参照せずに前記仕
様データを前記プログラムに変換する変換規則群を含む
ことを特徴とする。
According to a ninth program automatic generation device of the present invention, in the eighth program automatic generation device, the program generation unit converts the specification data into the program without referring to the reference unit. It is characterized by including a group.

【0015】本発明の第10のプログラム自動生成装置
は、第9のプログラム自動生成装置において、前記参照
部が、少なくとも一つの入出力対応表と少なくとも一つ
のテンプレート群とを含むことを特徴とする。
According to a tenth program automatic generation device of the present invention, in the ninth program automatic generation device, the reference section includes at least one input / output correspondence table and at least one template group. .

【0016】本発明の第11のプログラム自動生成装置
は、第10のプログラム自動生成装置において、前記入
出力対応表が、変換の対象である入力パターンと変換の
結果である出力パターンとの対応を定義する複数のエン
トリを含み、各エントリの前記入力パターンが前記仕様
データを含み、前記出力パターンが前記テンプレートの
識別子を含むことを特徴とする。
According to an eleventh program automatic generation device of the present invention, in the tenth program automatic generation device, the input / output correspondence table indicates a correspondence between an input pattern to be converted and an output pattern as a result of the conversion. A plurality of entries to be defined are included, the input pattern of each entry includes the specification data, and the output pattern includes an identifier of the template.

【0017】本発明の第12のプログラム自動生成装置
は、第11のプログラム自動生成装置において、前記入
出力対応表の各エントリの、前記入力パターンが、さら
に他のエントリで定義された前記出力パターンを含み、
前記出力パターンが、さらに他のエントリで定義される
前記入力パターンを含むことを特徴とする。
A twelfth program automatic generation device according to the present invention is the automatic program generation device according to the eleventh program, wherein the input pattern of each entry of the input / output correspondence table is the output pattern defined by another entry. Including
The output pattern includes the input pattern defined by another entry.

【0018】本発明の第13のプログラム自動生成装置
は、第11または第12のプログラム自動生成装置にお
いて、前記メタルールが、前記仕様データを前記入力パ
ターンとして前記入出力対応表を検索し、該入力パター
ンに対応する前記出力パターンとして前記テンプレート
の識別子を得た場合には、該識別子に対応するテンプレ
ートを前記テンプレート群から読み出し、読み出したテ
ンプレートに前記仕様データを反映して展開することに
より、前記プログラムを生成することを特徴とする。
In a thirteenth or twelfth automatic program generation apparatus according to the present invention, the meta-rule searches the input / output correspondence table using the specification data as the input pattern. When the identifier of the template is obtained as the output pattern corresponding to the pattern, the template corresponding to the identifier is read out from the template group, and the read template is expanded by reflecting the specification data, whereby the program Is generated.

【0019】本発明の第14のプログラム自動生成装置
は、第13のプログラム自動生成装置において、前記メ
タルールが、さらに前記仕様データを前記入力パターン
として前記入出力対応表を検索し、該入力パターンに対
応する前記出力パターンとして該入出力対応表の他のエ
ントリで定義される前記入力パターンを得た場合には、
該入力パターンに基づいて前記入出力対応表を検索する
ことを特徴とする。
In a fourteenth automatic program generation device according to the present invention, in the thirteenth automatic program generation device, the meta rule further searches the input / output correspondence table using the specification data as the input pattern, and When the input pattern defined by another entry of the input / output correspondence table is obtained as the corresponding output pattern,
The input / output correspondence table is searched based on the input pattern.

【0020】本発明の第1のプログラム自動生成方法
は、入力装置から入力された仕様データを、外部記憶装
置に予め格納された前記仕様データに対する変換の仕方
にしたがって、前記プログラムに変換するメタルールを
実行するプログラム生成ステップを含むことを特徴とす
る。
According to a first automatic program generation method of the present invention, a meta-rule for converting specification data input from an input device into the program in accordance with a method of converting the specification data stored in an external storage device in advance. It is characterized by including a program generating step to be executed.

【0021】本発明の第2のプログラム自動生成方法
は、第1のプログラム生成方法において、前記プログラ
ム生成ステップが、さらに前記外部記憶装置に予め格納
された前記仕様データに対する変換の仕方によらずに、
前記仕様データを前記プログラムに変換する変換規則群
を実行することを特徴とする。
According to a second program automatic generation method of the present invention, in the first program generation method, the program generation step is performed irrespective of a method of converting the specification data stored in the external storage device in advance. ,
A conversion rule group for converting the specification data into the program is executed.

【0022】本発明の第3のプログラム自動生成方法
は、第2のプログラム自動生成方法において、前記メタ
ルールが、前記仕様データを入力パターンとして、変換
の対象である該入力パターンと変換の結果である出力パ
ターンとの対応を定義する複数のエントリを含み、各エ
ントリの前記入力パターンが前記仕様データと他のエン
トリで定義された前記出力パターンとを含み、前記出力
パターンが前記テンプレートの識別子と他のエントリで
定義される前記入力パターンとを含む入出力対応表を検
索し、該入力パターンに対応する前記出力パターンとし
てテンプレート群中の任意のテンプレートの識別子を得
た場合には、該識別子に対応するテンプレートを該テン
プレート群から読み出し、読み出したテンプレートに前
記仕様データを反映して展開することにより、前記プロ
グラムを生成することを特徴とする。
According to a third automatic program generation method of the present invention, in the second automatic program generation method, the meta rule is the input pattern to be converted and the result of the conversion using the specification data as an input pattern. A plurality of entries defining a correspondence with an output pattern, wherein the input pattern of each entry includes the specification data and the output pattern defined by another entry, and the output pattern includes an identifier of the template and another When an input / output correspondence table including the input pattern defined in the entry is searched, and an identifier of an arbitrary template in a template group is obtained as the output pattern corresponding to the input pattern, the input / output correspondence table corresponding to the identifier is obtained. Reads a template from the template group and reflects the specification data on the read template By deploying Te, and generates the program.

【0023】本発明の第4のプログラム自動生成方法
は、第3のプログラム自動生成方法において、前記メタ
ルールが、さらに前記仕様データを前記入力パターンと
して前記入出力対応表を検索し、該入力パターンに対応
する前記出力パターンとして該入出力対応表の他のエン
トリで定義される前記入力パターンを得た場合には、該
入力パターンに基づいて前記入出力対応表を検索するこ
とを特徴とする。
According to a fourth automatic program generation method of the present invention, in the third automatic program generation method, the meta rule further searches the input / output correspondence table using the specification data as the input pattern, and When the input pattern defined by another entry of the input / output correspondence table is obtained as the corresponding output pattern, the input / output correspondence table is searched based on the input pattern.

【0024】[0024]

【発明の実施の形態】次に本発明の実施の形態について
図面を参照して詳細に説明する。
Embodiments of the present invention will now be described in detail with reference to the drawings.

【0025】図1を参照すると、本発明の実施の形態
は、キーボードやポインティングデバイス等の入力装置
11と、プログラム制御により動作する処理装置12
と、ディスプレイ装置や印刷装置等の出力装置13とを
含む。
Referring to FIG. 1, an embodiment of the present invention includes an input device 11 such as a keyboard and a pointing device, and a processing device 12 which operates under program control.
And an output device 13 such as a display device or a printing device.

【0026】処理装置12は、プログラム生成部121
を備える。プログラム生成部121は、利用者が予め作
成した入出力対応表122とテンプレート123を参照
して入力仕様をプログラムに変換する。
The processing device 12 includes a program generation unit 121
Is provided. The program generation unit 121 converts the input specification into a program by referring to the input / output correspondence table 122 and the template 123 created in advance by the user.

【0027】プログラム生成部121は、変換の仕方を
定義する規則の集合として変換規則集合1211と、2
つのメタルール(表検索ルールおよびテンプレート展開
ルール)1212と、規則にしたがって実際の変換を行
うエンジン1213とを備える。
The program generation unit 121 includes a conversion rule set 1211 as a set of rules defining a conversion method, and 2
It includes two meta-rules (table search rules and template expansion rules) 1212 and an engine 1213 that performs actual conversion according to the rules.

【0028】入出力対応表122とテンプレート123
には、複数の変換パターンが定義される。メタルール
は、この入出力対応表122とテンプレート123とか
ら特定の変換パターンを抽出することにより、変換の仕
方を定義する。すなわち、メタルールは、プログラム自
動生成装置の動作を制御する。
Input / output correspondence table 122 and template 123
Defines a plurality of conversion patterns. The meta-rule defines a conversion method by extracting a specific conversion pattern from the input / output correspondence table 122 and the template 123. That is, the meta-rule controls the operation of the automatic program generation device.

【0029】変換規則集合1211は、s(X1、…、
Xn)のような仕様の列で表現される入力仕様を出力プ
ログラムへ変換する変換規則の集合である。入力仕様か
ら出力プログラムへの変換は、変換規則が次々に適用さ
れて複数のステップを踏んで変換される。
The conversion rule set 1211 is represented by s (X1,...,
Xn) is a set of conversion rules for converting an input specification represented by a sequence of specifications such as Xn) into an output program. The conversion from the input specification to the output program is performed in a plurality of steps by applying conversion rules one after another.

【0030】なお、以後の説明において、ある変換のス
テップでの変換規則適用の対象となるパターンをそのス
テップでの入力、変換規則を適用して書き換えられた後
のパターンをそのステップでの出力と呼ぶ。プログラム
生成部121によって入力される入力仕様は入力パター
ンである。この入力パターンは変換規則の条件の部分と
なり、入出力対応表122の左列に対応する。出力パタ
ーンである変換規則の動作の部分は、他の変換規則の入
力パターンとなり、入出力対応表122の右列に対応す
る。
In the following description, a pattern to be applied with a conversion rule in a certain conversion step is referred to as an input in the step, and a pattern rewritten by applying the conversion rule is referred to as an output in the step. Call. The input specification input by the program generation unit 121 is an input pattern. This input pattern becomes a condition part of the conversion rule, and corresponds to the left column of the input / output correspondence table 122. The operation part of the conversion rule that is the output pattern becomes the input pattern of another conversion rule, and corresponds to the right column of the input / output correspondence table 122.

【0031】メタルール1212は、入出力対応表12
2から入力に対応する出力を検索する表検索ルールと、
テンプレート123中の変数を入力された変数で置換す
るテンプレート展開ルールとを含む。
The meta-rule 1212 corresponds to the input / output correspondence table 12
A table search rule for searching the output corresponding to the input from 2;
And a template expansion rule for replacing variables in the template 123 with the input variables.

【0032】入出力対応表122は、入力仕様を出力プ
ログラムへ変換するための参照表である。
The input / output correspondence table 122 is a reference table for converting an input specification into an output program.

【0033】図2は、入力s(X1、…、Xn)を出力
Yに変換するための入出力対応表122を示しており、
{X1、…、Xn}の部分列{Xi_1、…、Xi_
k}(kは1以上n以下の自然数)はYを決定する。入
出力対応表122はメタルール1212の表検索ルール
により検索され、s(X1、…、Xn)がYに変換され
る。部分列は入出力対応表122を検索するためのキー
である。表検索ルールは、該キーを用いて該入出力対応
表122を検索することにより、Yを決定する。
FIG. 2 shows an input / output correspondence table 122 for converting an input s (X1,..., Xn) into an output Y.
, Xn}, a subsequence {Xi_1, ..., Xi_
k} (k is a natural number of 1 or more and n or less) determines Y. The input / output correspondence table 122 is searched by the table search rule of the meta rule 1212, and s (X1,..., Xn) is converted into Y. The subsequence is a key for searching the input / output correspondence table 122. The table search rule determines Y by searching the input / output correspondence table 122 using the key.

【0034】テンプレート123は、入力仕様を出力プ
ログラムへ変換するステップにおいて、入力値が出力値
を決定する際に、出力の一般的パターンを表すものであ
る。
The template 123 represents a general pattern of output when an input value determines an output value in a step of converting an input specification into an output program.

【0035】すなわち、入力s(X1、…、Xn)がY
に変換され、{X1、…、Xn}の部分列{Xi_1、
…、Xi_k}(kは1以上n以下の自然数)がYを決
定する。このYがu(X1、…、Xn)と表されるよう
なパターンであるとき、この一般的パターンu(X1、
…、Xn)(X1、…、Xnは変数)は、{Xi_1、
…、Xi_k}に対応するテンプレートである。u(X
1、…、Xn)は、テンプレートの一般的な形式を示
す。u(X1、…、Xn)の一例を図8に示す。このテ
ンプレートをテンプレート展開ルールにより展開するこ
とにより、s(X1、…、Xn)がYに変換される。
That is, when the input s (X1,..., Xn) is Y
And the subsequence {Xi_1, {X1,..., Xn}
.., Xi_k} (k is a natural number of 1 or more and n or less) determines Y. When Y is a pattern represented as u (X1,..., Xn), this general pattern u (X1,
.., Xn) (X1,..., Xn are variables) are {Xi_1,
.., Xi_k}. u (X
1,..., Xn) indicate the general format of the template. FIG. 8 shows an example of u (X1,..., Xn). By expanding this template according to the template expansion rules, s (X1,..., Xn) is converted to Y.

【0036】なお、ここで本発明の実施の形態の変形例
について説明する。本発明の実施の形態の変形例の特徴
は、入出力対応表122が複数の列を持つようにした点
にある。
Here, a modified example of the embodiment of the present invention will be described. A feature of the modification of the embodiment of the present invention is that the input / output correspondence table 122 has a plurality of columns.

【0037】入力仕様を出力プログラムに変換すると
き、入力仕様{Xi_1、…、Xi_k}に対応する情
報が複数あり、それぞれが別の変換ステップで用いられ
ることがある。このような場合には、入出力対応表を対
応する情報毎に別々に作成せず、複数の列を持つ1つの
表とする。
When converting an input specification into an output program, there is a plurality of pieces of information corresponding to the input specification {Xi_1,..., Xi_k}, and each of them may be used in another conversion step. In such a case, the input / output correspondence table is not created separately for each corresponding information, but is made into one table having a plurality of columns.

【0038】図3はこのような複数の列を持つ入出力対
応表を示している。ここで、入出力対応表を検索する表
検索ルールは、入力の値と表の何列目を検索するかが指
定されるとそれに対応する出力の値を特定するルールで
ある。
FIG. 3 shows an input / output correspondence table having such a plurality of columns. Here, the table search rule for searching the input / output correspondence table is a rule that specifies an input value and an output value corresponding to which column of the table to search.

【0039】次に、図1と図4を参照して本発明の実施
の形態の動作について説明する。
Next, the operation of the embodiment of the present invention will be described with reference to FIGS.

【0040】入力装置11から与えられた入力仕様は、
処理装置12に与えられる。処理装置12に入力仕様が
与えられると、処理装置12を構成するプログラム生成
部121中のエンジン1213が変換規則集合121
1、メタルール1212を参照し次々に変換を行い、プ
ログラムを生成する。以下に変換の動作を詳しく説明す
る。
The input specifications given from the input device 11 are as follows:
It is provided to the processing device 12. When an input specification is given to the processing device 12, the engine 1213 in the program generation unit 121 configuring the processing device 12
1. Conversion is performed one after another with reference to the meta-rule 1212 to generate a program. Hereinafter, the conversion operation will be described in detail.

【0041】処理装置12に入力仕様が与えられると、
入力仕様は変換の対象(入力と呼ぶ)となる。エンジン
1213は変換規則集合1211及びメタルール121
2から適用できる変換規則、すなわち入力と同じパター
ンが変換前のパターンとして記述されている変換規則が
あるか検索する(ステップ41及び42)。上述したよ
うに、プログラム生成部121によって入力された入力
仕様は、入力パターンである。この入力パターンは変換
規則の条件の部分となり、入出力対応表122の左列に
対応する。出力パターンである変換規則の動作の部分
は、他の変換規則の入力パターンとなり、入出力対応表
122の右列に対応する。適用できる変換規則がある
時、エンジン1213はその変換規則にしたがった変換
を実行する。
When the input specifications are given to the processing device 12,
The input specifications are to be converted (called input). The engine 1213 includes a conversion rule set 1211 and a meta-rule 121
A search is made to see if there is a conversion rule applicable from step 2, ie, a conversion rule in which the same pattern as the input is described as a pattern before conversion (steps 41 and 42). As described above, the input specification input by the program generation unit 121 is an input pattern. This input pattern becomes a condition part of the conversion rule, and corresponds to the left column of the input / output correspondence table 122. The operation part of the conversion rule that is the output pattern becomes the input pattern of another conversion rule, and corresponds to the right column of the input / output correspondence table 122. When there is an applicable conversion rule, engine 1213 performs the conversion according to the conversion rule.

【0042】例えば、その変換規則がテンプレート展開
ルールであれば、テンプレート中の変数は、テンプレー
トを展開する入力された変数で置換される(ステップ4
31)。その変換規則が表検索ルールであれば、入出力
対応表から入力に対応する出力の値が検索される(ステ
ップ432)。その変換規則がメタルール以外の変換規
則であれば、その入力は規則にしたがって変換される
(ステップ433)。エンジン1213により変換され
た後のパターンを出力と呼ぶ。出力は次の変換の入力と
なり、ステップ41からステップ433を繰り返す。個
々の変換規則は任意の順序、例えば出現順に適用され
る。
For example, if the conversion rule is a template expansion rule, the variables in the template are replaced with the input variables for expanding the template (step 4).
31). If the conversion rule is a table search rule, an output value corresponding to the input is searched from the input / output correspondence table (step 432). If the conversion rule is a conversion rule other than the meta-rule, the input is converted according to the rule (step 433). The pattern converted by the engine 1213 is called an output. The output becomes the input of the next conversion, and steps 41 to 433 are repeated. The individual conversion rules are applied in any order, for example, in the order of appearance.

【0043】ステップ42において、入力に対して適用
できる変換規則がなくなった時、その入力が最終的な出
力プログラムとなり変換は終了する。
In step 42, when there are no more conversion rules applicable to the input, the input becomes the final output program and the conversion ends.

【実施例】次に、本発明の実施の形態の一実施例につい
て図面を参照して詳細に説明する。
Next, an embodiment of the present invention will be described in detail with reference to the drawings.

【0044】本発明の実施例は、オブジェクト指向設計
で用いられるオブジェクト図の情報を入力してC++の
ヘッダファイルを生成するものである。
In the embodiment of the present invention, a C ++ header file is generated by inputting object diagram information used in object-oriented design.

【0045】図5は、入力となるオブジェクト図の情報
を表すテキスト表現の例である。このオブジェクト図に
含まれるクラスについて、クラス名、親クラス名、属
性、および操作の情報が含まれている。
FIG. 5 is an example of a text expression representing information of an object diagram to be input. The class name, parent class name, attributes, and operation information are included for the classes included in this object diagram.

【0046】図5を参照すると、オブジェクト図にはc
lassA、classB、classCの3つのクラ
スがあり、例えばclassAについてはObject
Aが親クラスで、属性はint型のAttr1、cha
r*型のAttr2を含み、操作には戻り値void、
引数無しのfoo1、戻り値int、引数はint型
n、char*型cであるfoo2を含んでいる。
Referring to FIG. 5, the object diagram includes c
There are three classes, classA, classB, and classC. For example, for classA, Object
A is the parent class and the attributes are int-type Attr1 and cha
It includes an Atr2 of type r *, and the operation has a return value void,
The foo1 without the argument, the return value int, and the argument include the foo2 of the int type n and the char * type c.

【0047】図6はこの入力仕様から生成からの生成が
期待されるプログラムである。classA.hをファ
イル名とするファイル61、classB.hをファイ
ル名とするファイル62、classC.hをファイル
名とするファイル63を生成することが期待されてい
る。
FIG. 6 shows a program which is expected to be generated from generation based on the input specifications. classA. h with a file name of classB. h, the file 62, classC.h. It is expected that a file 63 having a file name of h will be generated.

【0048】この入力仕様から出力プログラムへの変換
に際しては、親クラス名に対応して定まるインクルード
ファイルのインクルード宣言(61、62、63のそれ
ぞれの1行目、#includeの行)を出力すること
が必要である。
When converting the input specification into an output program, an include declaration (the first line of each of 61, 62, 63, #include line) of an include file determined according to the parent class name is output. is necessary.

【0049】しかしながら、親クラス名とファイル名の
出力の仕方には規則性がなく、またファイル名の出力の
仕方が環境に依存するなどの理由により、利用者はファ
イル名の変更を望む。したがって、この入力である親ク
ラス名と出力であるファイル名との対応関係は、変換規
則で記述するのは適当でなく、予め設定した入出力対応
表に示される。図7に、本実施例における入出力対応表
の例を示す。
However, the user wants to change the file name because the method of outputting the parent class name and the file name is not regular, and the method of outputting the file name depends on the environment. Therefore, the correspondence between the parent class name as the input and the file name as the output is not appropriate to be described by the conversion rule, and is shown in a preset input / output correspondence table. FIG. 7 shows an example of the input / output correspondence table in the present embodiment.

【0050】また何を親クラスにするかによって、出力
されるクラス宣言の構造が変わる。このクラス宣言の構
造は、図8に示すテンプレートの例により示される。ま
た、どのクラスに対してどのテンプレートを用いるのか
を図9の入出力対応表の例で示す。変換規則の集合とメ
タルールの例を図10に示す。
The structure of the output class declaration changes depending on what is the parent class. The structure of this class declaration is shown by an example of a template shown in FIG. Further, which template is used for which class is shown in the example of the input / output correspondence table in FIG. FIG. 10 shows an example of a set of conversion rules and a meta-rule.

【0051】以下に、実施例の動作を説明する。The operation of the embodiment will be described below.

【0052】図5に示される入力仕様が処理装置12に
与えられたとする。
It is assumed that the input specifications shown in FIG.

【0053】エンジン1213は変換規則集合1211
およびメタルール1212を検索する。規則1が適用で
きるので、エンジン1213は入力仕様を規則1に従っ
て書き換える。次に規則2が適用できるので、規則2に
従って書き換える。このように適用できる変換規則を次
々に適用して書き換える。
The engine 1213 has a conversion rule set 1211
And the meta rule 1212. Since Rule 1 can be applied, the engine 1213 rewrites the input specification according to Rule 1. Next, since rule 2 can be applied, rewriting is performed according to rule 2. The conversion rules applicable in this way are applied one after another and rewritten.

【0054】図11は入力仕様が書き換えられていく過
程を示す。11_1は、図10に示される変換規則集合
の適用により入力仕様が何回か書き換えられた後の状態
を示す。これを入力とすると、表検索ルール(10_2
のfind)が適用可能であるので、まず親クラス名と
それに対応するインクルードファイル名との関係を示す
入出力対応表91が検索され、classA.hにイン
クルードするファイル名“ObjectA.h”、cl
assB.hにインクルードするファイル名<Obje
ctB.h>、classC.hにインクルードするフ
ァイル名<lib/ObjectC.h>が得られる。
FIG. 11 shows the process of rewriting the input specifications. 11_1 indicates a state after the input specification has been rewritten several times by applying the conversion rule set shown in FIG. When this is input, the table search rule (10_2)
Is applicable, first, the input / output correspondence table 91 indicating the relationship between the parent class name and the corresponding include file name is searched, and classA. h include file name “ObjectA.h”, cl
assB. h include file name <Object
ctB. h>, classC. h include file name <lib / ObjectC. h> is obtained.

【0055】11_1に表検索ルール(10_2のfi
nd)を適用して書き換えた結果が11_2である。さ
らに11_2を入力とすると、表検索ルール(10_2
のfind)が適用され、親クラス名に依存して決定さ
れるクラス宣言の構造を示すテンプレートが求められ
る。11_2に表検索ルール(10_2のfind)を
適用した結果が11_3である。
The table search rule (fi of 10_2) is stored in 11_1.
The result of rewriting by applying nd) is 11_2. Further, if 11_2 is input, the table search rule (10_2)
Is applied, and a template indicating the structure of the class declaration determined depending on the parent class name is obtained. The result of applying the table search rule (find of 10_2) to 11_2 is 11_3.

【0056】11_3にはテンプレート展開ルール(1
0_2のextend)が適用可能であるので、テンプ
レートの展開を行う。11_3にテンプレート展開ルー
ル(10_2のextend)を適用した結果が11_
4である。この後、規則8の適用により、入力仕様が書
き換えられた内容がそれぞれの名前のファイルにプリン
トアウトされて、変換が全て終了し図6に示すプログラ
ムが生成される。
11_3 includes a template development rule (1
Since (extend of 0_2) is applicable, the template is expanded. The result of applying the template development rule (extend of 10_2) to 11_3 is 11_
4. Thereafter, by applying rule 8, the contents whose input specifications have been rewritten are printed out in files with the respective names, and all the conversions are completed, and the program shown in FIG. 6 is generated.

【0057】[0057]

【発明の効果】以上説明したように、本発明のプログラ
ム自動生成装置は、入力仕様と出力プログラムの関係の
情報をプログラム生成部の外に入出力対応表とテンプレ
ートとして設定し、それらの情報を参照して該入力仕様
の変換を行うメタルールを有するようにしたことによ
り、入力仕様の形式の追加や出力プログラムの形式の変
更を、変換規則を修正することなく、容易に実施するこ
とができる効果を有している。
As described above, the program automatic generation device of the present invention sets information on the relationship between input specifications and output programs as an input / output correspondence table and a template outside the program generation unit, and stores the information. By providing a meta-rule for converting the input specification by referring to it, it is possible to easily add a format of the input specification or change a format of the output program without modifying the conversion rule. have.

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

【図1】本発明の実施の形態の構成を表すブロック図で
ある。
FIG. 1 is a block diagram illustrating a configuration of an embodiment of the present invention.

【図2】本発明の実施の形態における入出力対応表の内
容を説明する図である。
FIG. 2 is a diagram illustrating contents of an input / output correspondence table according to the embodiment of the present invention.

【図3】本発明の実施の形態における入出力対応表の内
容を説明する図である。
FIG. 3 is a diagram illustrating contents of an input / output correspondence table according to the embodiment of the present invention.

【図4】本発明の実施の形態の動作を説明する流れ図で
ある。
FIG. 4 is a flowchart illustrating the operation of the exemplary embodiment of the present invention.

【図5】本発明の一実施例における入力仕様の例を示す
図である。
FIG. 5 is a diagram showing an example of an input specification in one embodiment of the present invention.

【図6】本発明の一実施例における出力プログラムの例
を示す図である。
FIG. 6 is a diagram illustrating an example of an output program according to an embodiment of the present invention.

【図7】本発明の一実施例における入出力対応表の具体
例を示す図である。
FIG. 7 is a diagram showing a specific example of an input / output correspondence table in one embodiment of the present invention.

【図8】本発明の一実施例におけるテンプレートの具体
例を示す図である。
FIG. 8 is a diagram showing a specific example of a template in one embodiment of the present invention.

【図9】本発明の一実施例における入出力対応表の具体
例を示す図である。
FIG. 9 is a diagram showing a specific example of an input / output correspondence table in one embodiment of the present invention.

【図10】本発明の一実施例における変換規則集合の具
体例を示す図である。
FIG. 10 is a diagram showing a specific example of a conversion rule set in one embodiment of the present invention.

【図11】本発明の一実施例の動作の例を示す図であ
る。
FIG. 11 is a diagram showing an example of the operation of one embodiment of the present invention.

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

11 入力装置 12 処理装置 121 プログラム生成部 1211 変換規則集合 1212 メタルール 1213 エンジン 122 入出力対応表 123 テンプレート 13 出力装置 10_1 変換規則集合 10_2 メタルール DESCRIPTION OF SYMBOLS 11 Input device 12 Processing device 121 Program generation part 1211 Conversion rule set 1212 Meta rule 1213 Engine 122 Input / output correspondence table 123 Template 13 Output device 10_1 Conversion rule set 10_2 Meta rule

フロントページの続き (56)参考文献 特開 平5−108322(JP,A) 特開 平8−278877(JP,A) 特開 平8−202544(JP,A) ”オブジェクト指向設計を支援する設 計モデルからのコード生成機能”,「情 報処理学会研究報告 96−SE−107」, 情報処理学会,1996年1月18日,pp. 49−56 ”オブジェクト指向分析/設計環境O OSPACE”,NEC技報, (1994),日本電気株式会社,Vol. 47.No.6,pp.25−29 ”オブジェクト指向開発アプローチ Crossover”,情報処理学会第 49回(平成6年後期)全国大会論文集 (5),p.5−241〜5−246 (58)調査した分野(Int.Cl.6,DB名) G06F 9/06 - 9/46 Continuation of front page (56) References JP-A-5-108322 (JP, A) JP-A-8-278877 (JP, A) JP-A-8-202544 (JP, A) "Settings to support object-oriented design""Code Generation Function from Total Model", "Information Processing Society of Japan 96-SE-107", Information Processing Society of Japan, January 18, 1996, pp. 49-56, "Object-Oriented Analysis / Design Environment O OSPAC", NEC Technical Report, (1994), NEC Corporation, Vol. No. 6, pp. 25-29 "Object-Oriented Development Approach Crossover", IPSJ 49th (Late 1994) National Convention Collection of Papers (5), p. 5-241 to 5-246 (58) Field surveyed (Int. Cl. 6 , DB name) G06F 9/06-9/46

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 変換の対象である入力パターンと変換の
結果である出力パターンとの対応を定義する複数のエン
トリからなる入出力対応表と、前記出力パターンの一部
として予め設定される複数のテンプレートとを含む参照
部と、 前記入力パターンを前記入出力対応表または前記テンプ
レートを参照することなく前記出力パターンに変換する
複数の変換規則と、前記入力パターンに対応する前記出
力パターンを前記入出力対応表から得る表検索ルール
と、前記入力パターンでパラメータを置換した前記テン
プレートを得るテンプレート展開ルールとを実行し、入
力装置から入力された仕様データをプログラムに変換す
るプログラム生成部とを備えたことを特徴とするプログ
ラム自動生成装置。
An input pattern to be converted and a conversion pattern
Multiple entries that define the correspondence with the resulting output pattern
Input / output correspondence table consisting of birds and part of the output pattern
Including multiple templates preset as
Unit and the input pattern in the input / output correspondence table or the template.
Convert to the output pattern without reference to rate
A plurality of conversion rules and the output corresponding to the input pattern.
Table search rules for obtaining force patterns from the input / output correspondence table
And the template whose parameters have been replaced with the input pattern.
Execute the template development rules to obtain the plate and enter
Converts the specification data input from the force input device into a program
And a program generation unit comprising
Automatic ram generator.
【請求項2】 前記複数の変換規則のそれぞれは、前記2. The method according to claim 2, wherein each of the plurality of conversion rules is
仕様データ、他の変換規則が変換した前記出力パターSpecification data, the output pattern converted by other conversion rules
ン、および前記表検索ルールが得た前記出力パターンのAnd the output pattern obtained by the table search rule
いずれかを入力パターンとして、前記入出力対応表またEither as an input pattern, the input / output correspondence table or
は前記テンプレートを参照することなく前記出力パターIs the output pattern without reference to the template.
ンに変換することを特徴とする請求項1記載のプログラ2. The program according to claim 1, wherein
ム自動生成装置。Automatic generation system.
【請求項3】 前記表検索ルールは、前記変換規則が変3. The table search rule according to claim 1, wherein the conversion rule is changed.
換した前記出力パターン、前記仕様データ、および当該The output pattern, the specification data, and the
表検索ルールが得た前記出力パターンのいずれかを入力Enter any of the output patterns obtained by the table search rule
パターンとして、対応する前記出力パターンを前記入出The corresponding output pattern as the pattern
力対応表から得ることを特徴とする請求項1または2に3. It is obtained from a force correspondence table.
記載のプログラム自動生成装置。Automatic program generation device according to the above.
【請求項4】 前記テンプレート展開ルールは、前記仕4. The method according to claim 1, wherein the template development rule is
様データまたは前記表検索ルールが得た前記出力パターThe output pattern obtained by the like data or the table search rule
ンを入力パターンとして、パラメータを置換した前記テThe above-mentioned text with parameters replaced with
ンプレートを得ることを特徴とする請求項1〜3のいず4. The method according to claim 1, wherein
れかに記載のプログラム自動生成装置。An automatic program generation device according to any of the preceding claims.
JP8339647A 1995-12-20 1996-12-19 Automatic program generator Expired - Fee Related JP2982725B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8339647A JP2982725B2 (en) 1995-12-20 1996-12-19 Automatic program generator

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP33128095 1995-12-20
JP7-331280 1995-12-20
JP8339647A JP2982725B2 (en) 1995-12-20 1996-12-19 Automatic program generator

Publications (2)

Publication Number Publication Date
JPH09231063A JPH09231063A (en) 1997-09-05
JP2982725B2 true JP2982725B2 (en) 1999-11-29

Family

ID=26573801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8339647A Expired - Fee Related JP2982725B2 (en) 1995-12-20 1996-12-19 Automatic program generator

Country Status (1)

Country Link
JP (1) JP2982725B2 (en)

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
"オブジェクト指向分析/設計環境OOSPACE",NEC技報,(1994),日本電気株式会社,Vol.47.No.6,pp.25−29
"オブジェクト指向設計を支援する設計モデルからのコード生成機能",「情報処理学会研究報告 96−SE−107」,情報処理学会,1996年1月18日,pp.49−56
"オブジェクト指向開発アプローチ Crossover",情報処理学会第49回(平成6年後期)全国大会論文集(5),p.5−241〜5−246

Also Published As

Publication number Publication date
JPH09231063A (en) 1997-09-05

Similar Documents

Publication Publication Date Title
US6009436A (en) Method and apparatus for mapping structured information to different structured information
US6678867B2 (en) Method and apparatus for providing a graphical user interface for creating and editing a mapping of a first structural description to a second structural description
US20020013862A1 (en) Method for data access code generation
US6678885B2 (en) System and method for common code generation
US6085196A (en) Object-oriented system and computer program product for mapping structured information to different structured information
EP1290575B1 (en) A document processing system and method
US6446075B1 (en) System and method for automatically synchronizing different classes of databases utilizing a repository database
US20010008023A1 (en) Program-interface converter for multiple-platform computer systems
WO2004086222A2 (en) Development of software systems
US20040205615A1 (en) Enhanced mechanism for automatically generating a transformation document
GB2373085A (en) Method, computer program and system for style sheet generation.
JP2004234354A (en) Method, system and program of creating structural pattern candidate
EP1644849A1 (en) System and method for generating sql using templates
Arnon Scrimshaw: A language for document queries and transformations
JP2982725B2 (en) Automatic program generator
JP3759630B2 (en) Development support system for spiral object-oriented software
JP7059757B2 (en) API processing method, terminal, API processing program
JPH07182179A (en) Object-oriented database management device
JPS62197826A (en) Production of system flow specifications
CN118259891B (en) VUE source code export method, equipment, program product and medium
WO1996008780A1 (en) Data retrieval system
Swoboda et al. Vmake and ISE general tools for the intensionalization of software systems
KR20020089067A (en) Automatic generation method of Page source code and screenpage design description based on IT system
CN117827171A (en) A method and device for generating project source code through jsonSchema file
Chen et al. A table presentation language for database applications

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: 19990824

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080924

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080924

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090924

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090924

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100924

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees