JP2000242485A - System and method for supporting programming language translation program development and recording medium - Google Patents

System and method for supporting programming language translation program development and recording medium

Info

Publication number
JP2000242485A
JP2000242485A JP11045631A JP4563199A JP2000242485A JP 2000242485 A JP2000242485 A JP 2000242485A JP 11045631 A JP11045631 A JP 11045631A JP 4563199 A JP4563199 A JP 4563199A JP 2000242485 A JP2000242485 A JP 2000242485A
Authority
JP
Japan
Prior art keywords
abstract syntax
syntax tree
program
programming language
stored
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
JP11045631A
Other languages
Japanese (ja)
Inventor
Yoshiyuki Beppu
祥之 別府
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 JP11045631A priority Critical patent/JP2000242485A/en
Publication of JP2000242485A publication Critical patent/JP2000242485A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To develop a programming language translation program to use an abstract syntax tree as the intermediate result with a little man-hour. SOLUTION: A user prepares an abstract syntax tree specification definition file 30, which describes the use of the abstract syntax tree stored in an abstract syntax tree storage part 220 as the analyzed result of a high-order language input file 10, and inputs it to a programming language translation program development supporting device 100. The programming language translation program development supporting device 100 analyzes the abstract syntax tree specification definition file 30 and prepares an abstract syntax tree damp program file 40, an abstract syntax tree access program file 50 and an abstract syntax tree scan program file 60 on the basis of this analyzed result. An action 61 for type check and an action 64 for code generation are respectively added to the abstract syntax tree scan program file 60 and a type check program file 63 and a code generation program file 66 are generated.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、プログラミング言
語変換プログラム開発支援システム、方法及びこの方法
を実行するプログラムを記録した記録媒体に関し、特に
中間結果として抽象構文木を使用するプログラミング言
語変換プログラムの開発を支援するものに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programming language conversion program development support system and method, and a recording medium on which a program for executing the method is recorded. For those who support.

【0002】[0002]

【従来の技術】プログラミング言語(プログラム言語)
変換装置は、あるプログラミング言語(高級言語)で記
述されたプログラムを読み込み、これを他のプログラミ
ング言語(高級言語、アセンブラ言語または機械語)で
記述されたプログラムに変換して出力するものである。
2. Description of the Related Art Programming languages (program languages)
The conversion device reads a program described in a certain programming language (high-level language), converts the program into a program described in another programming language (high-level language, assembler language or machine language), and outputs the program.

【0003】図23は、従来のプログラミング言語変換
装置の構成を示すブロック図である。図示するように、
このプログラミング言語変換装置500は、入力プログ
ラミングファイル310を読み込み、これとは異なる言
語で記述された出力プログラムファイル320を出力す
るもので、構文解析手段510と、抽象構文木記憶手段
520と、抽象構文木アクセス手段530と、型検査手
段540と、コード生成手段550とから構成されてい
る。ここで、抽象構文木アクセス手段530は、抽象構
文木記憶部520に記憶された抽象構文木を参照するた
めの方法を提供している。
FIG. 23 is a block diagram showing a configuration of a conventional programming language converter. As shown
The programming language conversion device 500 reads an input programming file 310 and outputs an output program file 320 described in a language different from the input programming file 310. The syntax analysis unit 510, the abstract syntax tree storage unit 520, and the abstract syntax It comprises a tree access means 530, a type check means 540, and a code generation means 550. Here, the abstract syntax tree access unit 530 provides a method for referring to the abstract syntax tree stored in the abstract syntax tree storage unit 520.

【0004】上記のプログラミング言語変換装置500
では、まず、構文解析手段510が入力プログラミング
ファイル310を読み込んで構文解析し、その結果を抽
象構文木として抽象構文木記憶部520に記憶させる。
次に、型検査手段540は、抽象構文木アクセス手段5
30を参照しながら、抽象構文木記憶部520に記憶さ
れている抽象構文木が有する型を検査する。そして、検
査した型情報に従って、コード生成手段550は、抽象
構文木アクセス手段530を参照しながら、コード生成
して出力プログラムファイル320を出力する。
The above-mentioned programming language converter 500
First, the syntax analysis unit 510 reads the input programming file 310 and performs syntax analysis, and stores the result in the abstract syntax tree storage unit 520 as an abstract syntax tree.
Next, the type checking means 540
While referring to 30, the type of the abstract syntax tree stored in the abstract syntax tree storage unit 520 is checked. Then, according to the inspected type information, the code generation unit 550 generates a code while referring to the abstract syntax tree access unit 530, and outputs the output program file 320.

【0005】なお、図23のプログラミング言語変換装
置500において、抽象構文木アクセス手段530、型
検査手段540及びコード生成手段550は、いずれも
プログラム制御により動作するデータ処理装置によって
構成され、それぞれ抽象構文木アクセスプログラム、型
検査プログラム及びコード生成プログラムを実行するこ
とによって実現される。
In the programming language converter 500 shown in FIG. 23, the abstract syntax tree access means 530, the type checking means 540, and the code generation means 550 are all constituted by data processing devices which operate under program control. This is realized by executing a tree access program, a type check program, and a code generation program.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、上記従
来例のプログラミング言語変換装置では、抽象構文木ア
クセス手段530は、抽象構文木を参照するためのすべ
ての関数の内容を実装していなければならないため、こ
れを実現するための抽象構文木アクセスプログラムの開
発するための工数が大きくなるという問題点があった。
However, in the above-described prior art programming language conversion apparatus, the abstract syntax tree access means 530 must implement all the contents of functions for referring to the abstract syntax tree. However, there is a problem that the man-hour for developing an abstract syntax tree access program for realizing this is increased.

【0007】また、型検査手段540やコード生成手段
550は、抽象構文木をたどりながら型検査或いはコー
ド生成を行う必要がある。が、これらの手段を実現する
型検査プログラムやコード生成プログラムでは、抽象構
文木をたどる部分の記述が大きくなり、この部分を開発
することが困難であるという問題点があった。
The type checking means 540 and the code generating means 550 need to perform type checking or code generation while following the abstract syntax tree. However, in a type checking program or a code generation program that realizes these means, there is a problem that the description of a portion that follows an abstract syntax tree becomes large, and it is difficult to develop this portion.

【0008】さらに、構文解析手段510による解析結
果である抽象構文木は、抽象構文木記憶部520に内部
的に一時記憶されるだけであり、構文解析手段510の
作成者が読むことができなかった。このため、構文解析
手段510によって抽象構文木が意図したとおりに作成
されているかどうかを、構文解析手段510の作成者が
確認できないという問題点があった。
Furthermore, the abstract syntax tree, which is the result of analysis by the syntax analysis unit 510, is only temporarily stored internally in the abstract syntax tree storage unit 520, and cannot be read by the creator of the syntax analysis unit 510. Was. Therefore, there is a problem that the creator of the syntax analysis unit 510 cannot confirm whether the abstract syntax tree is created as intended by the syntax analysis unit 510.

【0009】本発明の目的は、中間結果として抽象構文
木を使用するプログラミング言語変換プログラムを少な
い工数で開発することができるプログラミング言語変換
プログラム開発支援システム、方法及びこの方法を実行
するプログラムを記録した記録媒体を提供することにあ
る。
An object of the present invention is to record a programming language conversion program development support system and method capable of developing a programming language conversion program using an abstract syntax tree as an intermediate result with a small number of steps, and a program for executing the method. It is to provide a recording medium.

【0010】本発明の他の目的は、プログラミング言語
の変換のための一工程として使用するための抽象構文木
アクセスプログラムを機能拡張したプログラムを開発す
ることができるプログラミング言語変換プログラム開発
支援システム、方法及びこの方法を実行するプログラム
を記録した記録媒体を提供することにある。
Another object of the present invention is to provide a programming language conversion program development support system and method capable of developing a program obtained by extending the function of an abstract syntax tree access program to be used as one step for converting a programming language. And a recording medium on which a program for executing the method is recorded.

【0011】本発明のさらに他の目的は、中間結果、す
なわち変換前のプログラムの解析結果である抽象構文木
の状態を外部で確認できるようにしたプログラミング言
語変換プログラム開発支援システム、方法及びこの方法
を実行するプログラムを記録した記録媒体を提供するこ
とにある。
Still another object of the present invention is to provide a system and method for supporting the development of a programming language conversion program capable of externally confirming an intermediate result, that is, a state of an abstract syntax tree which is an analysis result of a program before conversion. To provide a recording medium recording a program for executing the program.

【0012】[0012]

【課題を解決するための手段】上記目的を達成するた
め、本発明の第1の観点にかかるプログラミング言語変
換プログラム開発支援システムは、中間結果として記憶
される抽象構文木を使用して、第1のプログラミング言
語で記述されたプログラムを第2のプログラミング言語
で記述されたプログラムに変換するためのプログラミン
グ言語変換プログラムの開発を支援するためのシステム
であって、前記抽象構文木の仕様を入力し、該入力した
抽象構文木仕様を解析する抽象構文木仕様解析手段と、
前記抽象構文木仕様解析手段の解析結果を記憶する抽象
構文木仕様記憶手段と、前記抽象構文木仕様記憶手段に
記憶した前記抽象構文木仕様の解析結果に基づいて、前
記第2のプログラミング言語へ変換するときに前記記憶
された抽象構文木を参照するための方法を記述したプロ
グラムを生成する抽象構文木アクセスプログラム生成手
段と、前記抽象構文木仕様記憶手段に記憶した前記抽象
構文木仕様の解析結果に基づいて、前記第2のプログラ
ミング言語へ変換するときに前記記憶された抽象構文木
をたどるための方法を記述したプログラムを生成する抽
象構文木走査プログラム生成手段と、を備えることを特
徴とする。
In order to achieve the above object, a programming language conversion program development support system according to a first aspect of the present invention uses an abstract syntax tree stored as an intermediate result to execute a first conversion. A system for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising: Abstract syntax tree specification analysis means for analyzing the input abstract syntax tree specification;
An abstract syntax tree specification storage unit for storing an analysis result of the abstract syntax tree specification analysis unit; and a second programming language based on the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage unit. An abstract syntax tree access program generating means for generating a program describing a method for referring to the stored abstract syntax tree at the time of conversion, and analyzing the abstract syntax tree specification stored in the abstract syntax tree specification storage means Abstract syntax tree scanning program generating means for generating a program describing a method for following the stored abstract syntax tree when converting to the second programming language based on a result. I do.

【0013】上記プログラミング言語変換プログラム開
発支援システムは、前記抽象構文木走査プログラム生成
手段が生成したプログラムに、該プログラムの実行によ
り前記抽象構文木をたどったときに情報を収集して、該
収集した情報に基づいて前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査する部分を記述
した型検査アクションを付加することによって、前記抽
象構文木アクセスプログラム生成手段が生成したプログ
ラムを参照しながら前記中間結果として記憶された抽象
構文木がもつ型に関する情報を検査するためのプログラ
ムを生成する型検査プログラム生成手段と、前記抽象構
文木走査プログラム生成手段が生成したプログラムに、
該プログラムの実行により前記抽象構文木をたどったと
きに情報を収集して、該収集した情報に基づいて前記中
間結果として記憶された抽象構文木から前記第2のプロ
グラミング言語によるコード情報を生成する部分を記述
したコード生成アクションを付加することによって、前
記抽象構文木アクセスプログラム生成手段が生成したプ
ログラムを参照しながら前記中間結果として記憶された
抽象構文木から前記第2のプログラミング言語によるコ
ード情報を生成するためのプログラムを生成するコード
生成プログラム生成手段とをさらに備えるものとするこ
とができる。
The above-mentioned programming language conversion program development support system collects information in the program generated by the abstract syntax tree scanning program generation means when the abstract syntax tree is traced by executing the program. By adding a type checking action describing a part for checking information on a type of the abstract syntax tree stored as the intermediate result based on information, the program generated by the abstract syntax tree access program generating means is referred to. A type checking program generating means for generating a program for checking information on the type of the abstract syntax tree stored as the intermediate result, and a program generated by the abstract syntax tree scanning program generating means.
Information is collected when the abstract syntax tree is traced by executing the program, and code information in the second programming language is generated from the abstract syntax tree stored as the intermediate result based on the collected information. By adding a code generation action describing a part, the code information in the second programming language is extracted from the abstract syntax tree stored as the intermediate result while referring to the program generated by the abstract syntax tree access program generating means. Code generation program generation means for generating a program for generation may be further provided.

【0014】上記プログラミング言語変換プログラム開
発支援システムでは、プログラミング言語の変換時に中
間結果として使用される抽象構文木の仕様を入力すれ
ば、抽象構文木を参照するための方法を記述したプログ
ラムと抽象構文木をたどるための方法を記述したプログ
ラムとが生成される。さらに、この抽象構文木をたどる
ための方法を記述したプログラムに型検査アクションと
コード生成アクションとをそれぞれ付加することによっ
て、抽象構文木がもつ型に関する情報を検査するための
プログラムと抽象構文木から前記第2のプログラミング
言語によるコード情報を生成するためのプログラムとが
生成される。
In the programming language conversion program development support system, when a specification of an abstract syntax tree used as an intermediate result at the time of conversion of a programming language is input, a program describing a method for referring to the abstract syntax tree and an abstract syntax tree And a program describing a method for following the tree. Furthermore, by adding a type checking action and a code generation action to a program describing a method for tracing the abstract syntax tree, a program for checking information about the type of the abstract syntax tree and the abstract syntax tree are added. And a program for generating code information in the second programming language.

【0015】ここで、第1のプログラミング言語で記述
されたプログラムに対して抽象構文木が作成されて記憶
されていれば、生成されたプログラムを実行することに
より、第1のプログラミング言語から第2のプログラミ
ング言語への変換を行うことができる。このように、上
記プログラミング言語変換プログラム開発支援システム
を仕様すれば、抽象構文木仕様と型検査アクションとコ
ード生成アクションとを作成するだけで、プログラミン
グ言語を変換するためのプログラムを開発できるので、
このようなプログラムの開発に要する工数を少なくする
ことができる。
Here, if an abstract syntax tree is created and stored for a program described in the first programming language, the generated program is executed to execute the second syntax from the first programming language. Can be converted to a programming language. Thus, if the above-mentioned programming language conversion program development support system is specified, a program for converting a programming language can be developed only by creating an abstract syntax tree specification, a type checking action, and a code generation action.
The man-hour required for developing such a program can be reduced.

【0016】上記プログラミング言語変換プログラム開
発支援システムは、また、前記抽象構文木アクセスプロ
グラム生成手段により生成されるプログラムに対してユ
ーザが定義したプログラムを入力し、該入力したユーザ
が定義したプログラムを解析して、その解析結果を前記
抽象構文木仕様記憶手段に記憶させるユーザ定義プログ
ラム検出手段をさらに備えるものとしてもよい。
The above-mentioned programming language conversion program development support system also inputs a user-defined program to a program generated by the abstract syntax tree access program generation means, and analyzes the input user-defined program. Then, a user-defined program detecting means for storing the analysis result in the abstract syntax tree specification storing means may be further provided.

【0017】この場合、抽象構文木を参照するための方
法を記述したプログラムは、ユーザが定義したプログラ
ムにも従って作成されることとなるので、前記抽象構文
木アクセスプログラム生成手段により生成されるプログ
ラムに対してユーザが定義したプログラムを入力するこ
とによって、抽象構文木を参照するための方法を記述し
たプログラムの機能を拡張することが可能となる。
In this case, since the program describing the method for referring to the abstract syntax tree is created in accordance with the program defined by the user, the program generated by the abstract syntax tree access program generating means is generated. By inputting a program defined by the user to, the function of a program describing a method for referring to an abstract syntax tree can be extended.

【0018】上記プログラミング言語変換プログラム開
発支援システムは、また、前記抽象構文木仕様記憶手段
に記憶した前記抽象構文木仕様の解析結果に基づいて、
プログラミング言語の変換時に中間結果として記憶され
た抽象構文木の状態をダンプするための方法を記述した
プログラムを生成する抽象構文木ダンププログラム生成
手段をさらに備えるものとしてもよい。
The above-mentioned programming language conversion program development support system may further include a step of analyzing the abstract syntax tree specification stored in the abstract syntax tree specification storage means.
An abstract syntax tree dump program generating means for generating a program describing a method for dumping a state of an abstract syntax tree stored as an intermediate result at the time of conversion of a programming language may be further provided.

【0019】この場合、プログラミング言語の変換時に
中間結果として記憶される抽象構文木の状態を、外部か
ら確認できるようになる。これにより、プログラミング
言語の変換時に、第1のプログラミング言語で記述され
たプログラムに対して期待した通りの抽象構文木が作成
されているかどうかを、確認することができるようにな
る。
In this case, the state of the abstract syntax tree stored as an intermediate result at the time of conversion of the programming language can be externally confirmed. Thus, at the time of conversion of the programming language, it is possible to confirm whether or not the expected abstract syntax tree has been created for the program described in the first programming language.

【0020】なお、上記プログラミング言語変換プログ
ラム開発支援システムは、前記抽象構文木仕様記憶手段
に記憶した前記抽象構文木仕様の解析結果に矛盾がない
かどうかを検査する意味検査手段をさらに備えていても
よい。
The above-mentioned programming language conversion program development support system further comprises a semantic checking means for checking whether there is any inconsistency in the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage means. Is also good.

【0021】上記プログラミング言語変換プログラム開
発支援システムにおいて、前記抽象構文木アクセスプロ
グラム生成手段により生成されるプログラムと前記抽象
構文木走査プログラム生成手段により生成されるプログ
ラムとは、例えば、オブジェクト指向プログラミング言
語により記述されたものとすることができる。この場
合、前記抽象構文木仕様解析手段は、前記抽象構文木仕
様に含まれるクラス名と、該クラス名に対応するクラス
タイプと、該クラス名に対応するクラスに関する情報と
を認識して抽出するものとすることができ、前記抽象構
文木仕様記憶手段は、前記抽象構文木仕様解析手段によ
って抽出されたクラス名と、クラスタイプと、クラスに
関する情報とを、それぞれ表の各行に対応付けて記憶す
るものとすることができる。
In the programming language conversion program development support system, the program generated by the abstract syntax tree access program generating means and the program generated by the abstract syntax tree scanning program generating means may be, for example, an object-oriented programming language. It can be as described. In this case, the abstract syntax tree specification analysis means recognizes and extracts a class name included in the abstract syntax tree specification, a class type corresponding to the class name, and information on a class corresponding to the class name. The abstract syntax tree specification storage means stores the class name, class type, and class information extracted by the abstract syntax tree specification analysis means in association with each row of the table. You can do it.

【0022】ここで、前記抽象構文木アクセスプログラ
ム生成手段は、前記抽象構文木仕様記憶手段の表の各行
のそれぞれに対して、プログラムファイルを生成するも
のとすることができる。
Here, the abstract syntax tree access program generation means may generate a program file for each row of the table of the abstract syntax tree specification storage means.

【0023】上記目的を達成するため、本発明の第2の
観点にかかるプログラミング言語変換プログラム開発支
援システムは、中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するためのシステムであって、前記抽象
構文木の仕様を入力し、該入力した抽象構文木仕様を解
析する抽象構文木仕様解析手段と、前記抽象構文木仕様
解析手段の解析結果を記憶する抽象構文木仕様記憶手段
と、前記抽象構文木仕様記憶手段に記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
参照するための方法を記述したプログラムを生成する抽
象構文木アクセスプログラム生成手段とを備えることを
特徴とする。
In order to achieve the above object, a programming language conversion program development support system according to a second aspect of the present invention is described in a first programming language using an abstract syntax tree stored as an intermediate result. A system for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising: inputting the specification of the abstract syntax tree; Abstract syntax tree specification analysis means for analyzing specifications, abstract syntax tree specification storage means for storing analysis results of the abstract syntax tree specification analysis means, and analysis of the abstract syntax tree specification stored in the abstract syntax tree specification storage means A method for referencing the stored abstract syntax tree when converting to the second programming language based on a result. Characterized in that it comprises a abstract syntax tree access program generating means for generating a program describing.

【0024】上記目的を達成するため、本発明の第3の
観点にかかるプログラミング言語変換プログラム開発支
援システムは、中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するためのシステムであって、前記抽象
構文木の仕様を入力し、該入力した抽象構文木仕様を解
析する抽象構文木仕様解析手段と、前記抽象構文木仕様
解析手段の解析結果を記憶する抽象構文木仕様記憶手段
と、前記抽象構文木仕様記憶手段に記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
たどるための方法を記述したプログラムを生成する抽象
構文木走査プログラム生成手段とを備えることを特徴と
する。
To achieve the above object, a programming language conversion program development support system according to a third aspect of the present invention is described in a first programming language using an abstract syntax tree stored as an intermediate result. A system for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising: inputting the specification of the abstract syntax tree; Abstract syntax tree specification analysis means for analyzing specifications, abstract syntax tree specification storage means for storing analysis results of the abstract syntax tree specification analysis means, and analysis of the abstract syntax tree specification stored in the abstract syntax tree specification storage means Method for tracing the stored abstract syntax tree when translating to the second programming language based on a result Characterized in that it comprises a abstract syntax tree scanning program generation means for generating a described program.

【0025】上記第3の観点にかかるプログラミング言
語変換プログラム開発支援システムは、前記抽象構文木
走査プログラム生成手段が生成したプログラムに、該プ
ログラムの実行により前記抽象構文木をたどったときに
情報を収集して、該収集した情報に基づいて前記中間結
果として記憶された抽象構文木がもつ型に関する情報を
検査する部分を記述した型検査アクションを付加するこ
とによって、前記抽象構文木アクセスプログラム生成手
段が生成したプログラムを参照しながら前記中間結果と
して記憶された抽象構文木がもつ型に関する情報を検査
するためのプログラムを生成する型検査プログラム生成
手段をさらに備えるものとすることができる。
The programming language conversion program development support system according to the third aspect collects information in the program generated by the abstract syntax tree scanning program generation means when the abstract syntax tree is traced by executing the program. Then, based on the collected information, a type checking action describing a part for checking information on a type of the abstract syntax tree stored as the intermediate result is added, whereby the abstract syntax tree access program generating means The information processing apparatus may further include a type checking program generating means for generating a program for checking information on a type of the abstract syntax tree stored as the intermediate result while referring to the generated program.

【0026】上記第3の観点にかかるプログラミング言
語変換プログラム開発支援システムは、また、前記抽象
構文木走査プログラム生成手段が生成したプログラム
に、該プログラムの実行により前記抽象構文木をたどっ
たときに情報を収集して、該収集した情報に基づいて前
記中間結果として記憶された抽象構文木から前記第2の
プログラミング言語によるコード情報を生成する部分を
記述したコード生成アクションを付加することによっ
て、前記抽象構文木アクセスプログラム生成手段が生成
したプログラムを参照しながら前記中間結果として記憶
された抽象構文木から前記第2のプログラミング言語に
よるコード情報を生成するためのプログラムを生成する
コード生成プログラム生成手段とをさらに備えるものと
することもできる。
[0026] The programming language conversion program development support system according to the third aspect further comprises a program generated by the abstract syntax tree scanning program generating means, the information generated when the abstract syntax tree is traced by executing the program. By adding a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information. Code generation program generation means for generating a program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result while referring to the program generated by the syntax tree access program generation means. Further, it may be provided.

【0027】上記第2、第3の観点にかかるプログラミ
ング言語変換プログラム開発支援システムでは、プログ
ラミング言語を変換するために必要となるプログラムの
一部が自動生成されることとなる。このような場合であ
っても、プログラミング言語を変換するためのプログラ
ムの開発に要する工数を、従来よりも少なくすることが
可能となる。
In the programming language conversion program development support system according to the second and third aspects, a part of a program necessary for converting a programming language is automatically generated. Even in such a case, the number of steps required for developing a program for converting a programming language can be reduced as compared with the related art.

【0028】上記目的を達成するため、本発明の第4の
観点にかかるプログラミング言語変換プログラム開発支
援方法は、中間結果として記憶される抽象構文木を使用
して、第1のプログラミング言語で記述されたプログラ
ムを第2のプログラミング言語で記述されたプログラム
に変換するためのプログラミング言語変換プログラムの
開発を支援するための方法であって、前記抽象構文木の
仕様を入力し、該入力した抽象構文木仕様を解析する抽
象構文木仕様解析ステップと、前記抽象構文木仕様解析
ステップでの解析結果を記憶する抽象構文木仕様記憶ス
テップと、前記抽象構文木仕様記憶ステップで記憶した
前記抽象構文木仕様の解析結果に基づいて、前記第2の
プログラミング言語へ変換するときに前記記憶された抽
象構文木を参照するための方法を記述したプログラムを
生成する抽象構文木アクセスプログラム生成ステップ
と、前記抽象構文木仕様記憶ステップで記憶した前記抽
象構文木仕様の解析結果に基づいて、前記第2のプログ
ラミング言語へ変換するときに前記記憶された抽象構文
木をたどるための方法を記述したプログラムを生成する
抽象構文木走査プログラム生成ステップとを含むことを
特徴とする。
To achieve the above object, a programming language conversion program development supporting method according to a fourth aspect of the present invention is described in a first programming language using an abstract syntax tree stored as an intermediate result. A method for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising: inputting the specification of the abstract syntax tree; An abstract syntax tree specification analyzing step for analyzing a specification, an abstract syntax tree specification storing step for storing an analysis result in the abstract syntax tree specification analyzing step, and an abstract syntax tree specification storing step for storing the abstract syntax tree specification stored in the abstract syntax tree specification storing step. When converting to the second programming language based on the analysis result, the stored abstract syntax tree is referred to. An abstract syntax tree access program generating step of generating a program describing a method for performing the method, and converting the program into the second programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storing step. And generating a program describing a method for tracing the stored abstract syntax tree.

【0029】上記プログラミング言語変換プログラム開
発支援方法は、前記抽象構文木走査プログラム生成ステ
ップで生成したプログラムに、該プログラムの実行によ
り前記抽象構文木をたどったときに情報を収集して、該
収集した情報に基づいて前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査する部分を記述
した型検査アクションを付加することによって、前記抽
象構文木アクセスプログラム生成ステップで生成したプ
ログラムを参照しながら前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査するためのプロ
グラムを生成する型検査プログラム生成ステップと、前
記抽象構文木走査プログラム生成ステップで生成したプ
ログラムに、該プログラムの実行により前記抽象構文木
をたどったときに情報を収集して、該収集した情報に基
づいて前記中間結果として記憶された抽象構文木から前
記第2のプログラミング言語によるコード情報を生成す
る部分を記述したコード生成アクションを付加すること
によって、前記抽象構文木アクセスプログラム生成ステ
ップで生成したプログラムを参照しながら前記中間結果
として記憶された抽象構文木から前記第2のプログラミ
ング言語によるコード情報を生成するためのプログラム
を生成するコード生成プログラム生成ステップとをさら
に含んでいてもよい。
The above-mentioned method for supporting development of a programming language conversion program collects information on the program generated in the step of generating an abstract syntax tree scanning program when the abstract syntax tree is traced by executing the program. By adding a type check action describing a part for checking information on a type of the abstract syntax tree stored as the intermediate result based on the information, the program generated in the abstract syntax tree access program generating step is referred to. A type check program generating step for generating a program for checking information on the type of the abstract syntax tree stored as the intermediate result, and executing the program in the program generated in the abstract syntax tree scanning program generating step. Tracing the abstract syntax tree Collecting information and adding a code generation action describing a portion for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information, A code generation program generation step of generating a program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result while referring to the program generated in the abstract syntax tree access program generation step; May be further included.

【0030】上記プログラミング言語変換プログラム開
発支援方法は、また、前記抽象構文木アクセスプログラ
ム生成ステップで生成されるプログラムに対してユーザ
が定義したプログラムを入力し、該入力したユーザが定
義したプログラムを解析して、その解析結果を前記抽象
構文木仕様記憶ステップで記憶した抽象構文木仕様と対
応させて記憶させるユーザ定義プログラム検出ステップ
をさらに含んでいてもよい。
The above-mentioned programming language conversion program development support method further comprises the steps of: inputting a user-defined program to the program generated in the abstract syntax tree access program generating step; and analyzing the input user-defined program. The method may further include a user-defined program detecting step of storing the analysis result in association with the abstract syntax tree specification stored in the abstract syntax tree specification storing step.

【0031】上記プログラミング言語変換プログラム開
発支援方法は、また、前記抽象構文木仕様記憶ステップ
で記憶した前記抽象構文木仕様の解析結果に基づいて、
プログラミング言語の変換時に中間結果として記憶され
た抽象構文木の状態をダンプするための方法を記述した
プログラムを生成する抽象構文木ダンププログラム生成
ステップをさらに含んでいてもよい。
The above-mentioned method for supporting the development of a programming language conversion program may further comprise the step of analyzing the abstract syntax tree specification stored in the step of storing the abstract syntax tree specification.
The method may further include a step of generating an abstract syntax tree dump program for generating a program describing a method for dumping a state of the abstract syntax tree stored as an intermediate result when converting the programming language.

【0032】上記目的を達成するため、本発明の第5の
観点にかかるプログラミング言語変換プログラム開発支
援方法は、中間結果として記憶される抽象構文木を使用
して、第1のプログラミング言語で記述されたプログラ
ムを第2のプログラミング言語で記述されたプログラム
に変換するためのプログラミング言語変換プログラムの
開発を支援するための方法であって、前記抽象構文木の
仕様を定義した抽象構文木仕様定義ファイルを作成する
ステップと、前記抽象構文木仕様定義ファイルを読み込
んで、これを解析するステップと、前記抽象構文木仕様
定義ファイルの解析結果を記憶するステップと、記憶し
た前記抽象構文木仕様定義ファイルの解析結果に基づい
て、プログラミング言語の変換時に前記抽象構文木を参
照するための方法を記述した抽象構文木アクセスプログ
ラムを生成するステップと、記憶した前記抽象構文木仕
様定義ファイルの解析結果に基づいて、プログラミング
言語の変換時に前記抽象構文木をたどるための方法を記
述した抽象構文木走査プログラムを生成するステップ
と、記憶した前記抽象構文木仕様定義ファイルの解析結
果に基づいて、プログラミング言語の変換時に中間結果
として記憶された抽象構文木の状態をダンプするための
抽象構文木ダンププログラムを生成するステップと、生
成された抽象構文木ダンププログラムの実行により、前
記中間結果として記憶された抽象構文木の状態をダンプ
して、前記抽象構文木が適切に作成されているかどうか
を確認するステップと、生成された前記抽象構文木走査
プログラムに、前記抽象構文木走査プログラムの実行に
より前記抽象構文木をたどったときに情報を収集して、
該収集した情報に基づいて前記中間結果として記憶され
た抽象構文木がもつ型に関する情報を検査する部分を記
述した型検査アクションを付加することによって、生成
された前記抽象構文木アクセスプログラムを参照しなが
ら前記中間結果として記憶された抽象構文木がもつ型に
関する情報を検査するための型検査プログラムを生成す
るステップと、生成された前記抽象構文木走査プログラ
ムに、前記抽象構文木走査プログラムの実行により前記
抽象構文木をたどったときに情報を収集して、該収集し
た情報に基づいて前記中間結果として記憶された抽象構
文木から前記第2のプログラミング言語によるコード情
報を生成する部分を記述したコード生成アクションを付
加することによって、生成された前記抽象構文木アクセ
スプログラムを参照しながら前記中間結果として記憶さ
れた抽象構文木から前記第2のプログラミング言語によ
るコード情報を生成するためのコード生成プログラムを
生成するステップとを含むことを特徴とする。
To achieve the above object, a programming language conversion program development support method according to a fifth aspect of the present invention is described in a first programming language using an abstract syntax tree stored as an intermediate result. A method for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising the steps of: Creating, reading and analyzing the abstract syntax tree specification definition file, storing an analysis result of the abstract syntax tree specification definition file, and analyzing the stored abstract syntax tree specification definition file Method for referencing the abstract syntax tree during translation of a programming language based on a result Generating the described abstract syntax tree access program, and scanning the abstract syntax tree describing a method for tracing the abstract syntax tree at the time of programming language conversion based on the analysis result of the stored abstract syntax tree specification definition file Generating an abstract syntax tree dump program for dumping the state of the abstract syntax tree stored as an intermediate result during the conversion of the programming language based on the analysis result of the stored abstract syntax tree specification definition file, Generating and dumping a state of the abstract syntax tree stored as the intermediate result by executing the generated abstract syntax tree dump program to check whether the abstract syntax tree is properly created And the generated abstract syntax tree scanning program. To collect information on when traversing the abstract syntax tree by the execution of a gram,
By referring to the generated abstract syntax tree access program by adding a type checking action describing a portion for checking information on a type of the abstract syntax tree stored as the intermediate result based on the collected information. Generating a type checking program for checking information on a type of the abstract syntax tree stored as the intermediate result while executing the abstract syntax tree scanning program on the generated abstract syntax tree scanning program. A code that collects information when tracing the abstract syntax tree and that generates a code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information By adding a generation action, the generated abstract syntax tree access program is referred to. Characterized in that it comprises a step of generating said intermediate result as a code generator for generating code information by said second programming language from the stored abstract syntax tree with.

【0033】上記目的を達成するため、本発明の第6の
観点にかかるプログラミング言語変換プログラム開発支
援方法は、中間結果として記憶される抽象構文木を使用
して、第1のプログラミング言語で記述されたプログラ
ムを第2のプログラミング言語で記述されたプログラム
に変換するためのプログラミング言語変換プログラムの
開発を支援するための方法であって、前記抽象構文木の
仕様を定義した抽象構文木仕様定義ファイルを作成する
ステップと、前記第1のプログラミング言語に対してユ
ーザが定義したプログラムの文法を記述したユーザ付加
プログラムファイルを作成するステップと、前記抽象構
文木仕様定義ファイルを読み込んで、これを解析するス
テップと、前記抽象構文木仕様定義ファイルの解析結果
を記憶するステップと、前記ユーザ付加プログラムファ
イルを参照しながら、記憶した前記抽象構文木仕様定義
ファイルの解析結果に基づいて、プログラミング言語の
変換時に前記抽象構文木を参照するための方法を記述し
た抽象構文木アクセスプログラムを生成するステップ
と、記憶した前記抽象構文木仕様定義ファイルの解析結
果に基づいて、プログラミング言語の変換時に前記抽象
構文木をたどるための方法を記述した抽象構文木走査プ
ログラムを生成するステップと、記憶した前記抽象構文
木仕様定義ファイルの解析結果に基づいて、プログラミ
ング言語の変換時に中間結果として記憶された抽象構文
木の状態をダンプするための抽象構文木ダンププログラ
ムを生成するステップと、生成された抽象構文木ダンプ
プログラムの実行により、前記中間結果として記憶され
た抽象構文木の状態をダンプして、前記抽象構文木が適
切に作成されているかどうかを確認するステップと、生
成された前記抽象構文木走査プログラムに、前記抽象構
文木走査プログラムの実行により前記抽象構文木をたど
ったときに情報を収集して、該収集した情報に基づいて
前記中間結果として記憶された抽象構文木がもつ型に関
する情報を検査する部分を記述した型検査アクションを
付加することによって、生成された前記抽象構文木アク
セスプログラムを参照しながら前記中間結果として記憶
された抽象構文木がもつ型に関する情報を検査するため
の型検査プログラムを生成するステップと、生成された
前記抽象構文木走査プログラムに、前記抽象構文木走査
プログラムの実行により前記抽象構文木をたどったとき
に情報を収集して、該収集した情報に基づいて前記中間
結果として記憶された抽象構文木から前記第2のプログ
ラミング言語によるコード情報を生成する部分を記述し
たコード生成アクションを付加することによって、生成
された前記抽象構文木アクセスプログラムを参照しなが
ら前記中間結果として記憶された抽象構文木から前記第
2のプログラミング言語によるコード情報を生成するた
めのコード生成プログラムを生成するステップとを含む
ことを特徴とする。
To achieve the above object, a programming language conversion program development supporting method according to a sixth aspect of the present invention is described in a first programming language using an abstract syntax tree stored as an intermediate result. A method for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, comprising the steps of: Creating, creating a user-added program file describing the grammar of a user-defined program for the first programming language, and reading and analyzing the abstract syntax tree specification definition file And a step of storing the analysis result of the abstract syntax tree specification definition file. An abstract syntax tree access method that describes a method for referencing the abstract syntax tree when converting a programming language based on the analysis result of the stored abstract syntax tree specification definition file while referring to the user additional program file Generating a program, and generating an abstract syntax tree scanning program describing a method for tracing the abstract syntax tree at the time of conversion of a programming language based on the analysis result of the stored abstract syntax tree specification definition file. Generating an abstract syntax tree dump program for dumping a state of an abstract syntax tree stored as an intermediate result at the time of conversion of a programming language, based on an analysis result of the stored abstract syntax tree specification definition file; The execution of the abstract syntax tree dump program Dumping the state of the abstract syntax tree stored as, and checking whether the abstract syntax tree is properly created; and adding the generated abstract syntax tree scanning program to the abstract syntax tree scanning program. Executing a type checking action that collects information when the abstract syntax tree is traced by execution and that checks a type of information contained in the abstract syntax tree stored as the intermediate result based on the collected information; Generating a type check program for checking information about a type of the abstract syntax tree stored as the intermediate result while referring to the generated abstract syntax tree access program by adding When tracing the abstract syntax tree by executing the abstract syntax tree scanning program, Collecting information and adding a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information; Generating a code generation program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result while referring to the abstract syntax tree access program thus obtained. And

【0034】上記目的を達成するため、本発明の第7の
観点にかかるコンピュータ読み取り可能な記録媒体は、
中間結果として記憶される抽象構文木を使用して、第1
のプログラミング言語で記述されたプログラムを第2の
プログラミング言語で記述されたプログラムに変換する
ためのプログラミング言語変換プログラムの開発を支援
するためのプログラムを記録した記録媒体であって、前
記抽象構文木の仕様を入力し、該入力した抽象構文木仕
様を解析する抽象構文木仕様解析ステップと、前記抽象
構文木仕様解析ステップでの解析結果を記憶する抽象構
文木仕様記憶ステップと、前記抽象構文木仕様記憶ステ
ップで記憶した前記抽象構文木仕様の解析結果に基づい
て、前記第2のプログラミング言語へ変換するときに前
記記憶された抽象構文木を参照するための方法を記述し
たプログラムを生成する抽象構文木アクセスプログラム
生成ステップと、前記抽象構文木仕様記憶ステップで記
憶した前記抽象構文木仕様の解析結果に基づいて、前記
第2のプログラミング言語へ変換するときに前記記憶さ
れた抽象構文木をたどるための方法を記述したプログラ
ムを生成する抽象構文木走査プログラム生成ステップと
を実行するためのプログラムを記録することを特徴とす
る。
To achieve the above object, a computer-readable recording medium according to a seventh aspect of the present invention comprises:
Using the abstract syntax tree stored as an intermediate result, the first
Recording a program for supporting the development of a programming language conversion program for converting a program written in a second programming language into a program written in a second programming language, wherein the abstract syntax tree An abstract syntax tree specification analyzing step of inputting a specification and analyzing the input abstract syntax tree specification; an abstract syntax tree specification storing step of storing an analysis result in the abstract syntax tree specification analyzing step; An abstract syntax for generating a program describing a method for referencing the stored abstract syntax tree when converting to the second programming language based on the analysis result of the abstract syntax tree specification stored in the storage step A tree access program generation step; and the abstract syntax tree stored in the abstract syntax tree specification storage step. An abstract syntax tree scanning program generating step of generating a program describing a method for tracing the stored abstract syntax tree when converting to the second programming language based on the analysis result of the tree specification. And a program for recording the program.

【0035】上記記録媒体は、前記抽象構文木走査プロ
グラム生成ステップで生成したプログラムに、該プログ
ラムの実行により前記抽象構文木をたどったときに情報
を収集して、該収集した情報に基づいて前記中間結果と
して記憶された抽象構文木がもつ型に関する情報を検査
する部分を記述した型検査アクションを付加することに
よって、前記抽象構文木アクセスプログラム生成ステッ
プで生成したプログラムを参照しながら前記中間結果と
して記憶された抽象構文木がもつ型に関する情報を検査
するためのプログラムを生成する型検査プログラム生成
ステップと、前記抽象構文木走査プログラム生成ステッ
プで生成したプログラムに、該プログラムの実行により
前記抽象構文木をたどったときに情報を収集して、該収
集した情報に基づいて前記中間結果として記憶された抽
象構文木から前記第2のプログラミング言語によるコー
ド情報を生成する部分を記述したコード生成アクション
を付加することによって、前記抽象構文木アクセスプロ
グラム生成ステップで生成したプログラムを参照しなが
ら前記中間結果として記憶された抽象構文木から前記第
2のプログラミング言語によるコード情報を生成するた
めのプログラムを生成するコード生成プログラム生成ス
テップとを実行するためのプログラムをさらに記録する
ものとしてもよい。
The recording medium collects information in the program generated in the abstract syntax tree scanning program generating step when the abstract syntax tree is traced by executing the program, and based on the collected information, By adding a type checking action describing a part for checking information on a type of an abstract syntax tree stored as an intermediate result, the intermediate result is obtained by referring to a program generated in the abstract syntax tree access program generating step. A type checking program generating step for generating a program for checking information on a type of the stored abstract syntax tree; and a program generated in the abstract syntax tree scanning program generating step, wherein the abstract syntax tree is generated by executing the program. And collect information based on the collected information. By adding a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result, the program generated in the abstract syntax tree access program generation step is generated. A code generation program generating step of generating a program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result with reference to the program. Is also good.

【0036】上記記録媒体は、また、前記抽象構文木ア
クセスプログラム生成ステップで生成されるプログラム
に対してユーザが定義したプログラムを入力し、該入力
したユーザが定義したプログラムを解析して、その解析
結果を前記抽象構文木仕様記憶ステップで記憶した抽象
構文木仕様と対応させて記憶させるユーザ定義プログラ
ム検出ステップを実行するためのプログラムをさらに記
録するものとしてもよい。
The recording medium also inputs a user-defined program to the program generated in the abstract syntax tree access program generating step, analyzes the input user-defined program, and analyzes the program. A program for executing a user-defined program detection step of storing a result in association with the abstract syntax tree specification stored in the abstract syntax tree specification storage step may be further recorded.

【0037】上記記録媒体は、また、前記抽象構文木仕
様記憶ステップで記憶した前記抽象構文木仕様の解析結
果に基づいて、プログラミング言語の変換時に中間結果
として記憶された抽象構文木の状態をダンプするための
方法を記述したプログラムを生成する抽象構文木ダンプ
プログラム生成ステップを実行するためのプログラムを
さらに記録するものとしてもよい。
[0037] The recording medium also dumps the state of the abstract syntax tree stored as an intermediate result during the conversion of the programming language based on the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage step. And a program for executing an abstract syntax tree dump program generating step of generating a program describing a method for performing the method.

【0038】[0038]

【発明の実施の形態】以下、添付図面を参照して、本発
明の実施の形態について説明する。
Embodiments of the present invention will be described below with reference to the accompanying drawings.

【0039】[第1の実施の形態]図1は、この実施の
形態にかかるプログラミング言語変換プログラム開発支
援系のシステム、及びこのシステムから得られたプログ
ラムによって実現されるプログラミング言語変換装置の
機能ブロック図である。この図において、コンパイラ7
0よりも上が、プログラミング言語変換プログラム開発
支援系のシステムとなる。
[First Embodiment] FIG. 1 is a functional block diagram of a programming language conversion program development support system according to this embodiment and a programming language conversion device realized by a program obtained from the system. FIG. In this figure, Compiler 7
Above 0 is the programming language conversion program development support system.

【0040】プログラミング言語変換プログラム開発支
援系のシステムにおいて、抽象構文木仕様定義ファイル
30は、プログラミング言語変換装置200が内部記憶
する抽象構文木の仕様を記述している。抽象構文木仕様
定義ファイル30の記述法については、詳しく後述す
る。
In the system of the programming language conversion program development support system, the abstract syntax tree specification definition file 30 describes the specification of the abstract syntax tree internally stored in the programming language conversion device 200. The description method of the abstract syntax tree specification definition file 30 will be described later in detail.

【0041】プログラミング言語変換プログラム開発支
援装置100は、プログラム制御により動作するデータ
処理装置によって構成され、入力された抽象構文木仕様
定義ファイル30に基づいて、抽象構文木ダンププログ
ラムファイル40と、抽象構文木アクセスプログラムフ
ァイル50と、抽象構文木走査プログラムファイル60
とを生成する。
The programming language conversion program development support device 100 is composed of a data processing device that operates under program control, and based on an input abstract syntax tree specification definition file 30, an abstract syntax tree dump program file 40, an abstract syntax tree Tree access program file 50 and abstract syntax tree scanning program file 60
And generate

【0042】抽象構文木ダンププログラムファイル40
は、後述する抽象構文木ダンプ手段90が実行する処理
を所定の言語で記述したプログラムのファイルである。
抽象構文木アクセスプログラムファイル50は、後述す
る抽象構文木アクセス手段230が実行する処理を所定
の言語で記述したプログラムのファイルである。抽象構
文木走査プログラムファイル60は、後述する抽象構文
木記憶部220に記憶されている抽象構文木をその構造
に従って走査するための処理を所定の言語で記述したプ
ログラムのファイルである。
Abstract syntax tree dump program file 40
Is a file of a program in which a process executed by the abstract syntax tree dump unit 90 described later is described in a predetermined language.
The abstract syntax tree access program file 50 is a file of a program in which a process executed by an abstract syntax tree access unit 230 described later is described in a predetermined language. The abstract syntax tree scanning program file 60 is a file of a program in which processing for scanning an abstract syntax tree stored in an abstract syntax tree storage unit 220 described later in accordance with its structure is described in a predetermined language.

【0043】型検査用アクション61は、型検査プログ
ラムファイル63を生成する際に、抽象構文木走査プロ
グラムファイル60に付け加えられるプログラムの部分
である。型検査プログラム編集エディタ62は、抽象構
文木走査プログラムファイル60を読み込み、これに型
検査用アクション61を付け加えるという編集処理を行
うことにより、型検査プログラムファイル63を生成す
る。
The type checking action 61 is a part of a program that is added to the abstract syntax tree scanning program file 60 when the type checking program file 63 is generated. The type checking program editing editor 62 generates the type checking program file 63 by performing an editing process of reading the abstract syntax tree scanning program file 60 and adding a type checking action 61 thereto.

【0044】コード生成用アクション64は、コード生
成プログラムファイル65を生成する際に、抽象構文木
走査プログラムファイル60に付け加えられるプログラ
ムの部分である。コード生成プログラム編集エディタ6
5は、抽象構文木走査プログラムファイル60を読み込
み、これにコード生成用アクション64を付け加えると
いう編集処理を行うことにより、コード生成プログラム
ファイル66を生成する。
The code generation action 64 is a program part added to the abstract syntax tree scanning program file 60 when the code generation program file 65 is generated. Code generation program editing editor 6
5 generates a code generation program file 66 by performing an editing process of reading the abstract syntax tree scanning program file 60 and adding a code generation action 64 thereto.

【0045】ここで、型検査用アクション61とコード
生成用アクション64とは、抽象構文木走査プログラム
ファイル60に記述されたプログラムを実行したとき
に、たどった抽象構文木から情報を収集して、該収集し
た情報に基づいて行う処理を記述したものである。すな
わち、抽象構文木走査プログラムファイル60では、抽
象構文木をたどることができるだけであるのに対して、
これに型検査用アクション61或いはコード生成アクシ
ョン64を付加することにより、抽象構文木をたどった
ときに情報を収集して、該収集した情報に従って、それ
ぞれ抽象構文木の型情報の検査と、下位言語プログラム
ファイル20のプログラム言語に対応するコード情報の
生成とを行うことができるようになる。
Here, the type check action 61 and the code generation action 64 collect information from the traced abstract syntax tree when the program described in the abstract syntax tree scanning program file 60 is executed. It describes processing to be performed based on the collected information. That is, while the abstract syntax tree scanning program file 60 can only follow the abstract syntax tree,
By adding a type checking action 61 or a code generation action 64 to this, information is collected when the abstract syntax tree is traced, and the type information of the abstract syntax tree is checked according to the collected information. Code information corresponding to the programming language of the language program file 20 can be generated.

【0046】型検査プログラムファイル63は、後述す
る型検査手段240が実行する処理を所定の言語で記述
したプログラムのファイルである。コード生成プログラ
ムファイル66は、後述するコード生成手段250が実
行する処理を所定の言語で記述したプログラムのファイ
ルである。
The type inspection program file 63 is a file of a program in which processing executed by the type inspection means 240 described later is described in a predetermined language. The code generation program file 66 is a file of a program in which processing executed by the code generation unit 250 described later is described in a predetermined language.

【0047】コンパイラ70は、抽象構文木ダンププロ
グラムファイル40、抽象構文木アクセスプログラムフ
ァイル50、型検査プログラムファイル63及びコード
生成プログラムファイル66をそれぞれコンパイルし、
プログラミング言語変換装置200の各対応する手段が
実行できる機械語のプログラムを生成する。
The compiler 70 compiles the abstract syntax tree dump program file 40, the abstract syntax tree access program file 50, the type check program file 63, and the code generation program file 66, respectively.
A machine language program that can be executed by each corresponding unit of the programming language conversion device 200 is generated.

【0048】一方、プログラミング言語変換装置200
は、上位言語入力ファイル10を読み込み、これを別の
言語で記述された下位言語プログラムファイル20に変
換して出力するもので、プログラム制御により動作する
データ処理装置によって構成され、構文解析手段210
と、抽象構文木記憶部220と、抽象構文木アクセス手
段230と、型検査手段240と、コード生成手段25
0とを備える。
On the other hand, the programming language conversion device 200
Reads a high-level language input file 10, converts it into a low-level language program file 20 described in another language, and outputs it. The data processing device is operated under program control, and includes a syntax analysis unit 210.
Abstract syntax tree storage unit 220, abstract syntax tree access unit 230, type checking unit 240, code generation unit 25
0.

【0049】構文解析手段210は、所定のプログラム
の実行により実現され、入力された上位言語入力ファイ
ル10のプログラムをその上位言語の文法に従って構文
解析し、その解析結果に基づいて抽象構文木を作成す
る。抽象構文木記憶部220は、構文解析手段210の
解析結果として得られた抽象構文木を記憶する。
The parsing means 210 is realized by executing a predetermined program, parses the input program of the upper language input file 10 according to the grammar of the higher language, and creates an abstract syntax tree based on the analysis result. I do. The abstract syntax tree storage unit 220 stores an abstract syntax tree obtained as an analysis result of the syntax analysis unit 210.

【0050】抽象構文木アクセス手段230は、上記開
発支援系のシステムで生成された抽象構文木アクセスプ
ログラムファイル50をコンパイラ70によってコンパ
イルしたプログラムを実行することによって実現され、
抽象構文木記憶部220に記憶されている抽象構文木を
参照するための方法を提供する。
The abstract syntax tree access means 230 is realized by executing a program compiled by the compiler 70 from the abstract syntax tree access program file 50 generated by the development support system.
A method for referencing an abstract syntax tree stored in the abstract syntax tree storage unit 220 is provided.

【0051】型検査手段240は、上記開発支援系のシ
ステムで生成された型検査プログラムファイル63をコ
ンパイラ70によってコンパイルしたプログラムを実行
することによって実現され、抽象構文木アクセス手段2
30の機能を用いて抽象構文木を参照することにより、
抽象構文木記憶部220に記憶されている抽象構文木の
型情報を検査する。
The type checking means 240 is realized by executing a program obtained by compiling the type checking program file 63 generated by the development support system by the compiler 70.
By referring to the abstract syntax tree using the functions of 30
The type information of the abstract syntax tree stored in the abstract syntax tree storage unit 220 is checked.

【0052】コード生成手段250は、上記開発支援系
のシステムで生成されたコード生成プログラムファイル
66をコンパイラ70によってコンパイルしたプログラ
ムを実行することによって実現され、型検査手段240
が検査した型情報に基づき、、また、抽象構文木アクセ
ス手段230の機能を用いて抽象構文木を参照すること
により、抽象構文木記憶部220に記憶されている抽象
構文木からコード生成をし、下位言語プログラムファイ
ル20を出力する。
The code generation means 250 is realized by executing a program compiled by the compiler 70 from the code generation program file 66 generated by the above development support system, and the type checking means 240
Generates a code from the abstract syntax tree stored in the abstract syntax tree storage unit 220 by referring to the abstract syntax tree based on the type information checked by the , The lower language program file 20 is output.

【0053】また、プログラミング言語変換装置200
に付随して、抽象構文木ダンプ手段90が設けられてい
る。抽象構文木ダンプ手段90は、上記開発支援系のシ
ステムで生成された抽象構文木ダンププログラム40を
コンパイラ70によってコンパイルしたプログラムを実
行することによって実現され、抽象構文木記憶部220
に記憶されている抽象構文木の状態を、抽象構文木ダン
プファイル80として出力する。
The programming language conversion device 200
, An abstract syntax tree dump means 90 is provided. The abstract syntax tree dump unit 90 is realized by executing a program compiled by the compiler 70 from the abstract syntax tree dump program 40 generated by the development support system. The abstract syntax tree storage unit 220
Is output as an abstract syntax tree dump file 80.

【0054】抽象構文木ダンプファイル80は、抽象構
文木記憶部220に記憶されている抽象構文木の状態
を、人間が読めるテキスト形式のファイルに変換したも
のである。
The abstract syntax tree dump file 80 is obtained by converting the state of the abstract syntax tree stored in the abstract syntax tree storage unit 220 into a human-readable text format file.

【0055】次に、図1のプログラミング言語変換プロ
グラム開発支援装置100について、図2のブロック図
を参照して、その構成を詳しく説明する。図2に示すよ
うに、プログラミング言語変換プログラム開発支援装置
100は、抽象構文木仕様解析手段110と、抽象構文
仕様記憶部120と、意味検査手段130と、抽象構文
木ダンププログラム生成手段140と、抽象構文木アク
セスプログラム生成手段150と、抽象構文木走査プロ
グラム生成手段160とを含む。
Next, the configuration of the programming language conversion program development support device 100 of FIG. 1 will be described in detail with reference to the block diagram of FIG. As shown in FIG. 2, the programming language conversion program development support device 100 includes an abstract syntax tree specification analysis unit 110, an abstract syntax specification storage unit 120, a semantic checking unit 130, an abstract syntax tree dump program generation unit 140, An abstract syntax tree access program generating means 150 and an abstract syntax tree scanning program generating means 160 are included.

【0056】抽象構文木仕様解析手段110は、入力さ
れた抽象構文仕様定義ファイル30を構文解析し、その
解析結果を抽象構文木記憶部120に記憶させる。抽象
構文木記憶部120の記憶内容については、詳しく後述
する。意味検査手段130は、抽象構文木記憶部120
の記憶されている内容の整合性を検査する。
The abstract syntax tree specification analyzing means 110 parses the input abstract syntax specification definition file 30 and stores the analysis result in the abstract syntax tree storage unit 120. The storage contents of the abstract syntax tree storage unit 120 will be described later in detail. The semantic checking unit 130 includes the abstract syntax tree storage unit 120
Check the stored contents for consistency.

【0057】抽象構文木ダンププログラム生成手段14
0は、抽象構文仕様記憶部120を参照して、抽象構文
ダンプグログラムファイル40を生成して出力する。抽
象構文木アクセスプログラム生成手段150は、抽象構
文仕様記憶部120を参照して、抽象構文アクセスプロ
グラムファイル50を生成して出力する。抽象構文木走
査プログラム生成手段160は、抽象構文木記憶部12
0を参照して、抽象構文木走査プログラムファイル60
を生成して出力する。
Abstract syntax tree dump program generating means 14
0 refers to the abstract syntax specification storage unit 120 to generate and output the abstract syntax dump program file 40. The abstract syntax tree access program generation means 150 generates and outputs an abstract syntax access program file 50 with reference to the abstract syntax specification storage unit 120. The abstract syntax tree scanning program generation means 160 includes the abstract syntax tree storage unit 12
0, the abstract syntax tree scanning program file 60
Is generated and output.

【0058】図3は、図1、図2に示す抽象構文木仕様
定義ファイル30の記述例を示す図である。抽象構文木
記憶部220に記憶される抽象構文木は、オブジェクト
指向プログラミング言語を用いた木構造のデータとして
実現されることを想定しており、図3に示すように、抽
象構文木仕様定義ファイル30には、オブジェクト指向
プログラミング言語におけるデータ構造の雛形であるク
ラスと、クラスの構成要素であるメンバの関係とが記述
される。
FIG. 3 is a diagram showing a description example of the abstract syntax tree specification definition file 30 shown in FIGS. The abstract syntax tree stored in the abstract syntax tree storage unit 220 is assumed to be realized as tree-structured data using an object-oriented programming language. As shown in FIG. 30 describes a class which is a model of a data structure in the object-oriented programming language and a relationship between members which are constituent elements of the class.

【0059】抽象構文木仕様定義ファイル30には、一
般的クラスと、継承関係を用いたクラスと、列挙型のク
ラスと、リスト型のクラスという4つのパターンを用い
て、クラスとメンバとの関係が記述される。以下、この
4つのパターンのそれぞれについての記述方法を説明す
る。
The abstract syntax tree specification definition file 30 includes a relation between classes and members by using four patterns of a general class, a class using an inheritance relationship, an enumeration type class, and a list type class. Is described. Hereinafter, a description method for each of these four patterns will be described.

【0060】(1)一般的クラスを定義する場合 この場合、 <クラス名>=(<メンバ1の型名><メンバ1の名前
>,...<メンバnの型名><メンバnの名前>) の形式で記述する。すなわち、“=”の左側に定義する
クラスの名前を記述し、“=”の右側に“(”を記述し
た後、メンバの型名と名前とを複数組記述し、その
後“)”を記述する。例えば、 Token = (String image, int Line, int Column) と記述した場合、String型のメンバimageと、int型のメ
ンバLineと、int型のメンバColumnをもつ、Tokenクラス
を定義することができる。
(1) In the case of defining a general class In this case, <class name> = (<type name of member 1><name of member 1> ... <type name of member n><type of member n>Name>). That is, the name of the class to be defined is described on the left side of “=”, “(” is described on the right side of “=”, then a plurality of member type names and names are described, and then “)” is described. I do. For example, if Token = (String image, int Line, int Column), it is possible to define a Token class that has a String type member image, an int type Member Line, and an int type Member Column.

【0061】(2)継承関係を用いたクラスを定義する
場合 この場合、“::=”を用い、“::=”の左側にスー
パークラスを、右側にサブクラスを記述する。サブクラ
スが複数ある場合には、“|”で区切って記述する。図
3では、1行目から7行目までが継承関係を用いたクラ
スを定義している部分を示しており、BinaryクラスとUn
aryクラスとIntクラスとBoolクラスとLiteralクラスとB
raクラスの6つがサブクラスとなっている。
(2) When defining a class using an inheritance relationship In this case, “:: =” is used, a superclass is described on the left side of “:: =”, and a subclass is described on the right side. When there are a plurality of subclasses, they are described by separating them with "|". In FIG. 3, the first to seventh lines show a part defining a class using the inheritance relationship.
ary class, Int class, Bool class, Literal class, and B
Six of the ra classes are subclasses.

【0062】また、スーパークラスのメンバは、“%att
ributes(”の後に記述する。図3の例では、Expクラス
はType型のメンバtypeをもつことを示している。サブク
ラスのメンバは、サブクラス名の後に"("に続けて記述
する。図3の例では、Binrayクラスは、BOperator型の
メンバopと、Exp型のメンバlと、Exp型のメンバrをもつ
ことを示している。
The members of the super class are “% att
The example shown in FIG. 3 shows that the Exp class has a member of type Type. The members of the subclass are described after "(" after the subclass name. Shows that the Binray class has a member op of BOperator type, a member l of Exp type, and a member r of Exp type.

【0063】(3)列挙型のクラスを定義する場合 列挙型とは、その型の値が特定の集合の要素のうちのい
ずれかである場合に対応するものであり、列挙型のクラ
スを定義する場合には、 <型名>=<集合の要素1>|<集合の要素2>
|...|<集合の要素n> の形式で記述する。例えば、図3の10行目に示すよう
に、 Bconst = TRUE | FALSE と記述した場合は、Bconst型は値として、TRUEまたはFA
LSEをもつ。
(3) When defining an enumeration type class An enumeration type corresponds to the case where the value of the type is one of the elements of a specific set, and defines the enumeration type class. <Type name> = <set element 1> | <set element 2>
| . . | <Set element n>. For example, as shown in the 10th line of FIG. 3, when Bconst = TRUE | FALSE, the Bconst type is TRUE or FA as a value.
Has LSE.

【0064】(4)リスト型のクラスを定義する場合 同じ型を複数扱う場合、それらの型を複数個まとめた型
であるリスト型をメンバの型として定義することができ
る。この場合、アルファベットで記述されるメンバの型
名を、アルファベットの後に*をつけることによりリス
ト型のメンバをもつ型を定義することができる。例え
ば、 Address = (String* name) と記述した場合は、String型を複数個まとめたリスト型
のメンバnameをもつAddress型を定義することができ
る。
(4) When a Class of List Type is Defined When a plurality of the same types are handled, a list type, which is a type obtained by combining a plurality of these types, can be defined as a member type. In this case, a type having a list type member can be defined by appending * to the alphabet of the type name of the member described in the alphabet. For example, if Address = (String * name) is described, it is possible to define an Address type having a list type member name in which a plurality of String types are put together.

【0065】図4は、図2に示す抽象構文仕様記憶部1
20の記憶内容を示す図である。図示するように、抽象
構文仕様記憶部120は、クラス名をキーとしてクラス
タイプとクラス情報とを検索できる表を記憶している。
FIG. 4 shows the abstract syntax specification storage unit 1 shown in FIG.
FIG. 20 is a diagram showing stored contents of a memory 20. As illustrated, the abstract syntax specification storage unit 120 stores a table from which a class type and class information can be searched using a class name as a key.

【0066】クラス名の部分には、抽象構文木仕様定義
ファイル30で定義されるクラスの名前が記憶される。
クラスタイプの部分には、当該クラスが一般的クラス、
継承関係を用いたクラス、列挙型のクラス或いはリスト
型のクラスのいずれであるかを示す情報が記憶される。
In the class name part, the name of a class defined in the abstract syntax tree specification definition file 30 is stored.
In the class type part, the class is a general class,
Information indicating whether the class is an inherited class, an enumerated class, or a list class is stored.

【0067】クラス情報の部分には、一般的クラスの場
合はクラスがもつメンバの型名及び名前を、継承関係を
用いたクラスの場合はクラスがもつメンバの型名及び名
前、並びにスーパークラス名やサブクラス名を、列挙型
のクラスの場合は集合の要素の名前を、リスト型のクラ
スの場合はリストの元となる型の名前が、それぞれ記憶
される。
In the class information part, the type name and the name of the member of the class in the case of the general class, the type name and the name of the member of the class in the case of the class using the inheritance relation, and the super class name Or the name of a subclass, the name of an element of a set in the case of an enumeration type, and the name of the type that is the source of a list in the case of a list type.

【0068】以下、図1に示すプログラミング言語変換
プログラム開発支援系のシステムにおいて、抽象構文木
定義ファイル30に基づいてプログラムの開発を支援
し、プログラミング言語変換装置200を生成するまで
の流れについて、図5のフローチャートを参照して説明
する。
Hereinafter, in the system of the programming language conversion program development support system shown in FIG. 1, the flow from the support of the program development based on the abstract syntax tree definition file 30 to the generation of the programming language conversion device 200 will be described. This will be described with reference to the flowchart of FIG.

【0069】まず、ユーザ(作成者:開発者)は、上位
言語入力ファイル10の文法と、上位言語入力ファイル
の文法に対応する下位言語プログラムファイル20の記
述を決定する(ステップA10)。次に、決定した上位
言語入力ファイル10の文法に従って、抽象構文木仕様
定義ファイル30を作成する(ステップA20)。
First, the user (creator: developer) determines the grammar of the upper language input file 10 and the description of the lower language program file 20 corresponding to the grammar of the upper language input file (step A10). Next, an abstract syntax tree specification definition file 30 is created according to the determined grammar of the upper language input file 10 (step A20).

【0070】次に、作成した抽象構文木仕様定義ファイ
ル30をプログラミング言語変換プログラム開発支援装
置100に入力し、プログラミング言語変換プログラム
開発支援装置100は、抽象構文木ダンププログラムフ
ァイル40と抽象構文木アクセスプログラムファイル5
0と抽象構文木走査プログラムファイル60を生成する
(ステップA30)。この処理については、さらに詳し
く後述する。
Next, the created abstract syntax tree specification definition file 30 is input to the programming language conversion program development support device 100, and the programming language conversion program development support device 100 generates the abstract syntax tree dump program file 40 and the abstract syntax tree access file. Program file 5
0 and an abstract syntax tree scanning program file 60 are generated (step A30). This processing will be described later in more detail.

【0071】次に、コンパイラ70を用いて、抽象構文
木アクセスプログラム50をコンパイルし、これをプロ
グラミング言語変換装置200のメモリの所定の領域に
記憶させることで、抽象構文木アクセス手段230を作
成する。また、コンパイラ70を用いて抽象構文木ダン
ププログラムファイル40をコンパイルし、これをプロ
グラミング言語変換装置200のメモリの所定の領域に
記憶させることで、抽象構文木ダンプ手段90を作成す
る(ステップA40)。
Next, the abstract syntax tree access program 230 is created by compiling the abstract syntax tree access program 50 using the compiler 70 and storing it in a predetermined area of the memory of the programming language conversion device 200. . Further, the abstract syntax tree dump program 90 is created by compiling the abstract syntax tree dump program file 40 using the compiler 70 and storing the compiled program in a predetermined area of the memory of the programming language conversion device 200 (step A40). .

【0072】次に、ユーザは、ステップA10で決定し
た上位言語ファイル10の文法に従って、上位言語ファ
イル10を構文解析するためのプログラムを作成し、こ
れをプログラミング言語変換装置200のメモリの所定
の領域に記憶させることで、構文解析手段210を作成
する(ステップA50)。
Next, the user creates a program for parsing the upper language file 10 in accordance with the grammar of the upper language file 10 determined in step A10, and stores the program in a predetermined area of the memory of the programming language converter 200. To create the syntax analysis means 210 (step A50).

【0073】次に、プログラミング言語の変換の対象と
なる上位言語入力ファイル10(でもプログラムでも
可)を構文解析手段210に入力し、構文解析手段21
0によって抽象構文木を作成させて抽象構文木記憶部2
20に記憶させる。そして、抽象構文木ダンプ手段90
を動作させて、抽象構文木記憶部220に記憶されてい
る抽象構文木をテキスト形式のデータに変換して抽象構
文木ダンプファイル80として出力する。そして、出力
された抽象構文木ダンプファイル80の内容をユーザが
確認することにより、構文解析手段210がユーザの想
定するように動作していることを確認する(ステップA
60)。
Next, the high-level language input file 10 (or a program) that is the object of the programming language conversion is input to the syntax analysis means 210 and the syntax analysis means 21 is input.
Abstract syntax tree storage unit 2
20. Then, the abstract syntax tree dumping means 90
To convert the abstract syntax tree stored in the abstract syntax tree storage unit 220 into text format data and output it as the abstract syntax tree dump file 80. Then, by confirming the contents of the output abstract syntax tree dump file 80 by the user, it is confirmed that the syntax analyzer 210 is operating as expected by the user (step A).
60).

【0074】次に、型検査プログラム編集エディタ61
は、抽象構文木走査プログラムファイル60を読み込ま
せ、型検査用アクション61を読み込んで抽象構文木走
査プログラムファイル60に付加することにより、型検
査プログラムファイル63を作成する(ステップA7
0)。さらに、コード生成プログラム編集エディタ65
は、抽象構文木走査プログラムファイル60を読み込ま
せ、コード生成用アクション64を読み込んで抽象構文
木走査プログラム60に付加することにより、コード生
成用プログラムファイル66を作成する(ステップA8
0)。
Next, the type inspection program editing editor 61
Creates the type checking program file 63 by reading the abstract syntax tree scanning program file 60, reading the type checking action 61 and adding it to the abstract syntax tree scanning program file 60 (step A7).
0). Further, a code generation program editing editor 65
Creates the code generation program file 66 by reading the abstract syntax tree scanning program file 60, reading the code generation action 64 and adding it to the abstract syntax tree scanning program 60 (step A8).
0).

【0075】そして、コンパイラ70を用いて型検査用
プログラムファイル63をコンパイルし、これをプログ
ラミング言語変換装置200のメモリの所定の領域に記
憶させることによって、型検査手段240を作成する
(ステップA90)。さらに、コンパイラ70を用いて
コード生成用プログラムファイル66をコンパイルし、
これをプログラミング言語変換装置200のメモリの所
定の領域に記憶させることによって、コード生成手段2
40を作成する(ステップA90)。そして、このフロ
ーチャートに示す処理を終了する。以上により、プログ
ラミング言語変換装置200を構成するすべての手段が
作成されることとなる。
Then, the type checking program file 63 is compiled by using the compiler 70 and is stored in a predetermined area of the memory of the programming language conversion device 200, thereby creating the type checking means 240 (step A90). . Furthermore, the program file 66 for code generation is compiled using the compiler 70,
By storing this in a predetermined area of the memory of the programming language conversion device 200, the code generation unit 2
40 is created (step A90). Then, the processing shown in this flowchart ends. As described above, all means constituting the programming language conversion device 200 are created.

【0076】次に、プログラミング言語変換プログラム
開発支援装置100において実行されるのための処理、
すなわち図5のステップA30の処理について、図6の
フローチャートを参照して詳しく説明する。
Next, processing to be executed in the programming language conversion program development support device 100,
That is, the process of step A30 in FIG. 5 will be described in detail with reference to the flowchart in FIG.

【0077】処理が開始すると、抽象構文木仕様解析手
段110は、抽象構文木仕様定義ファイル30を読み込
み、これを構文解析する(ステップC10)。次に、抽
象構文木仕様解析手段110は、その解析結果を、図4
に示したように、抽象構文木仕様記憶部120内に表形
式で記憶させる(ステップC20)。
When the process starts, the abstract syntax tree specification analyzing means 110 reads the abstract syntax tree specification definition file 30 and analyzes it (step C10). Next, the abstract syntax tree specification analysis unit 110 compares the analysis result
As shown in (1), it is stored in a table format in the abstract syntax tree specification storage unit 120 (step C20).

【0078】次に、意味検査手段130は、抽象構文木
仕様記憶部120を検査して、その記憶する情報におい
てクラス名を重複して仕様していないかどうか検査す
る。ここで、クラス名を重複して用いていたらその内容
を示すメッセージを出力し、重複して用いていなければ
何も行わない。また、意味検査手段130は、生成する
プログラミング言語における予約語をクラスとして用い
ていないかどうかを検査する。ここで、予約語をクラス
名として用いていたらその内容を示すメッセージを出力
し、用いていなければ何も行わない(ステップC3
0)。
Next, the semantic checking unit 130 checks the abstract syntax tree specification storage unit 120 to check whether or not the class name is redundantly specified in the stored information. Here, if the class name is used repeatedly, a message indicating the content is output, and if not used, nothing is performed. The semantic checking unit 130 checks whether a reserved word in the generated programming language is used as a class. Here, if the reserved word is used as the class name, a message indicating the content is output, and if not, nothing is performed (step C3).
0).

【0079】次に、抽象構文木アクセスプログラム生成
手段150は、抽象構文木仕様記憶部120を参照しな
がら、抽象構文木アクセスプログラムファイル50を生
成する(ステップC40)。また、抽象構文木ダンププ
ログラム生成手段140は、抽象構文木仕様記憶部12
0を参照しながら抽象構文木ダンププログラムファイル
40を生成する(ステップC50)。さらに、抽象構文
木走査プログラム作成手段160は、抽象構文木走査プ
ログラムファイル60を生成する(ステップC60)。
そして、このフローチャートの処理を終了する。このフ
ローチャートの処理が終了した場合には、次に上記した
ステップA40の処理が行われることとなる。
Next, the abstract syntax tree access program generating means 150 generates the abstract syntax tree access program file 50 while referring to the abstract syntax tree specification storage section 120 (step C40). Further, the abstract syntax tree specification program storage unit 140 generates
Then, an abstract syntax tree dump program file 40 is generated with reference to 0 (step C50). Further, the abstract syntax tree scanning program creating means 160 generates the abstract syntax tree scanning program file 60 (Step C60).
Then, the process of this flowchart ends. When the processing of this flowchart ends, the processing of step A40 described above is performed next.

【0080】以下、上記のようにして開発されたプログ
ラミング言語変換装置200の動作について、図7のフ
ローチャートを参照して説明する。
Hereinafter, the operation of the programming language converter 200 developed as described above will be described with reference to the flowchart of FIG.

【0081】プログラム言語変換装置200が起動され
ると、まず、構文解析手段210は、上位言語入力ファ
イル10を読み込み、上位言語入力ファイル10のプロ
グラミング言語の文法に従ってこれを構文解析する(ス
テップB10)。次に、構文解析手段210は、ステッ
プB10での構文解析の結果をもとに抽象構文木を作成
し、抽象構文木記憶部220に記憶させる(ステップB
20)。
When the program language conversion apparatus 200 is started, the syntax analysis means 210 reads the upper language input file 10 and parses it according to the programming language grammar of the upper language input file 10 (step B10). . Next, the syntax analysis unit 210 creates an abstract syntax tree based on the result of the syntax analysis in step B10, and stores it in the abstract syntax tree storage unit 220 (step B).
20).

【0082】次に、型検査手段240は、抽象構文木ア
クセス手段230を利用して抽象構文木記憶部220に
記憶されている抽象構文木を参照することにより、抽象
構文木の型情報を検査する(ステップB30)。そし
て、コード生成手段250は、抽象構文木アクセス手段
230を利用して抽象構文木記憶部220に記憶されて
いる抽象構文木をを参照して、下位言語プログラムファ
イル20を出力する(ステップB40)。そして、この
フローチャートの処理を終了し、以上で上位言語入力フ
ァイル10から下位言語プログラムファイル20へのプ
ログラミング言語の変換がなされることとなる。
Next, the type checking unit 240 checks the type information of the abstract syntax tree by referring to the abstract syntax tree stored in the abstract syntax tree storage unit 220 using the abstract syntax tree access unit 230. (Step B30). Then, the code generation unit 250 refers to the abstract syntax tree stored in the abstract syntax tree storage unit 220 using the abstract syntax tree access unit 230 and outputs the lower language program file 20 (step B40). . Then, the processing of this flowchart is completed, and the conversion of the programming language from the upper language input file 10 to the lower language program file 20 is completed.

【0083】以下、この実施の形態を、具体的な例を示
して説明する。ここでは、構文木仕様定義ファイル30
として図3に示した内容のファイルを用いて、プログラ
ミング言語変換プログラム開発支援装置100と、抽象
構文木ダンプ手段90の動作を説明すると共に、型検査
プログラムファイル63とコード生成用プログラムファ
イル66の作成方法を説明する。また、抽象構文木作成
装置100が生成する抽象構文木ダンププログラムファ
イル40と抽象構文木アクセスプログラム50と抽象構
文木プログラムファイル60とを実現するプログラミン
グ言語として、Java言語を用いるものとする。
Hereinafter, this embodiment will be described with reference to a specific example. Here, the syntax tree specification definition file 30
The operation of the programming language conversion program development support device 100 and the abstract syntax tree dump means 90 will be described using files having the contents shown in FIG. 3 as well as the creation of the type check program file 63 and the code generation program file 66. The method will be described. The Java language is used as a programming language for implementing the abstract syntax tree dump program file 40, the abstract syntax tree access program 50, and the abstract syntax tree program file 60 generated by the abstract syntax tree creation device 100.

【0084】最初に、プログラミング言語変換プログラ
ム開発支援装置100の動作の具体例について、説明す
る。抽象構文木仕様解析手段110は、図3に示した抽
象構文木仕様定義ファイル30を読み込み、次に説明す
るように構文解析をして(ステップC10)、抽象構文
木記憶部に記憶させる(ステップC20)。
First, a specific example of the operation of the programming language conversion program development support device 100 will be described. The abstract syntax tree specification analysis unit 110 reads the abstract syntax tree specification definition file 30 shown in FIG. 3, analyzes the syntax as described below (step C10), and stores it in the abstract syntax tree storage unit (step C10). C20).

【0085】ここで、抽象構文木仕様解析手段110に
よる構文解析として、まず"Exp"という文字列を切り出
しクラス名として認識し、抽象構文木仕様記憶部120
内の表の1行目のクラス名の部分にExpを書き込む。次
に、抽象構文木仕様解析手段110は、"::="文字列を
切り出すことにより継承関係のクラスを定義しているこ
とを認識し、1行目のクラスタイプの部分に継承と書き
込む(ステップC10)。
Here, as a syntax analysis by the abstract syntax tree specification analyzing means 110, first, a character string "Exp" is cut out and recognized as a class name.
Write Exp to the class name part of the first row of the table in. Next, the abstract syntax tree specification analysis unit 110 recognizes that the class of the inheritance relationship is defined by cutting out the ":: =" character string, and writes the inheritance in the class type portion on the first line ( Step C10).

【0086】次に、抽象構文木仕様解析手段110
は、"Binray"という文字列を切り出しこれがExpクラス
のサブクラス名であることを認識し、表の2行目のクラ
ス名の部分にBinrayを書き込むと共に、表の2行目のク
ラスタイプに継承と書き込む。また、表の2行目のクラ
ス情報の部分にスーパークラスの名前がExpであること
を書き込み、表の1行目のクラス情報の部分に1番目の
サブクラスの名前がBinaryであることを書き込む。
Next, the abstract syntax tree specification analyzing means 110
Cuts out the character string "Binray", recognizes that this is a subclass name of the Exp class, writes Binray in the class name of the second row of the table, and inherits the class type in the second row of the table. Write. Also, the fact that the name of the superclass is Exp is written in the class information part of the second row of the table, and the fact that the name of the first subclass is Binary is written in the class information part of the first row of the table.

【0087】次に、抽象構文仕様解析手段110
は、"("を認識し、次に")"が現れるまでは、Binaryクラ
スのメンバを定義していると認識し、BinaryクラスがBO
peratorのメンバopとExp型のメンバlとExp型のメンバr
をもつことを、表の2行目のクラス情報の部分に書き込
む。
Next, the abstract syntax specification analyzing means 110
Recognizes that a member of Binary class is defined until "(" is recognized and then ")" appears, and Binary class
perator members op and Exp type members l and Exp type members r
Is written in the class information portion of the second row of the table.

【0088】次に、抽象構文仕様解析手段110は、"
|"という文字を切り出すことにより、UnaryクラスもExp
クラスのサブクラスであることを認識し、表の3行目に
記憶させる。同様にして6行目まで処理を行い、抽象構
文仕様解析手段110は、7行目は"%attributes"とい
う文字列を認識することによりこの後の"("の中がExpク
ラスのメンバであると認識する。
Next, the abstract syntax specification analyzing means 110
Unary class is also expanded by extracting the character |
It recognizes that it is a subclass of the class and stores it in the third row of the table. Similarly, the processing is performed up to the sixth line, and the abstract syntax specification analyzing unit 110 recognizes the character string “% attributes” in the seventh line, so that the following “(” is a member of the Exp class. Recognize.

【0089】次に、抽象構文仕様解析手段110は、8
行目において"BOperator"という文字列を認識し"="とい
う文字を認識し、さらに"PLUS"という文字列を認識した
時点で、列挙型のクラスを定義していると認識する。そ
れにより、抽象構文仕様解析手段110は、表の8行目
のクラス名にBOperatorで、表の8行目のクラスタイプ
に列挙型、表の8行目のクラス情報の部分に列挙の要素
である"PLUS"と"MINUS"とMULTI"と"DIV"と"AND"と"OR"
を書き込む。
Next, the abstract syntax specification analyzing means 110
In the line, the character string "BOperator" is recognized, the character "=" is recognized, and when the character string "PLUS" is recognized, it is recognized that an enumeration type class is defined. As a result, the abstract syntax specification analysis unit 110 uses BOperator for the class name on the eighth line of the table, an enumeration type for the class type on the eighth line of the table, and an enumeration element for the class information on the eighth line of the table. There are "PLUS", "MINUS", MULTI "," DIV "," AND "and" OR "
Write.

【0090】このようにして、抽象構文仕様解析手段1
10が抽象構文仕様ファイル30を構文解析して抽象構
文仕様記憶部120の表への登録を行うことにより、抽
象構文木記憶部120内の表は、図8に示す状態とな
る。但し、図8において、「略」と表示されている行の
クラス情報の部分については、詳しい記述は省略してあ
る。
As described above, the abstract syntax specification analyzing means 1
10 analyzes the abstract syntax specification file 30 and registers the syntax in the table of the abstract syntax specification storage unit 120, so that the table in the abstract syntax tree storage unit 120 is in the state shown in FIG. However, in FIG. 8, the detailed description of the class information portion of the line displayed as “abbreviated” is omitted.

【0091】抽象構文仕様記憶部120の表への登録が
終了すると、意味検査手段130は、抽象構文木仕様記
憶部120に記憶されている表の内容に対してクラス名
の重複および生成プログラミング言語であるJava言語の
予約語を型名として用いていないかどうかを検査する
(ステップC30)。図3に示す抽象構文仕様定義ファ
イル30を用いた場合、抽象構文仕様記録部120の表
においてクラス名の重複なく、またJava言語の予約語を
型名として用いていない。このため、意味検査手段13
0は、検査のみでその後のメッセージの出力等は行わな
い。
When the registration in the table of the abstract syntax specification storage unit 120 is completed, the semantic checking unit 130 overlaps the contents of the table stored in the abstract syntax tree specification storage unit 120 with the duplication of the class name and the generated programming language. It is checked whether or not a reserved word of the Java language is used as a type name (step C30). When the abstract syntax specification definition file 30 shown in FIG. 3 is used, there is no duplication of class names in the table of the abstract syntax specification recording unit 120, and Java language reserved words are not used as type names. Therefore, the semantic checking means 13
A value of 0 indicates only inspection and does not output a subsequent message.

【0092】意味検査手段130による検査が終了する
と、抽象構文木アクセスプログラム生成手段150は、
抽象構文木仕様記憶部120内の表の各行に対して、対
応するファイルを生成する(ステップC40)。この例
においては、抽象構文木仕様記憶部120内の表は図8
のようになっており、この表の各行に対してそれぞれ1
つのファイルが生成されるので、全部で11個のファイ
ルからなる抽象構文木アクセスプログラム50が生成さ
れる。
When the inspection by the semantic inspection unit 130 is completed, the abstract syntax tree access program generation unit 150
For each row of the table in the abstract syntax tree specification storage unit 120, a corresponding file is generated (step C40). In this example, the table in the abstract syntax tree specification storage unit 120 is shown in FIG.
And 1 for each row in this table
Since one file is generated, the abstract syntax tree access program 50 including 11 files in total is generated.

【0093】例として、クラス名の部分がExpの行に対
しては、Exp.javaというファイル名で、図9に示す内容
のファイルが生成される。また、クラス名の部分がType
の行に対してはType.javaというファイル名で、図10
に示す内容のファイルが生成される。
As an example, a file having the contents shown in FIG. 9 with the file name Exp.java is generated for the line where the class name part is Exp. Also, the class name part is Type
The file name is Type.java for the line
Is generated.

【0094】次に、抽象構文木ダンププログラム生成手
段140は、抽象構文木記憶部120内の表を参照しな
がら抽象構文木ダンププログラム40を生成する(ステ
ップC50)。
Next, the abstract syntax tree dump program generation means 140 generates the abstract syntax tree dump program 40 while referring to the table in the abstract syntax tree storage unit 120 (step C50).

【0095】そして、抽象構文木走査プログラム生成手
段160は、抽象構文木記憶部120内の表を参照し
て、抽象構文木走査プログラムファイル60を生成す
る。ここで、抽象構文木記憶部120内の表が図7に示
す状態となっているため、抽象構文木走査プログラムフ
ァイルとして、図11に示す内容のプログラムが生成さ
れる。但し、図11において、「中略」と書いた部分に
ついては、その間を記述が省略されていることを表して
いる(ステップC60)。
Then, the abstract syntax tree scanning program generation means 160 generates the abstract syntax tree scanning program file 60 with reference to the table in the abstract syntax tree storage unit 120. Here, since the table in the abstract syntax tree storage unit 120 is in the state shown in FIG. 7, a program having the contents shown in FIG. 11 is generated as an abstract syntax tree scanning program file. However, in FIG. 11, the description of the part written as “omitted” is omitted (step C60).

【0096】次に、抽象構文木ダンプ手段90の動作の
具体例を説明する。ここで、抽象構文木記憶部120内
の表が図8の状態である場合に、抽象構文木ダンププロ
グラムファイル40をコンパイラ70でコンパイルする
ことにより作成されたプログラムで実現される抽象構文
木ダンプ手段90の動作を説明する。
Next, a specific example of the operation of the abstract syntax tree dump means 90 will be described. Here, when the table in the abstract syntax tree storage unit 120 is in the state of FIG. 8, the abstract syntax tree dump means realized by a program created by compiling the abstract syntax tree dump program file 40 with the compiler 70 90 will be described.

【0097】ここで、抽象構文木記憶部220には、構
文解析手段210による上位言語入力ファイル10の解
析結果として、図12(a)に示す状態の抽象構文木が
記憶されているものとする。この場合、上記のようにし
て実現される抽象構文木ダンプ手段90は、抽象構文木
記憶部220に記憶されている抽象構文木のダンプ結果
として、図12(b)に示すような抽象構文木ダンプフ
ァイル80を出力する。
Here, it is assumed that an abstract syntax tree in a state shown in FIG. 12A is stored in the abstract syntax tree storage unit 220 as a result of analysis of the upper language input file 10 by the syntax analysis unit 210. . In this case, the abstract syntax tree dump unit 90 implemented as described above outputs the abstract syntax tree dumping result stored in the abstract syntax tree storage unit 220 as shown in FIG. Output the dump file 80.

【0098】次に、型検査プログラムファイル63の具
体的な記述例について説明する。図13は、図11の抽
象構文走査プログラム60に対して型検査アクション6
1を付加することにより作成された型検査プログラムフ
ァイル63の例である。図13の中で四角で囲まれた部
分が、付加された型検査アクション61に対応する。す
なわち、それだけでは結果として何も得ることができな
い抽象構文木をたどるためのプログラムに、抽象構文木
の型情報を検査するための部分が付加されているものと
なっている。
Next, a specific description example of the type inspection program file 63 will be described. FIG. 13 shows a type check action 6 for the abstract syntax scanning program 60 of FIG.
It is an example of a type inspection program file 63 created by adding “1”. The portion surrounded by a square in FIG. 13 corresponds to the added type inspection action 61. That is, a program for tracing an abstract syntax tree from which nothing can be obtained by itself is added with a part for checking the type information of the abstract syntax tree.

【0099】次に、コード生成用プログラムファイル6
6の具体的な記述例について説明する。図14は、図1
0の抽象構文走査プログラム60に対してコード生成用
アクション64を付加することにより作成されたコード
生成プログラムファイル66の例である。図14の中で
四角で囲まれた部分が、付加されたコード生成用アクシ
ョン64に対応する。すなわち、それだけでは結果とし
て何も得ることができない抽象構文木をたどるだけのプ
ログラムに、下位言語プログラムファイル20のプログ
ラミング言語のコード情報を生成するための部分が付加
されているものとなっている。
Next, the code generation program file 6
6 will be described. FIG.
7 is an example of a code generation program file 66 created by adding a code generation action 64 to an abstract syntax scanning program 60 of zero. The portion surrounded by a square in FIG. 14 corresponds to the added code generation action 64. That is, a part for generating code information of the programming language of the lower language program file 20 is added to a program that merely follows an abstract syntax tree from which nothing can be obtained as a result.

【0100】以上説明したように、この実施の形態で
は、ユーザ(作成者:開発者)が抽象構文木仕様定義フ
ァイル30のみを開発すれば、プログラミング言語変換
プログラム開発支援装置100が、抽象構文木アクセス
手段230の振る舞いを記述した抽象構文木アクセスプ
ログラムファイル50を生成することができる。このた
め、プログラミング言語変換装置200の構成要素であ
る抽象構文木アクセス手段230を効率よく開発するこ
とができる。
As described above, in this embodiment, if the user (creator: developer) develops only the abstract syntax tree specification definition file 30, the programming language conversion program development support device 100 An abstract syntax tree access program file 50 describing the behavior of the access means 230 can be generated. Therefore, the abstract syntax tree access unit 230, which is a component of the programming language conversion device 200, can be efficiently developed.

【0101】また、ユーザが抽象構文木仕様定義ファイ
ル30のみを開発すれば、プログラミング言語変換プロ
グラム開発支援装置100が、抽象構文木記憶部220
に記憶されている抽象構文木をたどる抽象構文木走査プ
ログラムファイル60を生成することができる。このた
め、記述量が大規模な抽象構文木をたどる部分のプログ
ラムを効率よく開発することができる。
When the user develops only the abstract syntax tree specification definition file 30, the programming language conversion program development support device 100 causes the abstract syntax tree storage unit 220
An abstract syntax tree scanning program file 60 that traces the abstract syntax tree stored in. For this reason, it is possible to efficiently develop a program of a portion that follows an abstract syntax tree having a large description amount.

【0102】さらに、抽象構文木走査プログラムファイ
ル60を、それぞれ型検査用アクション61及びコード
生成用アクション64と共に、型検査プログラム編集エ
ディタ62、コード生成プログラム編集エディタ65で
編集することにより、型検査手段240及びコード生成
手段250の振る舞いを記述した型検査プログラムファ
イル63及びコード生成プログラムファイル66を生成
することができる。このため、プログラミング言語変換
装置200の構成要素である型検査手段240及びコー
ド生成手段250を効率よく開発することができる。
Further, by editing the abstract syntax tree scanning program file 60 together with the type checking action 61 and the code generating action 64 using the type checking program editing editor 62 and the code generating program editing editor 65, respectively, The type check program file 63 and the code generation program file 66 that describe the behavior of the code generation means 240 and the code generation means 250 can be generated. Therefore, the type checking means 240 and the code generating means 250, which are components of the programming language conversion device 200, can be efficiently developed.

【0103】以上のように、図1に示したプログラミン
グ言語変換プログラム開発支援系のシステムを用いるこ
とによって、ユーザは、抽象構文木仕様定義ファイル3
0の開発を行えば、後は型検査用アクション61及びコ
ード生成用アクション64の付加を行うのみで、プログ
ラミング言語変換装置200において抽象構文木記憶部
220に記憶された上位言語入力ファイル10に対応す
る抽象構文木から下位言語プログラムファイル20を作
成するために必要となるすべてのプログラムファイル、
手段を生成することができる。従って、プログラミング
言語開発装置200(或いはこのためのプログラム)の
開発を効率よく行うことができる。
As described above, by using the programming language conversion program development support system shown in FIG. 1, the user can make the abstract syntax tree specification definition file 3
After the development of 0, the type checking action 61 and the code generating action 64 are simply added, and the programming language converter 200 corresponds to the upper language input file 10 stored in the abstract syntax tree storage unit 220. All the program files required to create the lower language program file 20 from the abstract syntax tree
Means can be generated. Therefore, it is possible to efficiently develop the programming language development device 200 (or a program therefor).

【0104】さらに、ユーザが抽象構文木仕様定義ファ
イル30のみを開発すれば、プログラミング言語変換プ
ログラム開発支援装置100が、抽象構文木記憶部22
0に記憶されている抽象構文木の状態をテキストファイ
ルに変換して出力する抽象構文木ダンプ手段90の振る
舞いを記述した抽象構文木ダンププログラムファイル4
0を作成することができる。そして、抽象構文木ダンプ
手段90を動作させて抽象構文木記憶部220内の抽象
構文木の状態をダンプさせることにより、ユーザは、プ
ログラミング言語変換装置200内に記憶されている抽
象構文木の状態を確認することができるようになる。
Further, if the user develops only the abstract syntax tree specification definition file 30, the programming language conversion program development support device 100 causes the abstract syntax tree storage unit 22
Abstract syntax tree dump program file 4 that describes the behavior of the abstract syntax tree dump means 90 that converts the state of the abstract syntax tree stored in 0 to a text file and outputs the text file
0 can be created. Then, by operating the abstract syntax tree dump unit 90 to dump the state of the abstract syntax tree in the abstract syntax tree storage unit 220, the user can obtain the state of the abstract syntax tree stored in the programming language conversion device 200. Will be able to confirm.

【0105】[第2の実施の形態]図15は、この実施
の形態にかかるプログラミング言語変換プログラム開発
支援系のシステム、及びこのシステムから得られたプロ
グラムによって実現されるプログラミング言語変換装置
の機能ブロック図である。この図において、コンパイラ
70よりも上が、プログラミング言語変換プログラム開
発支援系のシステムとなる。
[Second Embodiment] FIG. 15 is a functional block diagram of a programming language conversion program development support system according to the second embodiment and a programming language conversion device realized by a program obtained from the system. FIG. In this figure, a system above the compiler 70 is a programming language conversion program development support system.

【0106】この実施の形態でのプログラミング言語変
換プログラム開発支援系のシステムにおいて、プログラ
ミング言語変換プログラム開発支援装置400が第1の
実施の形態のものと異なり、抽象構文木仕様定義ファイ
ル30に加えて、ユーザ付加プログラムファイル410
が入力される。また、図16に示すように、プログラミ
ング言語変換プログラム開発支援装置400は、第1の
実施の形態の構成に加えてユーザ付加プログラム検出手
段420が付加され、また、抽象構文木アクセスプログ
ラム生成手段430が第1の実施の形態のものと異なっ
ている。
In the programming language conversion program development support system of this embodiment, the programming language conversion program development support device 400 differs from that of the first embodiment in that an abstract syntax tree specification definition file 30 , User additional program file 410
Is entered. As shown in FIG. 16, a programming language conversion program development support device 400 is provided with a user additional program detection unit 420 in addition to the configuration of the first embodiment, and an abstract syntax tree access program generation unit 430. Are different from those of the first embodiment.

【0107】ユーザ付加プログラムファイル410は、
抽象構文木生成手段430により生成される抽象構文木
アクセスプログラム50に追加するためのプログラムを
所定の言語で記述したファイルであり、ユーザ(プログ
ラマ)が作成したプログラムを用いることができる。
The user additional program file 410 is
This is a file in which a program to be added to the abstract syntax tree access program 50 generated by the abstract syntax tree generation means 430 is described in a predetermined language, and a program created by a user (programmer) can be used.

【0108】図17は、ユーザ付加プログラムファイル
410の文法を示す図である。図示するように、ユーザ
プログラムファイル410は、まず、"//--"と"//**"以
外で始まる行からなる任意のプログラムがあり、次に"/
/--"で始まる行があり、次にユーザ定義ヘッダーがあ
り、次に"//"で始まる行があり、次に"//--"と"//**"以
外で始まる行からなる任意のプログラムがあり、次に"/
/**"で始まる行があり、最後にユーザ定義プログラムあ
るという構成をとる。図18にユーザ付加プログラムフ
ァイル410の記述例を示す。
FIG. 17 is a diagram showing the grammar of the user additional program file 410. As shown in the figure, the user program file 410 has an arbitrary program including lines starting with "//-" and "// **", and then "//".
There is a line that starts with "/-", then a user-defined header, then a line that starts with "//", and then a line that starts with something other than "//-" and "// **" There is an arbitrary program, then "/
There is a line starting with "/ **" and a user-defined program at the end. A description example of the user additional program file 410 is shown in FIG.

【0109】また、図16のユーザ付加プログラム検出
手段420は、入力された情報からユーザ付加プログラ
ムファイル410を検出し、検出したユーザ付加プログ
ラムファイル410の内容を抽象構文木仕様記憶部12
0に記憶させる。
The user additional program detection means 420 in FIG. 16 detects the user additional program file 410 from the input information, and stores the contents of the detected user additional program file 410 in the abstract syntax tree specification storage unit 12.
0 is stored.

【0110】抽象構文木アクセスプログラム生成手段4
30は、抽象構文木仕様記憶部120の記憶内容を参照
して、抽象構文木アクセスプログラムファイル50を出
力する。ここで、第1の実施の形態との違いは、出力さ
れる抽象構文木アクセスプログラムファイル50の内容
に、ユーザ付加プログラムファイル410の内容が反映
されていることである。
Abstract syntax tree access program generation means 4
30 outputs the abstract syntax tree access program file 50 with reference to the storage contents of the abstract syntax tree specification storage unit 120. Here, the difference from the first embodiment is that the content of the user additional program file 410 is reflected in the content of the output abstract syntax tree access program file 50.

【0111】以下、図15に示すプログラミング言語変
換プログラム開発支援系のシステムにおいて、抽象構文
木定義ファイル30及びユーザ付加プログラムファイル
410に基づいてプログラムの開発を支援し、プログラ
ミング言語変換装置200を生成するまでの流れについ
て、図19のフローチャートを参照して説明する。
Hereinafter, in the programming language conversion program development support system shown in FIG. 15, the program development is supported based on the abstract syntax tree definition file 30 and the user additional program file 410, and the programming language conversion device 200 is generated. The flow up to this point will be described with reference to the flowchart of FIG.

【0112】図19のフローチャートにおいて、ステッ
プA10、A20の処理は、第1の実施の形態で説明し
たもの(図5)と同じである。ステップA20の処理が
終了すると、次に、ユーザは、ユーザ付加プログラムフ
ァイル410を作成する(ステップA110)。
In the flowchart of FIG. 19, the processing of steps A10 and A20 is the same as that described in the first embodiment (FIG. 5). When the processing in step A20 is completed, the user creates a user additional program file 410 (step A110).

【0113】次に、作成した抽象構文木仕様定義ファイ
ル30とユーザ付加プログラムファイル410とをプロ
グラミング言語変換プログラム開発支援装置100に入
力し、プログラミング言語変換プログラム開発支援装置
100は、抽象構文木ダンププログラムファイル40と
抽象構文木アクセスプログラムファイル50と抽象構文
木走査プログラムファイル60を生成する(ステップA
120)。この処理については、さらに詳しく後述す
る。
Next, the created abstract syntax tree specification definition file 30 and the user additional program file 410 are input to the programming language conversion program development support device 100, and the programming language conversion program development support device 100 executes the abstract syntax tree dump program. A file 40, an abstract syntax tree access program file 50, and an abstract syntax tree scanning program file 60 are generated (step A).
120). This processing will be described later in more detail.

【0114】ステップA120の処理が終了すると、次
に、ステップA40の処理に進む。ステップA40以
降、ステップA90までの処理は第1の実施の形態のも
の(図5)と同じである。そして、ステップA90の処
理を終了することにより、この実施の形態(図15)で
のプログラミング言語変換装置200を構成するすべて
の手段が作成されることとなる。
When the processing in step A120 is completed, the process proceeds to step A40. The processing from step A40 to step A90 is the same as that of the first embodiment (FIG. 5). Then, by ending the processing of step A90, all means constituting the programming language conversion device 200 in this embodiment (FIG. 15) are created.

【0115】次に、プログラミング言語変換プログラム
開発支援装置400において実行されるのための処理、
すなわち図19のステップA110の処理について、図
20のフローチャートを参照して詳しく説明する。
Next, processing to be executed in the programming language conversion program development support device 400
That is, the process of step A110 in FIG. 19 will be described in detail with reference to the flowchart in FIG.

【0116】図20のフローチャートにおいて、ステッ
プC10〜C30の処理は、第1の実施の形態で説明し
たもの(図6)と同じである。ステップC30の処理が
終了すると、次に、抽象構文仕様記憶部120に記憶さ
れている表の各行について、ループ1(ステップC11
0−C110’)の処理を行う。
In the flowchart of FIG. 20, the processing of steps C10 to C30 is the same as that described in the first embodiment (FIG. 6). When the processing in step C30 is completed, loop 1 (step C11) is performed on each row of the table stored in the abstract syntax specification storage unit 120.
0-C110 ').

【0117】ループ1内の処理では、まず、ユーザ付加
プログラム検出手段420は、処理対象となっている行
のクラス名に対応するユーザ付加プログラムファイル4
10が存在するかどうか確認する(ステップC11
5)。対応するユーザ付加プログラムファイル410が
存在しなければ、ステップC140の処理に進む。
In the processing in the loop 1, first, the user additional program detecting means 420 detects the user additional program file 4 corresponding to the class name of the line to be processed.
10 is checked (step C11).
5). If there is no corresponding user additional program file 410, the process proceeds to step C140.

【0118】一方、対応するユーザ付加プログラムファ
イル410が存在する場合には、ユーザ付加プログラム
検出手段420は、当該ユーザ付加プログラムファイル
210を読み込み、これを解析する(ステップC12
0)。そして、ユーザ付加プログラム検出手段420
は、ステップC120での解析の結果、"//--"で始まる
行と"//--"で始まる行で囲まれた部分が存在したらその
囲まれた部分を、また"//**"で始まる行が存在したらそ
の行から以降全てを、抽象構文仕様記憶部120の表の
クラス情報内の付加情報の部分に記憶させる(ステップ
C130)。そして、ステップC140に進む。
On the other hand, if the corresponding user additional program file 410 exists, the user additional program detection means 420 reads the user additional program file 210 and analyzes it (step C12).
0). Then, the user additional program detection means 420
Indicates that if a result of the analysis in step C120 indicates that there is a line enclosed by a line beginning with "//-" and a line beginning with "//-", then the enclosed part is indicated by "// **" If there is a line starting with "", all of the line after that line is stored in the additional information part in the class information of the table in the abstract syntax specification storage unit 120 (step C130). Then, the process proceeds to step C140.

【0119】ステップC140では、抽象構文木アクセ
スプログラム生成手段430は、抽象構文木仕様記憶部
120内の表の各行に対して、対応するファイルを生成
する。そして、抽象構文仕様記憶部120に次の行があ
れば、次の行を処理対象としてループ1の処理を繰り返
し、次の行がなければ、ループ1を抜けることとなる。
ここで、ループ1を抜けたときに、抽象構文木アクセス
プログラム生成手段430によって抽象構文木アクセス
プログラムファイル50が作成されることとなる。
In step C140, the abstract syntax tree access program generation means 430 generates a file corresponding to each row of the table in the abstract syntax tree specification storage unit 120. Then, if there is a next line in the abstract syntax specification storage unit 120, the process of loop 1 is repeated with the next line as a processing target. If there is no next line, the process exits from loop 1.
Here, when the process exits from the loop 1, the abstract syntax tree access program generating means 430 creates the abstract syntax tree access program file 50.

【0120】ループ1(ステップC110−C11
0’)を抜けると、次に、ステップC50の処理に進
む。ステップC50以降、ステップC60までの処理は
第1の実施の形態のもの(図5)と同じである。そし
て、ステップC60の処理を終了することにより、この
フローチャートの処理を終了する。このフローチャート
の処理が終了した場合には、次に上記したステップA4
0の処理が行われることとなる。
Loop 1 (Steps C110-C11)
After exiting from 0 '), the process proceeds to step C50. The processing from step C50 to step C60 is the same as that of the first embodiment (FIG. 5). Then, by ending the processing of Step C60, the processing of this flowchart is ended. When the processing of this flowchart is completed, the next step A4
0 processing is performed.

【0121】なお、上記のようにして開発されたプログ
ラミング言語変換装置200の動作は、第1の実施の形
態で説明した、図7のフローチャートに示すものと実質
的に同一である。
The operation of the programming language conversion device 200 developed as described above is substantially the same as that shown in the flowchart of FIG. 7 described in the first embodiment.

【0122】以下、この実施の形態を、具体的な例を示
して説明する。ここでは、抽象構文木仕様定義ファイル
30として図3に示すファイルを用い、ユーザ付加プロ
グラムファイル410とし図19に示すファイルが"Ex
p.java"というファイル名の場合の、プログラミング言
語変換プログラム開発支援装置100の動作を説明す
る。なお、プログラミング言語開発支援装置100が生
成する抽象構文木ダンププログラムファイル40と抽象
構文木アクセスプログラム50と抽象構文木プログラム
ファイル60を実現するプログラミング言語は、第1の
実施の形態の具体例と同じくJava言語を用いるもの
とする。
Hereinafter, this embodiment will be described with reference to a specific example. Here, the file shown in FIG. 3 is used as the abstract syntax tree specification definition file 30, and the file shown in FIG.
The operation of the programming language conversion program development support device 100 for the file name "p.java" will be described. The abstract syntax tree dump program file 40 and the abstract syntax tree access program 50 generated by the programming language development support device 100 will be described. It is assumed that the programming language for realizing the abstract syntax tree program file 60 uses the Java language as in the specific example of the first embodiment.

【0123】抽象構文木仕様解析手段110は、第1の
実施の形態での具体例と同じように動作して抽象構文木
仕様定義ファイル30を解析し、その解析結果の表を抽
象構文仕様記憶部120に記憶させる。また、意味検査
手段120も、第1の実施の形態での具体例と同じよう
に動作して、抽象構文仕様記憶部120に記憶されてい
る抽象構文木仕様に矛盾がないかどうかをチェックす
る。
The abstract syntax tree specification analyzing means 110 operates in the same manner as in the specific example of the first embodiment, analyzes the abstract syntax tree specification definition file 30, and stores a table of the analysis result in the abstract syntax specification storage. The data is stored in the unit 120. Also, the semantic checking unit 120 operates in the same manner as in the specific example in the first embodiment, and checks whether the abstract syntax tree specification stored in the abstract syntax specification storage unit 120 is consistent. .

【0124】次に、ユーザ付加プログラム検出手段42
0は、図8の表の各行に対して対応するユーザ付加プロ
グラムがあるかチェックする(ステップC110)。抽
象構文木アクセスプログラム50を実現するプログラム
言語がJava言語の場合、図8のクラス名が"Exp"で
ある行に対して"Exp.java"という名のファイルが対応す
るユーザ付加プログラムファイル410となる。
Next, the user additional program detecting means 42
0 checks whether there is a corresponding user additional program for each row of the table of FIG. 8 (step C110). When the programming language for implementing the abstract syntax tree access program 50 is the Java language, a file named "Exp.java" corresponds to a file named "Exp.java" for the line having the class name "Exp" in FIG. Become.

【0125】図18に示すユーザ付加プログラムファイ
ル410には、"//--"で始まる行と"//--"で囲まれた部
分が存在するので、ユーザ付加プログラム検出手段42
0は、この部分を抽象構文木仕様記憶部120内の表の
Expの行のクラス情報の下の付加情報の部分に追加す
る。さらに、"//**"で始まる行が存在するので、ユーザ
付加プログラム検出手段420は、この行以降も抽象構
文木仕様記憶部120内の表のExpの行のクラス情報の
下の付加情報の部分に追加する(ステップC120、C
130)。このような処理によって、抽象構文木仕様記
憶部120内の表は、図21に示す状態となる。但し、
図21内で「略」となっている部分の記述は省略してあ
る。
Since the user-added program file 410 shown in FIG. 18 has a line starting with “//-” and a portion surrounded by “//-”, the user-added program detection means 42
0 represents this part in the table in the abstract syntax tree specification storage unit 120.
Add it to the additional information section below the class information in the Exp line. Further, since there is a line starting with "// **", the user additional program detection means 420 continues to execute the additional information under the class information of the line of "Exp" in the table in the abstract syntax tree specification storage unit 120 after this line. (Step C120, C
130). By such processing, the table in the abstract syntax tree specification storage unit 120 is in the state shown in FIG. However,
In FIG. 21, the description of the part “abbreviated” is omitted.

【0126】次に、抽象構文木アクセスプログラム生成
手段430は、抽象構文木仕様記憶部120内の表の各
行に対して、対応するプログラムファイルを生成する
(ステップC140)。図8の場合を例とすると、全部
で11個のファイルからなる抽象構文木アクセスプログ
ラムファイル50が生成される。この場合、抽象構文木
仕様記憶部120に、クラス名がExpの行に対してはユ
ーザ定義プロクラス名の部分がExpの行に対しては、"Ex
p.java"というファイ名で、図22に示すファイルが生
成される。一方、"Exp.java"以外のファイルは、第1の
実施の形態の具体例で生成したファイルと同じファイル
が生成される。
Next, the abstract syntax tree access program generation means 430 generates a corresponding program file for each row of the table in the abstract syntax tree specification storage unit 120 (Step C140). Taking the case of FIG. 8 as an example, an abstract syntax tree access program file 50 including a total of 11 files is generated. In this case, in the abstract syntax tree specification storage unit 120, for the line having the class name of Exp, the line having the user-defined pro class name of Exp is "Ex
The file shown in Fig. 22 is generated with the file name "p.java". On the other hand, for the files other than "Exp.java", the same files as the files generated in the specific example of the first embodiment are generated. You.

【0127】なお、抽象構文木ダンププログラム生成手
段140と抽象構文木走査プログラム生成手段160は
第1の実施の形態と同様に動作し、第1の実施の形態と
同様の抽象構文木ダンププログラムファイル40と抽象
構文木走査プログラムファイル60とが、それぞれ生成
される。
Note that the abstract syntax tree dump program generating means 140 and the abstract syntax tree scanning program generating means 160 operate in the same manner as in the first embodiment, and have the same abstract syntax tree dump program file as in the first embodiment. 40 and an abstract syntax tree scanning program file 60 are respectively generated.

【0128】以上説明したように、この実施の形態で
は、プログラミング言語変換プログラム開発支援装置4
00は、抽象構文木仕様定義ファイル30を入力とする
と共に、ユーザ付加プログラムファイル410を入力と
している。そして、抽象構文木アクセスプログラム生成
手段430は、ユーザ付加プログラム410に記述して
ある内容を反映して、抽象構文木アクセスプログラムフ
ァイル50を生成している。このため、ユーザの記述に
よって抽象構文木アクセス手段230の機能を拡張する
ことができるようになる。
As described above, in this embodiment, the programming language conversion program development support device 4
00 inputs the abstract syntax tree specification definition file 30 and the user additional program file 410 as input. Then, the abstract syntax tree access program generation means 430 generates the abstract syntax tree access program file 50 by reflecting the contents described in the user additional program 410. Therefore, the function of the abstract syntax tree access unit 230 can be extended by the description of the user.

【0129】[実施の形態の変形]本発明は、上記の第
1、第2の実施の形態に限られず、種々の変形、応用が
可能である。以下、本発明に適用可能な上記の実施の形
態の変形態様について、説明する。
[Modification of Embodiment] The present invention is not limited to the above-described first and second embodiments, and various modifications and applications are possible. Hereinafter, modifications of the above-described embodiment applicable to the present invention will be described.

【0130】上記の第1、第2の実施の形態では、プロ
グラミング言語変換プログラム開発支援装置100、4
00は、抽象構文木ダンププログラムファイル40、抽
象構文木アクセスプログラムファイル50及び抽象構文
木走査プログラムファイル60の3つを生成するものと
していた。また、抽象構文木走査プログラムファイル6
0に基づいて、型検査プログラム編集エディタ62とコ
ード生成プログラム編集エディタ65とが、それぞれ型
検査プログラムファイル63、コード生成プログラムフ
ァイル66を生成するものとしていた。しかしながら、
本発明は、これらの一部のみを生成してプログラミング
言語変換プログラムの開発を支援するものとしてもよ
い。
In the first and second embodiments, the programming language conversion program development support devices 100, 4
00 generates three files, an abstract syntax tree dump program file 40, an abstract syntax tree access program file 50, and an abstract syntax tree scanning program file 60. Also, the abstract syntax tree scanning program file 6
0, the type inspection program editing editor 62 and the code generation program editing editor 65 generate the type inspection program file 63 and the code generation program file 66, respectively. However,
The present invention may generate only a part of these and support the development of a programming language conversion program.

【0131】上記の第1、第2の実施の形態では、プロ
グラミング言語変換プログラム開発支援装置100、4
00は、入力された抽象構文木仕様定義ファイル30に
基づいて、抽象構文木ダンププログラムファイル40を
作成していた。そして、これをコンパイラ70でコンパ
イルし、プログラミング言語変換装置200のメモリの
所定の領域に記憶させることにより、抽象構文木ダンプ
手段90を実現していた。しかしながら、プログラミン
グ言語変換プログラム開発支援装置100、400が抽
象構文木ダンプファイルプログラム40を作成せず、プ
ログラミング言語変換装置200に抽象構文木ダンプ手
段90を付随させないものとしても、プログラミング言
語変換装置200としては動作することが可能である。
In the first and second embodiments, the programming language conversion program development support devices 100, 4
00 created the abstract syntax tree dump program file 40 based on the input abstract syntax tree specification definition file 30. Then, this is compiled by the compiler 70 and stored in a predetermined area of the memory of the programming language conversion device 200, thereby implementing the abstract syntax tree dump means 90. However, even if the programming language conversion program development support devices 100 and 400 do not create the abstract syntax tree dump file program 40 and do not attach the abstract syntax tree dump means 90 to the programming language conversion device 200, the programming language conversion device 200 Can work.

【0132】上記の第1、第2の実施の形態では、プロ
グラミング言語変換プログラム開発支援装置100は、
プログラム制御により動作するデータ処理装置によって
構成され、所定のプログラムを実行することにより、抽
象構文木仕様解析手段110、意味検査手段130、抽
象構文木ダンププログラム生成手段140、抽象構文木
アクセスプログラム生成手段150及び抽象構文木走査
プログラム生成手段160、並びにユーザ付加プログラ
ム検出手段420の機能を実現するものとしていた。ま
た、型検査プログラム編集エディタ62及びコード生成
プログラムエディタ65は、プログラム制御により動作
するデータ処理装置で実行されるものとしていた。
In the first and second embodiments, the programming language conversion program development support device 100
It is configured by a data processing device that operates under program control, and executes a predetermined program to execute an abstract syntax tree specification analysis unit 110, a semantic checking unit 130, an abstract syntax tree dump program generation unit 140, and an abstract syntax tree access program generation unit. 150 and the function of the abstract syntax tree scanning program generation means 160 and the user additional program detection means 420 are realized. Further, the type inspection program editing editor 62 and the code generation program editor 65 are to be executed by a data processing device that operates under program control.

【0133】これに対して、プログラミング言語変換プ
ログラム開発支援装置100の各手段による処理を行わ
せ、各手段の機能を実現するためのプログラム、並びに
型検査プログラム編集エディタ62及びコード生成プロ
グラムエディタ65のプログラムの全部または一部を、
CD−ROMなどのコンピュータ読み取り可能な記録媒
体に格納して配布してもよい。そして、この記録媒体に
記録されたプログラムを汎用コンピュータで読み取らせ
て実行させることにより、上記のプログラミング言語変
換プログラム開発支援系のシステムを構成することがで
きるようになる。
On the other hand, a program for causing each unit of the programming language conversion program development support apparatus 100 to perform processing to realize the function of each unit, and the type inspection program editing editor 62 and the code generation program editor 65 All or part of the program,
The program may be stored in a computer-readable recording medium such as a CD-ROM and distributed. Then, the program recorded on the recording medium is read and executed by a general-purpose computer, whereby the above-described programming language conversion program development support system can be configured.

【0134】[0134]

【発明の効果】以上説明したように、本発明によれば、
中間結果として抽象構文木を使用するプログラミング言
語変換プログラムの全部または一部を少ない工数で開発
することができる。
As described above, according to the present invention,
All or a part of a programming language conversion program that uses an abstract syntax tree as an intermediate result can be developed with a small number of steps.

【0135】また、ユーザが記述したユーザ付加プログ
ラムの内容を反映して抽象構文木アクセスプログラムを
作成できるようにしたことによって、抽象構文木アクセ
スプログラムの機能を拡張することができるようにな
る。
In addition, since the abstract syntax tree access program can be created by reflecting the contents of the user-added program described by the user, the function of the abstract syntax tree access program can be extended.

【0136】さらに、ダンププログラムを生成すること
ができるようにすることで、プログラミング言語の変換
時に中間結果として内部記憶される抽象構文木の状態を
ユーザが確認できるようになる。
Further, by making it possible to generate a dump program, a user can confirm the state of an abstract syntax tree which is internally stored as an intermediate result during conversion of a programming language.

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

【図1】本発明の第1の実施の形態にかかるプログラミ
ング言語変換プログラム開発支援系のシステム、及びこ
のシステムから得られたプログラムによって実現される
プログラミング言語変換装置の機能ブロック図である。
FIG. 1 is a functional block diagram of a programming language conversion program development support system according to a first embodiment of the present invention and a programming language conversion device realized by a program obtained from the system.

【図2】図1のプログラミング言語開発支援装置の構成
を詳細に示すブロック図である。
FIG. 2 is a block diagram showing a configuration of the programming language development support device of FIG. 1 in detail.

【図3】図1、図2の抽象構文木仕様定義ファイルの記
述例を示す図である。
FIG. 3 is a diagram showing a description example of an abstract syntax tree specification definition file of FIGS. 1 and 2;

【図4】図2の抽象構文仕様記憶部の記憶内容を示す図
である。
FIG. 4 is a diagram showing storage contents of an abstract syntax specification storage unit in FIG. 2;

【図5】図1のプログラミング言語変換プログラム開発
支援系のシステムにおいて、抽象構文木定義ファイルに
基づいてプログラムの開発を支援し、プログラミング言
語変換装置を生成するまでの流れを示すフローチャート
である。
FIG. 5 is a flowchart showing a flow in the system of the programming language conversion program development support system of FIG. 1 from support of program development based on an abstract syntax tree definition file to generation of a programming language conversion device.

【図6】図1、図2のプログラミング言語変換プログラ
ム開発支援装置において実行される処理を示すフローチ
ャートである。
FIG. 6 is a flowchart showing processing executed in the programming language conversion program development support device of FIGS. 1 and 2;

【図7】図1のプログラミング言語変換装置の動作を示
すフローチャートである。
FIG. 7 is a flowchart showing an operation of the programming language conversion device of FIG. 1;

【図8】本発明の第1の実施の形態の具体例において、
抽象構文木仕様記憶部に記憶される表を示す図である。
FIG. 8 shows a specific example of the first embodiment of the present invention.
FIG. 4 is a diagram illustrating a table stored in an abstract syntax tree specification storage unit.

【図9】本発明の第1の実施の形態の具体例において作
成される抽象構文木アクセスプログラムファイルを示す
図である。
FIG. 9 is a diagram showing an abstract syntax tree access program file created in a specific example of the first exemplary embodiment of the present invention.

【図10】本発明の第1の実施の形態の具体例において
作成される抽象構文木アクセスプログラムファイルを示
す図である。
FIG. 10 is a diagram showing an abstract syntax tree access program file created in a specific example of the first exemplary embodiment of the present invention.

【図11】本発明の第1の実施の形態の具体例において
作成される抽象構文木走査プログラムファイルを示す図
である。
FIG. 11 is a diagram showing an abstract syntax tree scanning program file created in a specific example of the first embodiment of the present invention.

【図12】(a)は、本発明の第1の実施の形態の具体
例における抽象構文木記憶部に記憶される抽象構文木の
状態を、(b)は、(a)の抽象構文木の状態を抽象構
文木ダンプ手段によってダンプした抽象構文木ダンプフ
ァイルを示す図である。
12A is a diagram illustrating a state of an abstract syntax tree stored in an abstract syntax tree storage unit according to a specific example of the first embodiment of the present invention, and FIG. 12B is a diagram illustrating an abstract syntax tree of FIG. FIG. 7 is a diagram showing an abstract syntax tree dump file obtained by dumping the state of FIG.

【図13】本発明の第1の実施の形態の具体例における
型検査用アクションの記述例を示す図である。
FIG. 13 is a diagram illustrating a description example of a type checking action in a specific example of the first embodiment of the present invention.

【図14】本発明の第1の実施の形態の具体例における
コード生成用アクションの記述例を示す図である。
FIG. 14 is a diagram illustrating a description example of a code generation action in a specific example of the first embodiment of the present invention.

【図15】本発明の第2の実施の形態にかかるプログラ
ミング言語変換プログラム開発支援系のシステム、及び
このシステムから得られたプログラムによって実現され
るプログラミング言語変換装置の機能ブロック図であ
る。
FIG. 15 is a functional block diagram of a programming language conversion program development support system according to a second embodiment of the present invention and a programming language conversion device realized by a program obtained from the system.

【図16】図15のプログラミング言語開発支援装置の
構成を詳細に示すブロック図である。
16 is a block diagram showing the configuration of the programming language development support device of FIG. 15 in detail.

【図17】図15、図16のユーザ付加プログラムファ
イルの文法を示す図である。
FIG. 17 is a diagram showing the grammar of the user additional program file of FIGS. 15 and 16;

【図18】図15、図16のユーザ付加プログラムファ
イルの記述例を示す図である。
FIG. 18 is a diagram showing a description example of a user additional program file of FIGS. 15 and 16;

【図19】図15のプログラミング言語変換プログラム
開発支援系のシステムにおいて、抽象構文木定義ファイ
ルに基づいてプログラムの開発を支援し、プログラミン
グ言語変換装置を生成するまでの流れを示すフローチャ
ートである。
FIG. 19 is a flowchart showing a flow of supporting a program development based on an abstract syntax tree definition file and generating a programming language conversion device in the programming language conversion program development support system of FIG.

【図20】図15、図16のプログラミング言語変換プ
ログラム開発支援装置において実行される処理を示すフ
ローチャートである。
FIG. 20 is a flowchart showing processing executed in the programming language conversion program development support device of FIGS. 15 and 16;

【図21】本発明の第2の実施の形態の具体例におい
て、抽象構文木仕様記憶部に記憶される表を示す図であ
る。
FIG. 21 is a diagram illustrating a table stored in an abstract syntax tree specification storage unit in a specific example of the second exemplary embodiment of the present invention.

【図22】本発明の第2の実施の形態の具体例において
作成される抽象構文木アクセスプログラムファイルを示
す図である。
FIG. 22 is a diagram showing an abstract syntax tree access program file created in a specific example of the second exemplary embodiment of the present invention.

【図23】従来例にかかるプログラミング言語変換装置
の構成を示すブロック図である。
FIG. 23 is a block diagram showing a configuration of a programming language conversion device according to a conventional example.

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

10 上位言語入力ファイル 20 下位言語プログラムファイル 30 抽象構文木仕様定義ファイル 40 抽象構文木ダンププログラムファイル 50 抽象構文木アクセスプログラムファイル 60 抽象構文木プログラムファイル 61 型検査用アクション 62 型検査プログラム編集エディタ 63 型検査プログラムファイル 64 コード生成用アクション 65 コード生成プログラム編集エディタ 66 コード生成プログラムファイル 70 コンパイラ 80 抽象構文木ダンプファイル 90 抽象構文木ダンプ手段 100 プログラミング言語変換プログラム開発支援装
置 110 抽象構文木仕様解析手段 120 抽象構文仕様記憶部 130 意味検査手段 140 抽象構文木ダンププログラム生成手段 150 抽象構文木アクセスプログラム生成手段 160 抽象構文木走査プログラム生成手段 200 プログラミング言語変換装置 210 構文解析手段 220 抽象構文木記憶部 230 抽象構文木アクセス手段 240 型検査手段 250 コード生成手段 400 プログラミング言語変換プログラム開発支援装
置 410 ユーザ付加プログラムファイル 420 ユーザ付加プログラム検出手段 430 抽象構文木アクセスプログラム生成手段
DESCRIPTION OF SYMBOLS 10 Upper language input file 20 Lower language program file 30 Abstract syntax tree specification definition file 40 Abstract syntax tree dump program file 50 Abstract syntax tree access program file 60 Abstract syntax tree program file 61 Type check action 62 Type check program editing editor 63 Type Inspection program file 64 Code generation action 65 Code generation program editing editor 66 Code generation program file 70 Compiler 80 Abstract syntax tree dump file 90 Abstract syntax tree dump means 100 Programming language conversion program development support device 110 Abstract syntax tree specification analysis means 120 Abstract Syntax specification storage unit 130 Semantic checking unit 140 Abstract syntax tree dump program generation unit 150 Abstract syntax tree access program generation unit Reference Signs List 60 abstract syntax tree scanning program generation means 200 programming language conversion device 210 syntax analysis means 220 abstract syntax tree storage unit 230 abstract syntax tree access means 240 type checking means 250 code generation means 400 programming language conversion program development support device 410 user additional program file 420 user additional program detection means 430 abstract syntax tree access program generation means

Claims (21)

【特許請求の範囲】[Claims] 【請求項1】中間結果として記憶される抽象構文木を使
用して、第1のプログラミング言語で記述されたプログ
ラムを第2のプログラミング言語で記述されたプログラ
ムに変換するためのプログラミング言語変換プログラム
の開発を支援するためのシステムであって、 前記抽象構文木の仕様を入力し、該入力した抽象構文木
仕様を解析する抽象構文木仕様解析手段と、 前記抽象構文木仕様解析手段の解析結果を記憶する抽象
構文木仕様記憶手段と、 前記抽象構文木仕様記憶手段に記憶した前記抽象構文木
仕様の解析結果に基づいて、前記第2のプログラミング
言語へ変換するときに前記記憶された抽象構文木を参照
するための方法を記述したプログラムを生成する抽象構
文木アクセスプログラム生成手段と、 前記抽象構文木仕様記憶手段に記憶した前記抽象構文木
仕様の解析結果に基づいて、前記第2のプログラミング
言語へ変換するときに前記記憶された抽象構文木をたど
るための方法を記述したプログラムを生成する抽象構文
木走査プログラム生成手段と、 を備えることを特徴とするプログラミング言語変換プロ
グラム開発支援システム。
A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A system for supporting development, comprising: an abstract syntax tree specification analyzing means for inputting the specification of the abstract syntax tree and analyzing the input abstract syntax tree specification; and Means for storing an abstract syntax tree specification to be stored, and the stored abstract syntax tree when converting to the second programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage means. An abstract syntax tree access program generating means for generating a program describing a method for referring to the abstract syntax tree specification storing means; Abstract syntax tree scanning program generation for generating a program describing a method for tracing the stored abstract syntax tree when converting to the second programming language based on the analysis result of the stored abstract syntax tree specification Means, and a programming language conversion program development support system characterized by comprising:
【請求項2】前記抽象構文木走査プログラム生成手段が
生成したプログラムに、該プログラムの実行により前記
抽象構文木をたどったときに情報を収集して、該収集し
た情報に基づいて前記中間結果として記憶された抽象構
文木がもつ型に関する情報を検査する部分を記述した型
検査アクションを付加することによって、前記抽象構文
木アクセスプログラム生成手段が生成したプログラムを
参照しながら前記中間結果として記憶された抽象構文木
がもつ型に関する情報を検査するためのプログラムを生
成する型検査プログラム生成手段と、 前記抽象構文木走査プログラム生成手段が生成したプロ
グラムに、該プログラムの実行により前記抽象構文木を
たどったときに情報を収集して、該収集した情報に基づ
いて前記中間結果として記憶された抽象構文木から前記
第2のプログラミング言語によるコード情報を生成する
部分を記述したコード生成アクションを付加することに
よって、前記抽象構文木アクセスプログラム生成手段が
生成したプログラムを参照しながら前記中間結果として
記憶された抽象構文木から前記第2のプログラミング言
語によるコード情報を生成するためのプログラムを生成
するコード生成プログラム生成手段とをさらに備えるこ
とを特徴とする請求項1に記載のプログラミング言語変
換プログラム開発支援システム。
2. The method according to claim 1, wherein the information generated by the abstract syntax tree scanning program generating means is collected when the abstract syntax tree is traced by executing the program, and the intermediate result is obtained based on the collected information. By adding a type checking action describing a part for checking information about a type of the stored abstract syntax tree, the intermediate result is stored as the intermediate result while referring to a program generated by the abstract syntax tree access program generating means. A type checking program generating means for generating a program for checking information on a type included in the abstract syntax tree; and a program generated by the abstract syntax tree scanning program generating means, following the abstract syntax tree by executing the program. Sometimes information was collected and stored as the intermediate result based on the collected information By adding a code generation action describing a part for generating code information in the second programming language from an abstract syntax tree, storing the intermediate result as the intermediate result while referring to a program generated by the abstract syntax tree access program generating means. 2. The programming language conversion program development support according to claim 1, further comprising code generation program generation means for generating a program for generating code information in the second programming language from the abstract syntax tree obtained. system.
【請求項3】前記抽象構文木アクセスプログラム生成手
段により生成されるプログラムに対してユーザが定義し
たプログラムを入力し、該入力したユーザが定義したプ
ログラムを解析して、その解析結果を前記抽象構文木仕
様記憶手段に記憶させるユーザ定義プログラム検出手段
をさらに備えることを特徴とする請求項1または2に記
載のプログラミング言語変換プログラム開発支援システ
ム。
3. A user-defined program is input to a program generated by the abstract syntax tree access program generating means, the input user-defined program is analyzed, and a result of the analysis is used as the abstract syntax tree access program. 3. The programming language conversion program development support system according to claim 1, further comprising a user-defined program detection unit stored in the tree specification storage unit.
【請求項4】前記抽象構文木仕様記憶手段に記憶した前
記抽象構文木仕様の解析結果に基づいて、プログラミン
グ言語の変換時に中間結果として記憶された抽象構文木
の状態をダンプするための方法を記述したプログラムを
生成する抽象構文木ダンププログラム生成手段をさらに
備えることを特徴とする請求項1乃至3のいずれか1項
に記載のプログラミング言語変換プログラム開発支援シ
ステム。
4. A method for dumping a state of an abstract syntax tree stored as an intermediate result when converting a programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage means. The programming language conversion program development support system according to any one of claims 1 to 3, further comprising an abstract syntax tree dump program generating means for generating the described program.
【請求項5】前記抽象構文木仕様記憶手段に記憶した前
記抽象構文木仕様の解析結果に矛盾がないかどうかを検
査する意味検査手段をさらに備えることを特徴とする請
求項1乃至4のいずれか1項に記載のプログラミング言
語変換プログラム開発支援システム。
5. The apparatus according to claim 1, further comprising a semantic checking unit configured to check whether there is any inconsistency in the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage unit. 2. The programming language conversion program development support system according to claim 1.
【請求項6】前記抽象構文木アクセスプログラム生成手
段により生成されるプログラムと前記抽象構文木走査プ
ログラム生成手段により生成されるプログラムとは、オ
ブジェクト指向プログラミング言語により記述され、 前記抽象構文木仕様解析手段は、前記抽象構文木仕様に
含まれるクラス名と、該クラス名に対応するクラスタイ
プと、該クラス名に対応するクラスに関する情報とを認
識して抽出するものであり、 前記抽象構文木仕様記憶手段は、前記抽象構文木仕様解
析手段によって抽出されたクラス名と、クラスタイプ
と、クラスに関する情報とを、それぞれ表の各行に対応
付けて記憶することを特徴とする請求項1乃至5のいず
れか1項に記載のプログラミング言語変換プログラム開
発支援システム。
6. A program generated by said abstract syntax tree access program generation means and a program generated by said abstract syntax tree scanning program generation means are described in an object-oriented programming language, and said abstract syntax tree specification analysis means is provided. Is for recognizing and extracting a class name included in the abstract syntax tree specification, a class type corresponding to the class name, and information on a class corresponding to the class name. 6. The method according to claim 1, wherein the means stores the class name, the class type, and the information related to the class extracted by the abstract syntax tree specification analyzing means in association with each row of the table. 2. The programming language conversion program development support system according to claim 1.
【請求項7】前記抽象構文木アクセスプログラム生成手
段は、前記抽象構文木仕様記憶手段の表の各行のそれぞ
れに対して、プログラムファイルを生成することを特徴
とする請求項6に記載のプログラミング言語変換プログ
ラム開発支援システム。
7. The programming language according to claim 6, wherein said abstract syntax tree access program generation means generates a program file for each row of a table of said abstract syntax tree specification storage means. Conversion program development support system.
【請求項8】中間結果として記憶される抽象構文木を使
用して、第1のプログラミング言語で記述されたプログ
ラムを第2のプログラミング言語で記述されたプログラ
ムに変換するためのプログラミング言語変換プログラム
の開発を支援するためのシステムであって、 前記抽象構文木の仕様を入力し、該入力した抽象構文木
仕様を解析する抽象構文木仕様解析手段と、 前記抽象構文木仕様解析手段の解析結果を記憶する抽象
構文木仕様記憶手段と、 前記抽象構文木仕様記憶手段に記憶した前記抽象構文木
仕様の解析結果に基づいて、前記第2のプログラミング
言語へ変換するときに前記記憶された抽象構文木を参照
するための方法を記述したプログラムを生成する抽象構
文木アクセスプログラム生成手段とを備えることを特徴
とするプログラミング言語変換プログラム開発支援シス
テム。
8. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A system for supporting development, comprising: an abstract syntax tree specification analyzing means for inputting the specification of the abstract syntax tree and analyzing the input abstract syntax tree specification; and Means for storing an abstract syntax tree specification to be stored, and the stored abstract syntax tree when converting to the second programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage means. Abstract syntax tree access program generating means for generating a program describing a method for referring to a program Timing language conversion program development support system.
【請求項9】中間結果として記憶される抽象構文木を使
用して、第1のプログラミング言語で記述されたプログ
ラムを第2のプログラミング言語で記述されたプログラ
ムに変換するためのプログラミング言語変換プログラム
の開発を支援するためのシステムであって、 前記抽象構文木の仕様を入力し、該入力した抽象構文木
仕様を解析する抽象構文木仕様解析手段と、 前記抽象構文木仕様解析手段の解析結果を記憶する抽象
構文木仕様記憶手段と、 前記抽象構文木仕様記憶手段に記憶した前記抽象構文木
仕様の解析結果に基づいて、前記第2のプログラミング
言語へ変換するときに前記記憶された抽象構文木をたど
るための方法を記述したプログラムを生成する抽象構文
木走査プログラム生成手段とを備えることを特徴とする
プログラミング言語変換プログラム開発支援システム。
9. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A system for supporting development, comprising: an abstract syntax tree specification analyzing means for inputting the specification of the abstract syntax tree and analyzing the input abstract syntax tree specification; and Means for storing an abstract syntax tree specification to be stored, and the stored abstract syntax tree when converting to the second programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage means. Program for generating an abstract syntax tree scanning program for generating a program describing a method for following Language conversion program development support system.
【請求項10】前記抽象構文木走査プログラム生成手段
が生成したプログラムに、該プログラムの実行により前
記抽象構文木をたどったときに情報を収集して、該収集
した情報に基づいて前記中間結果として記憶された抽象
構文木がもつ型に関する情報を検査する部分を記述した
型検査アクションを付加することによって、前記抽象構
文木アクセスプログラム生成手段が生成したプログラム
を参照しながら前記中間結果として記憶された抽象構文
木がもつ型に関する情報を検査するためのプログラムを
生成する型検査プログラム生成手段をさらに備えること
を特徴とする請求項9に記載のプログラミング言語変換
プログラム開発支援システム。
10. A program generated by the abstract syntax tree scanning program generating means, wherein information is collected when the abstract syntax tree is traced by executing the program, and as the intermediate result based on the collected information. By adding a type checking action describing a part for checking information about a type of the stored abstract syntax tree, the intermediate result is stored as the intermediate result while referring to a program generated by the abstract syntax tree access program generating means. 10. The programming language conversion program development support system according to claim 9, further comprising a type check program generating means for generating a program for checking information on a type included in the abstract syntax tree.
【請求項11】前記抽象構文木走査プログラム生成手段
が生成したプログラムに、該プログラムの実行により前
記抽象構文木をたどったときに情報を収集して、該収集
した情報に基づいて前記中間結果として記憶された抽象
構文木から前記第2のプログラミング言語によるコード
情報を生成する部分を記述したコード生成アクションを
付加することによって、前記抽象構文木アクセスプログ
ラム生成手段が生成したプログラムを参照しながら前記
中間結果として記憶された抽象構文木から前記第2のプ
ログラミング言語によるコード情報を生成するためのプ
ログラムを生成するコード生成プログラム生成手段とを
さらに備えることを特徴とする請求項9または10に記
載のプログラミング言語変換プログラム開発支援システ
ム。
11. The method according to claim 1, wherein the information generated by the abstract syntax tree scanning program generating means is collected when the abstract syntax tree is traced by executing the program, and the intermediate result is obtained based on the collected information. By adding a code generation action describing a part for generating the code information in the second programming language from the stored abstract syntax tree, the intermediate syntax is referred to by referring to the program generated by the abstract syntax tree access program generation means. The programming method according to claim 9, further comprising: a code generation program generating unit configured to generate a program for generating code information in the second programming language from the abstract syntax tree stored as a result. Language conversion program development support system.
【請求項12】中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するための方法であって、 前記抽象構文木の仕様を入力し、該入力した抽象構文木
仕様を解析する抽象構文木仕様解析ステップと、 前記抽象構文木仕様解析ステップでの解析結果を記憶す
る抽象構文木仕様記憶ステップと、 前記抽象構文木仕様記憶ステップで記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
参照するための方法を記述したプログラムを生成する抽
象構文木アクセスプログラム生成ステップと、 前記抽象構文木仕様記憶ステップで記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
たどるための方法を記述したプログラムを生成する抽象
構文木走査プログラム生成ステップとを含むことを特徴
とするプログラミング言語変換プログラム開発支援方
法。
12. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A method for supporting development, comprising: an abstract syntax tree specification analyzing step of inputting the abstract syntax tree specification and analyzing the input abstract syntax tree specification; and an analysis result in the abstract syntax tree specification analyzing step. An abstract syntax tree specification storing step of storing the abstract syntax tree specification stored in the abstract syntax tree specification storage step. Generating an abstract syntax tree access program for generating a program describing a method for referencing a tree; Based on the analysis result of the abstract syntax tree specification stored in the syntax tree specification storage step, generate a program describing a method for following the stored abstract syntax tree when converting to the second programming language. A method for supporting development of a programming language conversion program, comprising an abstract syntax tree scanning program generation step.
【請求項13】前記抽象構文木走査プログラム生成ステ
ップで生成したプログラムに、該プログラムの実行によ
り前記抽象構文木をたどったときに情報を収集して、該
収集した情報に基づいて前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査する部分を記述
した型検査アクションを付加することによって、前記抽
象構文木アクセスプログラム生成ステップで生成したプ
ログラムを参照しながら前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査するためのプロ
グラムを生成する型検査プログラム生成ステップと、 前記抽象構文木走査プログラム生成ステップで生成した
プログラムに、該プログラムの実行により前記抽象構文
木をたどったときに情報を収集して、該収集した情報に
基づいて前記中間結果として記憶された抽象構文木から
前記第2のプログラミング言語によるコード情報を生成
する部分を記述したコード生成アクションを付加するこ
とによって、前記抽象構文木アクセスプログラム生成ス
テップで生成したプログラムを参照しながら前記中間結
果として記憶された抽象構文木から前記第2のプログラ
ミング言語によるコード情報を生成するためのプログラ
ムを生成するコード生成プログラム生成ステップとをさ
らに含むことを特徴とする請求項12に記載のプログラ
ミング言語変換プログラム開発支援方法。
13. A program generated in the step of generating an abstract syntax tree scanning program, wherein information is collected when the abstract syntax tree is traced by executing the program, and the intermediate result is obtained as the intermediate result based on the collected information. By adding a type check action describing a part for checking information on a type of the stored abstract syntax tree, the type is stored as the intermediate result while referring to the program generated in the abstract syntax tree access program generation step. A type checking program generating step of generating a program for checking information on a type included in the abstract syntax tree; and a program generated in the abstract syntax tree scanning program generating step, following the abstract syntax tree by executing the program. Sometimes information is collected and the intermediate conclusion is made based on the collected information. By adding a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as a result, while referring to the program generated in the abstract syntax tree access program generation step. 13. The code generation program according to claim 12, further comprising: a code generation program generation step of generating a program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result. Language conversion program development support method.
【請求項14】前記抽象構文木アクセスプログラム生成
ステップで生成されるプログラムに対してユーザが定義
したプログラムを入力し、該入力したユーザが定義した
プログラムを解析して、その解析結果を前記抽象構文木
仕様記憶ステップで記憶した抽象構文木仕様と対応させ
て記憶させるユーザ定義プログラム検出ステップをさら
に含むことを特徴とする請求項12または13に記載の
プログラミング言語変換プログラム開発支援方法。
14. A user-defined program is input to a program generated in the abstract syntax tree access program generating step, and the input user-defined program is analyzed. 14. The programming language conversion program development supporting method according to claim 12, further comprising a user-defined program detecting step of storing the abstract syntax tree specification stored in the tree specification storing step in association with the abstract syntax tree specification.
【請求項15】前記抽象構文木仕様記憶ステップで記憶
した前記抽象構文木仕様の解析結果に基づいて、プログ
ラミング言語の変換時に中間結果として記憶された抽象
構文木の状態をダンプするための方法を記述したプログ
ラムを生成する抽象構文木ダンププログラム生成ステッ
プをさらに含むことを特徴とする請求項12乃至14の
いずれか1項に記載のプログラミング言語変換プログラ
ム開発支援方法。
15. A method for dumping a state of an abstract syntax tree stored as an intermediate result when converting a programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage step. 15. The method according to claim 12, further comprising a step of generating an abstract syntax tree dump program for generating the described program.
【請求項16】中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するための方法であって、 前記抽象構文木の仕様を定義した抽象構文木仕様定義フ
ァイルを作成するステップと、 前記抽象構文木仕様定義ファイルを読み込んで、これを
解析するステップと、 前記抽象構文木仕様定義ファイルの解析結果を記憶する
ステップと、 記憶した前記抽象構文木仕様定義ファイルの解析結果に
基づいて、プログラミング言語の変換時に前記抽象構文
木を参照するための方法を記述した抽象構文木アクセス
プログラムを生成するステップと、 記憶した前記抽象構文木仕様定義ファイルの解析結果に
基づいて、プログラミング言語の変換時に前記抽象構文
木をたどるための方法を記述した抽象構文木走査プログ
ラムを生成するステップと、 記憶した前記抽象構文木仕様定義ファイルの解析結果に
基づいて、プログラミング言語の変換時に中間結果とし
て記憶された抽象構文木の状態をダンプするための抽象
構文木ダンププログラムを生成するステップと、 生成された抽象構文木ダンププログラムの実行により、
前記中間結果として記憶された抽象構文木の状態をダン
プして、前記抽象構文木が適切に作成されているかどう
かを確認するステップと、 生成された前記抽象構文木走査プログラムに、前記抽象
構文木走査プログラムの実行により前記抽象構文木をた
どったときに情報を収集して、該収集した情報に基づい
て前記中間結果として記憶された抽象構文木がもつ型に
関する情報を検査する部分を記述した型検査アクション
を付加することによって、生成された前記抽象構文木ア
クセスプログラムを参照しながら前記中間結果として記
憶された抽象構文木がもつ型に関する情報を検査するた
めの型検査プログラムを生成するステップと、 生成された前記抽象構文木走査プログラムに、前記抽象
構文木走査プログラムの実行により前記抽象構文木をた
どったときに情報を収集して、該収集した情報に基づい
て前記中間結果として記憶された抽象構文木から前記第
2のプログラミング言語によるコード情報を生成する部
分を記述したコード生成アクションを付加することによ
って、生成された前記抽象構文木アクセスプログラムを
参照しながら前記中間結果として記憶された抽象構文木
から前記第2のプログラミング言語によるコード情報を
生成するためのコード生成プログラムを生成するステッ
プとを含むことを特徴とするプログラミング言語変換プ
ログラム開発支援方法。
16. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A method for supporting development, comprising: creating an abstract syntax tree specification definition file that defines the abstract syntax tree specification; reading the abstract syntax tree specification definition file and analyzing it; A step of storing an analysis result of the abstract syntax tree specification definition file; and a method of referring to the abstract syntax tree at the time of programming language conversion based on the stored analysis result of the abstract syntax tree specification definition file. Generating an abstract syntax tree access program; and storing the abstract syntax tree specification definition file. Generating an abstract syntax tree scanning program describing a method for tracing the abstract syntax tree at the time of programming language conversion, based on the analysis result of the abstract syntax tree specification definition file. Generating an abstract syntax tree dump program for dumping the state of the abstract syntax tree stored as an intermediate result during the conversion of the programming language, and executing the generated abstract syntax tree dump program.
Dumping the state of the abstract syntax tree stored as the intermediate result to check whether the abstract syntax tree has been properly created; and A type that describes a part that collects information when the abstract syntax tree is traced by executing a scanning program, and that checks information about the type of the abstract syntax tree stored as the intermediate result based on the collected information. Generating a type check program for checking information on a type of the abstract syntax tree stored as the intermediate result while referring to the generated abstract syntax tree access program by adding a check action; The abstract syntax tree scanning program is generated by executing the abstract syntax tree scanning program. When the information is collected, information is collected, and a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information is added. Generating a code generation program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result while referring to the generated abstract syntax tree access program. A programming language conversion program development support method characterized by including:
【請求項17】中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するための方法であって、 前記抽象構文木の仕様を定義した抽象構文木仕様定義フ
ァイルを作成するステップと、 前記第1のプログラミング言語に対してユーザが定義し
たプログラムの文法を記述したユーザ付加プログラムフ
ァイルを作成するステップと、 前記抽象構文木仕様定義ファイルを読み込んで、これを
解析するステップと、 前記抽象構文木仕様定義ファイルの解析結果を記憶する
ステップと、 前記ユーザ付加プログラムファイルを参照しながら、記
憶した前記抽象構文木仕様定義ファイルの解析結果に基
づいて、プログラミング言語の変換時に前記抽象構文木
を参照するための方法を記述した抽象構文木アクセスプ
ログラムを生成するステップと、 記憶した前記抽象構文木仕様定義ファイルの解析結果に
基づいて、プログラミング言語の変換時に前記抽象構文
木をたどるための方法を記述した抽象構文木走査プログ
ラムを生成するステップと、 記憶した前記抽象構文木仕様定義ファイルの解析結果に
基づいて、プログラミング言語の変換時に中間結果とし
て記憶された抽象構文木の状態をダンプするための抽象
構文木ダンププログラムを生成するステップと、 生成された抽象構文木ダンププログラムの実行により、
前記中間結果として記憶された抽象構文木の状態をダン
プして、前記抽象構文木が適切に作成されているかどう
かを確認するステップと、 生成された前記抽象構文木走査プログラムに、前記抽象
構文木走査プログラムの実行により前記抽象構文木をた
どったときに情報を収集して、該収集した情報に基づい
て前記中間結果として記憶された抽象構文木がもつ型に
関する情報を検査する部分を記述した型検査アクション
を付加することによって、生成された前記抽象構文木ア
クセスプログラムを参照しながら前記中間結果として記
憶された抽象構文木がもつ型に関する情報を検査するた
めの型検査プログラムを生成するステップと、 生成された前記抽象構文木走査プログラムに、前記抽象
構文木走査プログラムの実行により前記抽象構文木をた
どったときに情報を収集して、該収集した情報に基づい
て前記中間結果として記憶された抽象構文木から前記第
2のプログラミング言語によるコード情報を生成する部
分を記述したコード生成アクションを付加することによ
って、生成された前記抽象構文木アクセスプログラムを
参照しながら前記中間結果として記憶された抽象構文木
から前記第2のプログラミング言語によるコード情報を
生成するためのコード生成プログラムを生成するステッ
プとを含むことを特徴とするプログラミング言語変換プ
ログラム開発支援方法。
17. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. A method for supporting development, comprising: creating an abstract syntax tree specification definition file that defines the abstract syntax tree specification; and describing a grammar of a program defined by a user for the first programming language. Creating the user-added program file, reading the abstract syntax tree specification definition file, and analyzing the same; storing the analysis result of the abstract syntax tree specification definition file; The abstract syntax tree specification definition file stored while referring to Generating an abstract syntax tree access program describing a method for referring to the abstract syntax tree at the time of conversion of a programming language based on the analysis result, based on the analysis result of the stored abstract syntax tree specification definition file Generating an abstract syntax tree scanning program describing a method for tracing the abstract syntax tree at the time of conversion of the programming language; and Generating an abstract syntax tree dump program for dumping the state of the abstract syntax tree stored as an intermediate result; and executing the generated abstract syntax tree dump program.
Dumping the state of the abstract syntax tree stored as the intermediate result to check whether the abstract syntax tree has been properly created; and A type that describes a part that collects information when the abstract syntax tree is traced by executing a scanning program, and that checks information about the type of the abstract syntax tree stored as the intermediate result based on the collected information. Generating a type check program for checking information on a type of the abstract syntax tree stored as the intermediate result while referring to the generated abstract syntax tree access program by adding a check action; The abstract syntax tree scanning program is generated by executing the abstract syntax tree scanning program. When the information is collected, information is collected, and a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result based on the collected information is added. Generating a code generation program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result while referring to the generated abstract syntax tree access program. A programming language conversion program development support method characterized by including:
【請求項18】中間結果として記憶される抽象構文木を
使用して、第1のプログラミング言語で記述されたプロ
グラムを第2のプログラミング言語で記述されたプログ
ラムに変換するためのプログラミング言語変換プログラ
ムの開発を支援するためのプログラムを記録した記録媒
体であって、 前記抽象構文木の仕様を入力し、該入力した抽象構文木
仕様を解析する抽象構文木仕様解析ステップと、 前記抽象構文木仕様解析ステップでの解析結果を記憶す
る抽象構文木仕様記憶ステップと、 前記抽象構文木仕様記憶ステップで記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
参照するための方法を記述したプログラムを生成する抽
象構文木アクセスプログラム生成ステップと、 前記抽象構文木仕様記憶ステップで記憶した前記抽象構
文木仕様の解析結果に基づいて、前記第2のプログラミ
ング言語へ変換するときに前記記憶された抽象構文木を
たどるための方法を記述したプログラムを生成する抽象
構文木走査プログラム生成ステップとを実行するための
プログラムを記録することを特徴とするコンピュータ読
み取り可能な記録媒体。
18. A programming language conversion program for converting a program written in a first programming language into a program written in a second programming language using an abstract syntax tree stored as an intermediate result. An abstract syntax tree specification analysis step of inputting the specification of the abstract syntax tree and analyzing the input abstract syntax tree specification, the storage medium storing a program for supporting development. An abstract syntax tree specification storing step of storing an analysis result in the step; and performing an conversion to the second programming language based on the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage step. Abstract syntax tree access program for generating a program describing a method for referencing a stored abstract syntax tree And a method for tracing the stored abstract syntax tree when converting to the second programming language based on the analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage step. A computer-readable recording medium for recording a program for executing an abstract syntax tree scanning program generating step of generating a described program.
【請求項19】前記抽象構文木走査プログラム生成ステ
ップで生成したプログラムに、該プログラムの実行によ
り前記抽象構文木をたどったときに情報を収集して、該
収集した情報に基づいて前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査する部分を記述
した型検査アクションを付加することによって、前記抽
象構文木アクセスプログラム生成ステップで生成したプ
ログラムを参照しながら前記中間結果として記憶された
抽象構文木がもつ型に関する情報を検査するためのプロ
グラムを生成する型検査プログラム生成ステップと、 前記抽象構文木走査プログラム生成ステップで生成した
プログラムに、該プログラムの実行により前記抽象構文
木をたどったときに情報を収集して、該収集した情報に
基づいて前記中間結果として記憶された抽象構文木から
前記第2のプログラミング言語によるコード情報を生成
する部分を記述したコード生成アクションを付加するこ
とによって、前記抽象構文木アクセスプログラム生成ス
テップで生成したプログラムを参照しながら前記中間結
果として記憶された抽象構文木から前記第2のプログラ
ミング言語によるコード情報を生成するためのプログラ
ムを生成するコード生成プログラム生成ステップとを実
行するためのプログラムをさらに記録することを特徴と
する請求項18に記載のコンピュータ読み取り可能な記
録媒体。
19. A program generated in the step of generating an abstract syntax tree scanning program collects information when the abstract syntax tree is traced by executing the program, and as the intermediate result based on the collected information. By adding a type check action describing a part for checking information on a type of the stored abstract syntax tree, the type is stored as the intermediate result while referring to the program generated in the abstract syntax tree access program generation step. A type checking program generating step of generating a program for checking information on a type included in the abstract syntax tree; and a program generated in the abstract syntax tree scanning program generating step, following the abstract syntax tree by executing the program. Sometimes information is collected and the intermediate conclusion is made based on the collected information. By adding a code generation action describing a part for generating code information in the second programming language from the abstract syntax tree stored as a result, while referring to the program generated in the abstract syntax tree access program generation step. A code generation program generating step of generating a program for generating code information in the second programming language from the abstract syntax tree stored as the intermediate result. The computer-readable recording medium according to claim 18.
【請求項20】前記抽象構文木アクセスプログラム生成
ステップで生成されるプログラムに対してユーザが定義
したプログラムを入力し、該入力したユーザが定義した
プログラムを解析して、その解析結果を前記抽象構文木
仕様記憶ステップで記憶した抽象構文木仕様と対応させ
て記憶させるユーザ定義プログラム検出ステップを実行
するためのプログラムをさらに記録することを特徴とす
る請求項18または19に記載のコンピュータ読み取り
可能な記録媒体。
20. A user-defined program is input to a program generated in the abstract syntax tree access program generating step, the input user-defined program is analyzed, and the analysis result is stored in the abstract syntax tree access program. 20. The computer readable recording according to claim 18, further comprising a program for executing a user-defined program detecting step of storing the abstract syntax tree specification stored in the tree specification storing step in association with the abstract syntax tree specification. Medium.
【請求項21】前記抽象構文木仕様記憶ステップで記憶
した前記抽象構文木仕様の解析結果に基づいて、プログ
ラミング言語の変換時に中間結果として記憶された抽象
構文木の状態をダンプするための方法を記述したプログ
ラムを生成する抽象構文木ダンププログラム生成ステッ
プを実行するためのプログラムをさらに記録することを
特徴とする請求項18乃至20のいずれか1項に記載の
コンピュータ読み取り可能な記録媒体。
21. A method for dumping a state of an abstract syntax tree stored as an intermediate result when converting a programming language based on an analysis result of the abstract syntax tree specification stored in the abstract syntax tree specification storage step. 21. The computer-readable recording medium according to claim 18, further comprising a program for executing an abstract syntax tree dump program generating step of generating the described program.
JP11045631A 1999-02-24 1999-02-24 System and method for supporting programming language translation program development and recording medium Pending JP2000242485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11045631A JP2000242485A (en) 1999-02-24 1999-02-24 System and method for supporting programming language translation program development and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11045631A JP2000242485A (en) 1999-02-24 1999-02-24 System and method for supporting programming language translation program development and recording medium

Publications (1)

Publication Number Publication Date
JP2000242485A true JP2000242485A (en) 2000-09-08

Family

ID=12724724

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11045631A Pending JP2000242485A (en) 1999-02-24 1999-02-24 System and method for supporting programming language translation program development and recording medium

Country Status (1)

Country Link
JP (1) JP2000242485A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008527575A (en) * 2005-01-13 2008-07-24 トムソン グローバル リソーシーズ System, method and software for retrieving information using multiple query languages
CN110275709A (en) * 2018-03-15 2019-09-24 阿里巴巴集团控股有限公司 Processing and optimization method, device, equipment and storage medium for dynamic language
CN112269566A (en) * 2020-11-03 2021-01-26 支付宝(杭州)信息技术有限公司 Script generation processing method, device, equipment and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008527575A (en) * 2005-01-13 2008-07-24 トムソン グローバル リソーシーズ System, method and software for retrieving information using multiple query languages
CN110275709A (en) * 2018-03-15 2019-09-24 阿里巴巴集团控股有限公司 Processing and optimization method, device, equipment and storage medium for dynamic language
CN110275709B (en) * 2018-03-15 2023-07-25 斑马智行网络(香港)有限公司 Processing and optimizing method, device and equipment for dynamic language and storage medium
CN112269566A (en) * 2020-11-03 2021-01-26 支付宝(杭州)信息技术有限公司 Script generation processing method, device, equipment and system

Similar Documents

Publication Publication Date Title
KR101098718B1 (en) System and method for creating, managing and using code segments
US7293261B1 (en) Language-neutral representation of software code elements
Gargantini et al. A metamodel-based language and a simulation engine for abstract state machines.
US20070079299A1 (en) Method, apparatus and program storage device for representing eclipse modeling framework (EMF) ecore models in textual form
US20050149868A1 (en) User interface application development program and development apparatus
CN102929680A (en) Method, device and system for converting a testing and test control notation version 3 (TTCN-3) script into a Java source code
Hunt et al. Extensible language-aware merging
Vieira et al. Analyzing dependencies in large component-based systems
JP6845429B2 (en) Compiler program, information processing device and compilation method
JP4806158B2 (en) System and method for declaratively defining and using subclasses in markup
Pech JetBrains MPS: Why Modern Language Workbenches Matter
Avrunin et al. Comparing finite-state verification techniques for concurrent software
JP2010140407A (en) Source code inspection device
Brühlmann et al. Enriching reverse engineering with annotations
Fritzson et al. Metamodelica–a symbolic-numeric modelica language and comparison to julia
JP2000242485A (en) System and method for supporting programming language translation program development and recording medium
JPH0736680A (en) Parallelized program development aid device
JP5399601B2 (en) Implementation code development system and implementation code development program
WO2008015110A2 (en) Methods, apparatus and computer programs for modelling computer programs
KR100846203B1 (en) Method for generating mobile application and record media recorded program for realizing the same
Yusuf et al. A source code summarization technique for object oriented classes
Thomson Linking Dataflow Algebra with the CaDiZ Tool
Jung Generator-composition for aspect-oriented domain-specific languages
Yiu Checkstyle for Legacy Applications [J]
Sametinger et al. Design and implementation aspects of an experimental C++ programming environment