JPH10214194A - Class definition fetching system - Google Patents

Class definition fetching system

Info

Publication number
JPH10214194A
JPH10214194A JP2958897A JP2958897A JPH10214194A JP H10214194 A JPH10214194 A JP H10214194A JP 2958897 A JP2958897 A JP 2958897A JP 2958897 A JP2958897 A JP 2958897A JP H10214194 A JPH10214194 A JP H10214194A
Authority
JP
Japan
Prior art keywords
class
class definition
information
definition
database
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
JP2958897A
Other languages
Japanese (ja)
Inventor
Reiko Ito
玲子 伊藤
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 JP2958897A priority Critical patent/JPH10214194A/en
Publication of JPH10214194A publication Critical patent/JPH10214194A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PROBLEM TO BE SOLVED: To eliminate the need of managing an inclusion file and to reduce the complication of program description by outputting the extension code of class definition information to an execution program based on the registration contents of a class definition table. SOLUTION: After a source program 100 is inputted by an input device and the grammar of a source code is checked by a lexial analysis part and a syntax analysis part, a syntax tree is generated corresponding to analyzed syntax and the syntax tree is stored in a syntax tree storage part 26. A semantic analysis part performs semantic analysis based on the information of the generated syntax tree and the rearrangement of the tree and the registration of the definition of a class for performing registration to a data base 20 to the class definition table, etc., are performed as needed. Then, a code output part outputs the extension code to the execution program 200 based on the information of the tree after the semantic analysis. Thus, the need of managing the source file for the respective classes is eliminated.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、データベース中の
クラス参照宣言を所持するプログラミング言語処理系に
おけるクラス定義取り込み方式に関し、特に参照するク
ラスの定義に必要な他のクラス定義も全て取り込むこと
を可能とするクラス定義取り込み方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a class definition fetching method in a programming language processing system having a class reference declaration in a database, and in particular, it is possible to fetch all other class definitions necessary for defining a referenced class. Class definition import method.

【0002】[0002]

【従来の技術】従来、データベース中のクラス参照宣言
を所持するプログラミング言語処理系において、クラス
の参照を行う場合にはクラス定義の記述が必要である
が、クラスを参照するプログラム毎に継承や入れ子の関
係を全て包括した詳細なクラス定義を記述するのは困難
であるため、クラス宣言を別ファイルに記述することに
より“include文”によってプログラムに取り込
むという方式が一般的に行われている。
2. Description of the Related Art Conventionally, in a programming language processing system having a class reference declaration in a database, it is necessary to describe a class definition when referring to a class. However, inheritance or nesting is required for each program that refers to the class. Since it is difficult to describe a detailed class definition that includes all the relationships described above, a method is generally used in which a class declaration is described in a separate file and incorporated into a program by an “include statement”.

【0003】この方式を使用するためには、ヘッダファ
イル毎にどのようなクラスのクラス定義が記述されてい
るか、またそのへッダファイルの存在する場所はどこか
ということを常に管理しておく必要がある。
In order to use this method, it is necessary to always manage what class definition is described for each header file and where the header file exists. is there.

【0004】また、特開平5−40617号公報に開示
される「ソースファィル生成装置」においては、オブジ
ェクト指向言語によるプログラムの編集の際のソースコ
ードの管理を簡易なものとして、ソースファイルを生成
するソースファイル生成装置を提供している。
In a "source file generating apparatus" disclosed in Japanese Patent Application Laid-Open No. 5-40617, a source file is generated by simplifying the management of source code when editing a program in an object-oriented language. Provides a source file generation device.

【0005】上記特開平5−40617号公報「ソース
ファィル生成装置」では、オブジェクト指向言語のソー
スプログラムのクラス定義、メソッド定義及びクラス定
義と対応するメソッド定義の関連付けを示すメソッド定
義リストとを含む関連情報テーブルをプログラム定義格
納手段に記憶し、ソースファイル生成手段がクラス名か
ら関連情報テーブルを参照することにより、当該クラス
名に属するクラス定義と対応するメソッド定義とを読み
出し、ソースファイルを生成する構成となっている。
[0005] In the above-mentioned Japanese Patent Application Laid-Open No. Hei 5-40617, a source file generating apparatus is disclosed which includes a class definition of an object-oriented language source program, a method definition, and a method definition list indicating association between the class definition and the corresponding method definition. A configuration in which an information table is stored in a program definition storage unit, and a source file generation unit reads a class definition belonging to the class name and a corresponding method definition by referring to a related information table from a class name, and generates a source file. It has become.

【0006】[0006]

【発明が解決しようとする課題】上述した従来のクラス
宣言を別ファイルに記述することにより“includ
e文”によってプログラムに取り込む方式においては、
上述の如くヘッダファイル毎にどのようなクラスのクラ
ス定義が記述されているか、またそのへッダファイルの
存在する場所はどこかということを常に管理しておく必
要があると共に、クラスの構造を変更した場合にはその
クラス定義を含むソースまたはヘッダファイルを全て修
正する必要があり、プログラム記述が非常に煩雑なもの
になるという問題がある。
By describing the above-mentioned conventional class declaration in a separate file, "include"
In the method of incorporating into a program by "e statement",
As described above, it is necessary to always keep track of what class definition of each class is described in each header file, and where the header file exists, and change the class structure. In such a case, it is necessary to correct all the source or header files including the class definition, and there is a problem that the program description becomes very complicated.

【0007】また、上記特開平5−40617号公報の
ソースファイル生成方式では、実際のプログラミングに
おいて、生成されたソースの管理がやはり必要になって
くるという問題点がある。その理由は、上述のソースフ
ァイル生成方式では1つのクラスのクラス定義と複数の
ファイルに散在する可能性のあるメソッドの定義を1つ
のソースファイルとして出力するだけであるので、実際
のプログラムで複雑な階層を持つクラスを使用する場合
にはその継承関係を全て把握しておき、それらのクラス
の出力ソースを全てインクルードする必要が生じ、プロ
グラム記述の繁雑さはクラス宣言を別ファイルに記述す
ることにより“include文”によってプログラム
に取り込む方式と変わらない。
Further, the source file generation method disclosed in Japanese Patent Application Laid-Open No. 5-40617 has a problem that the generated source must be managed in actual programming. The reason is that the source file generation method described above only outputs the class definition of one class and the definition of a method that may be scattered in a plurality of files as one source file. When using classes with a hierarchy, it is necessary to grasp all the inheritance relationships and include all the output sources of those classes, and the complexity of program description can be reduced by writing the class declaration in a separate file. This is no different from the method of taking in the program by the “include statement”.

【0008】本発明の目的は、参照したいクラスそのも
のだけを宣言し、そのクラスをプログラム中でどのよう
な名前で使用するかを記述するだけで、そのままコンパ
イル可能な実行プログラムを生成することにより、イン
クルードファイルの管理をする必要をなくし、これによ
りプログラム記述の繁雑さを減らし、より分かりやすい
コードを書けるようにするクラス定義取り込み方式を提
供することにある。
[0008] An object of the present invention is to generate an executable program that can be compiled as it is simply by declaring only the class itself to be referred to and describing the name of the class to be used in the program. An object of the present invention is to provide a class definition import method that eliminates the need to manage include files, thereby reducing the complexity of program description and writing more understandable code.

【0009】また、本発明の他の目的は、同じ名前で異
なる構造を持つクラスに別名を付けて登録することによ
り、同じプログラム中でもそれらを区別して参照できる
ようにするラス定義取り込み方式を提供することにあ
る。
[0009] Another object of the present invention is to provide a class definition taking-in system that allows classes having the same name but different structures to be registered under different names so that they can be distinguished and referred to even in the same program. It is in.

【0010】[0010]

【課題を解決するための手段】上記目的を達成する本発
明のクラス定義取り込み方式は、クラス名とデータベー
ス名の対からなるデータベース中のクラス参照宣言を所
持するプログラミング言語処理系のクラス定義取り込み
方式において、ソースプログラムのコードを解析して構
文木を生成し、構文木の情報をもとに意味解析を行い、
必要に応じてデータベースへ登録するクラス定義情報を
クラス定義テーブルに格納すると共に、意味解析後の構
文木の情報をもとに展開コードを実行プログラムに出力
するトランスレート処理手段と、前記トランスレート処
理においてクラス参照宣言の構文を解析した場合に、前
記クラス参照宣言で指定されたクラスの定義情報を前記
データベースを検索して取得する検索手段とを備え、前
記取得したクラス定義情報が前記ソースプログラムに記
述されていたものとしてトランスレート処理を行ない、
かつ取得した前記クラス定義情報を別のデータベースに
存在する同名のクラスも区別できるように一意に判別可
能な名前を付けて前記クラス定義テーブルに格納し、前
記クラス定義テーブルの登録内容に基づいてクラス定義
情報の展開コードを実行プログラムに出力することを特
徴とする。
According to the present invention, there is provided a class definition fetching method for a programming language processing system having a class reference declaration in a database comprising a pair of a class name and a database name. In, the code of the source program is analyzed to generate a syntax tree, and a semantic analysis is performed based on the information of the syntax tree.
Translation processing means for storing class definition information to be registered in the database as necessary in a class definition table, and outputting an expanded code to an execution program based on the information of the syntax tree after the semantic analysis; Search means for searching the database for definition information of the class specified in the class reference declaration when the syntax of the class reference declaration is analyzed, and wherein the acquired class definition information is stored in the source program. Perform translation processing as described,
The acquired class definition information is stored in the class definition table with a uniquely identifiable name so that a class having the same name existing in another database can be distinguished, and the class is defined based on the registered contents of the class definition table. The expansion code of the definition information is output to the execution program.

【0011】請求項2の本発明のクラス定義取り込み方
式では、前記検索手段は、前記クラス参照宣言で指定さ
れたクラスの基底クラスの情報について前記データベー
スを再帰的に検索することにより、最上位の基底クラス
から順次クラス定義情報を取得することを特徴とする。
According to a second aspect of the present invention, the search means recursively searches the database for information on a base class of the class specified in the class reference declaration, thereby obtaining the highest-order information. It is characterized in that class definition information is sequentially obtained from a base class.

【0012】請求項3の本発明のクラス定義取り込み方
式では、前記検索手段によって取得したクラス定義情報
を展開して格納する一時ファィルを備え、前記一時ファ
イルのクラス定義情報を前記トランスレート処理手段に
入力することにより、前記ソースプログラムに前記クラ
ス定義情報が記述されていたものとしてトランスレート
処理を行うことを特徴とする。
According to a third aspect of the present invention, there is provided a class definition import method, comprising a temporary file for expanding and storing the class definition information acquired by the retrieval means, and storing the class definition information of the temporary file in the translation processing means. By inputting, the translation processing is performed assuming that the class definition information is described in the source program.

【0013】請求項4の本発明のクラス定義取り込み方
式では、一意に判別可能な名前を付けたクラス定義につ
いては、クラス定義に対応するソースコードも併せて前
記実行プログラムに出力することを特徴とする。
According to a fourth aspect of the present invention, a class definition having a uniquely identifiable name is output to the execution program together with a source code corresponding to the class definition. I do.

【0014】[0014]

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

【0015】図1は本発明の実施の形態であるクラス定
義取り込み方式の機能構成を示したブロック図である。
図1を参照すると、本発明の実施の形態は、トランスレ
ート処理部10、データベース20、データベース管理
システム(DBMS)21、データベース検索部22、
一時ファイル23、ハッシュテーブル25、構文木格納
部26、クラス定義テーブル27とを備える。
FIG. 1 is a block diagram showing a functional configuration of a class definition taking system according to an embodiment of the present invention.
Referring to FIG. 1, an embodiment of the present invention includes a translation processing unit 10, a database 20, a database management system (DBMS) 21, a database search unit 22,
A temporary file 23, a hash table 25, a syntax tree storage unit 26, and a class definition table 27 are provided.

【0016】まず、トランスレート処理部10による処
理について説明する。トランスレート処理部10は、図
2に示すように、字句解析部11、構文解析部12、意
味解析部13、コード出力部14とで構成される。
First, the processing by the translation processing unit 10 will be described. The translation processing unit 10 includes a lexical analysis unit 11, a syntax analysis unit 12, a semantic analysis unit 13, and a code output unit 14, as shown in FIG.

【0017】入力装置により、ソースプログラム(ファ
イル)100の入力をおこない、字句解析部11と構文
解析部12により、ソースコードの文法のチェック等を
行った上で、解析した構文に従って構文木を生成し、当
該構文木を構文木格納部26に格納する。
The input device inputs a source program (file) 100, and the lexical analyzer 11 and the syntax analyzer 12 check the grammar of the source code and generate a syntax tree in accordance with the analyzed syntax. Then, the syntax tree is stored in the syntax tree storage unit 26.

【0018】生成した構文木の情報をもとに意味解析部
13が意味解析を行い、必要に応じて木の組み替えと、
データベース20への登録を行うクラス定義のクラス定
義テーブル27への登録等を行う。そして、コード出力
部14では、意味解析後の木の情報をもとに展開コード
を実行プログラム200に出力する。
The semantic analysis unit 13 performs semantic analysis based on the generated syntax tree information, and rearranges the tree as necessary.
The registration of the class definition to be registered in the database 20 to the class definition table 27 is performed. Then, the code output unit 14 outputs the expanded code to the execution program 200 based on the tree information after the semantic analysis.

【0019】最後に、図3に示すように、上記のように
クラス定義の登録を行なったクラス定義テーブル27の
情報を基づいて、登録する必要のあるクラス定義をデー
タベース管理システム21を介してデータベース20へ
格納する。
Finally, as shown in FIG. 3, based on the information in the class definition table 27 in which the class definitions have been registered as described above, the class definitions that need to be registered are stored in the database through the database management system 21. 20.

【0020】上記実施の形態によるクラス参照宣言の構
文に対する処理について図4のフローチャートを参照し
て説明する。
The processing for the syntax of the class reference declaration according to the above embodiment will be described with reference to the flowchart of FIG.

【0021】トランスレート処理部10の構文解析部1
2で、クラス参照宣言の構文であることを示す構文木を
生成し、意味解析部13で、クラス参照宣言の構文を解
析した場合、データベース検索部22に制御が移る。
Syntax analyzer 1 of translation processor 10
In step 2, when a syntax tree indicating the syntax of the class reference declaration is generated, and the semantic analysis unit 13 analyzes the syntax of the class reference declaration, the control is transferred to the database search unit 22.

【0022】データベース検索部22においては、意味
解析部13のクラス参照宣言の解析結果から、参照の対
象となるクラス名とデータベース名を取得し(ステップ
41)、取得したクラス名に基づいてハッシュテーブル
25を検索し、クラス定義が取り込み済みか否かを判別
する(ステップ42,43)。ハッシュテーブル25に
クラス定義が取り込み済みであれば、後述の展開コード
の出力を行う(ステップ51)。
The database search unit 22 obtains a class name and a database name to be referred from the analysis result of the class reference declaration by the semantic analysis unit 13 (step 41), and based on the obtained class name, obtains a hash table. 25, it is determined whether or not the class definition has been imported (steps 42 and 43). If the class definition has been taken into the hash table 25, an expansion code described later is output (step 51).

【0023】ハッシュテーブル25にクラス定義が取り
込み済みでなければ、指定されたデータベース20に登
録されているクラス定義を検索し、対象のクラス名が登
録されているか否かを判別する(ステップ44,4
5)。クラス定義が指定されたデータベース20に登録
されていない場合(ステップ45)はエラーとなる。
If the class definition has not been captured in the hash table 25, the class definition registered in the specified database 20 is searched to determine whether or not the target class name is registered (step 44, 4
5). If the class definition is not registered in the specified database 20 (step 45), an error occurs.

【0024】クラス定義が指定されたデータベース20
に登録されている場合、ここで得られたクラス定義情報
から基底クラスの情報を取得し、基底クラスについて再
帰的にデータベースに検索しにいく(ステップ46,4
7)。このようにして最上位の基底クラスから順次クラ
ス定義を取得し、取得したクラス定義情報をもとにクラ
ス定義文を展開して一時ファィル23に出力し(ステッ
プ48)、恰ももとのソースコードにそのクラス定義が
書かれていたかのようにトランスレート処理を行うと共
に(ステップ49)、クラス定義情報をクラス定義テー
ブル27へ登録する(ステップ50)。クラス定義情報
のクラス定義テーブル27への登録においては、別のデ
ータベースに存在する同名のクラスも区別できるように
一意に判別可能な名前を付けて展開する。
Database 20 in which class definitions are specified
If it is registered in the database, the information of the base class is acquired from the obtained class definition information, and the database is recursively searched for the base class (steps 46 and 4).
7). In this way, the class definitions are sequentially acquired from the topmost base class, the class definition statement is expanded based on the acquired class definition information, and output to the temporary file 23 (step 48). The translation process is performed as if the class definition had been written in (step 49), and the class definition information was registered in the class definition table 27 (step 50). In registering the class definition information in the class definition table 27, the class definition information is developed with a uniquely identifiable name so that a class having the same name existing in another database can be distinguished.

【0025】また、ステップ50では、ハッシュテーブ
ル25へのクラス管理情報(クラス名及びクラス定義が
何を表わしているかを示す情報等)の登録も併せて行な
う。以降クラス管理情報による参照ではそのクラス管理
情報に対応したクラスを参照しているものとしての処理
を行う。
In step 50, class management information (such as information indicating what the class name and the class definition represent) is also registered in the hash table 25. Hereinafter, in the reference by the class management information, processing is performed assuming that the class corresponding to the class management information is referred to.

【0026】意味解析処理終了後、クラス定義テーブル
27の登録内容に基づいて展開コードの出力を行う(ス
テップ51)が、参照宣言を行ったクラスに対しては出
力ソースがそのままコンパイル可能になるように、完全
なクラス定義を出力する。すなわち、別のデータベース
に存在する同名のクラスも区別できるように一意に判別
可能な名前を付けて状態で出力される。また、そのよう
にクラス定義に一意に判別可能な名前を付けて展開した
個所では、そのクラス定義に対応するコード(ソースコ
ード)も出力する。
After the semantic analysis processing is completed, the expanded code is output based on the registered contents of the class definition table 27 (step 51). However, the output source can be compiled as it is for the class for which the reference declaration has been made. To output the complete class definition. In other words, the class is output in a state where a uniquely identifiable name is assigned so that a class having the same name existing in another database can be distinguished. In addition, where the class definition is expanded with a uniquely identifiable name, a code (source code) corresponding to the class definition is also output.

【0027】[0027]

【実施例】次に本発明の実施例について図面を参照して
詳細に説明する。図5は、クラス定義をデータベースに
登録する際のソースコードを示す。ここでは、データベ
ース“tokyo_db”には、図5の参照番号51で示す“cl
ass Emp”のクラス定義を登録し、データベース“osaka
_db”には図5の参照番号52で示す“class Emp”のク
ラス定義を登録するものとする。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 5 shows a source code for registering a class definition in a database. Here, the database “tokyo_db” includes “cl” indicated by reference numeral 51 in FIG.
Register the class definition of "ass Emp" and create the database "osaka
The class definition of “class Emp” indicated by reference numeral 52 in FIG. 5 is registered in “_db”.

【0028】図6は、C++言語をクラス参照宣言対応
に拡張した構文のソースコードと、それを本発明のクラ
ス定義取り込み方式により該当するクラスの定義を検索
し出力したコードの一部を示している。
FIG. 6 shows a source code having a syntax in which the C ++ language is extended to support class reference declarations, and a part of a code obtained by searching and outputting the definition of a corresponding class by the class definition taking-in method of the present invention. I have.

【0029】図6の参照番号61では、2つのデータベ
ース(“tokyo_db”と“osaka_db”)中、異なる定義を
持つ同名のクラス“Emp”をそれぞれ“tokyo_Emp”,
“osaka_Emp”という名前で参照することを宣言し、以
後のプログラム中ではその名前でそれぞれのクラスを参
照している。
In reference numeral 61 in FIG. 6, in two databases (“tokyo_db” and “osaka_db”), classes “Emp” having different definitions and having the same name are respectively referred to as “tokyo_Emp” and “tokyo_Emp”.
Declared to be referred to by the name "osaka_Emp", and in subsequent programs, each class is referred to by that name.

【0030】図6の61に示したソースコードを入力と
した場合のクラス定義取り込み処理について、図4のフ
ローチャートにしたがって説明する。
The class definition taking-in process when the source code 61 shown in FIG. 6 is input will be described with reference to the flowchart of FIG.

【0031】クラス参照宣言“usec1ass tokyo_Emp=to
kyo:::Emp”を解析した際、検索の対象となるクラス名
が“Emp”で、データベース名が“tokyo_db”であるこ
とを取得する(ステップ41)。“tokyo_db”の“clas
s Emp”の定義が既に取り込み済みかをハッシュテーブ
ル25をチェックし(ステップ42)、取り込み済みな
らぱデータベース検索は不要であるので、以後の処理は
行うことなくコード出力を行なう(ステップ51)。
Class reference declaration "usec1ass tokyo_Emp = to
When “kyo ::: Emp” is analyzed, it is obtained that the class name to be searched is “Emp” and the database name is “tokyo_db” (step 41).
The hash table 25 is checked to see if the definition of "s Emp" has already been captured (step 42). If the definition has been captured, the database search is unnecessary, and the code is output without performing the subsequent processing (step 51).

【0032】クラス定義を未だ取り込んでいない場合
は、データベース“tokyo_db”に“class Emp”の定義
が登録されているかどうかを検索する(ステップ4
4)。“class Emp”が指定されたデータベース“tokyo
_db”に登録されていない場合はエラーとする。
If the class definition has not been imported yet, it is searched whether or not the definition of "class Emp" is registered in the database "tokyo_db" (step 4).
4). The database “tokyo” with “class Emp” specified
If it is not registered in “_db”, an error will occur.

【0033】“class Emp”の定義のデータベース検索
結果から、“class Emp”の基底クラスの情報をまず取
り出す(ステップ46)。この場合、“class Person”
という基底クラスが存在するので、基底クラス“class
Person”について再帰的に上記の処理を行い(ステップ
47)、最上位の基底クラスから順次クラス定義を確定
取得し、取得したクラス定義情報をもとにクラス定義文
を展開して一時ファィルに出力し(ステップ48)、ト
ランスレート処理を行うと共に(ステップ49)、クラ
ス定義情報をクラス定義テーブル27へ登録し、ハッシ
ュテーブル25への登録も併せて行なう(ステップ5
0)。この処理の結果、“class Emp”の完全なクラス
定義情報を取り出すことができる。
First, information of the base class of “class Emp” is extracted from the database search result of the definition of “class Emp” (step 46). In this case, “class Person”
Base class exists, so the base class "class
The above process is performed recursively for "Person" (step 47), the class definitions are determined and obtained sequentially from the topmost base class, and the class definition statements are expanded based on the obtained class definition information and output to a temporary file. (Step 48), a translation process is performed (Step 49), and the class definition information is registered in the class definition table 27 and also registered in the hash table 25 (Step 5).
0). As a result of this processing, complete class definition information of “class Emp” can be extracted.

【0034】また、クラス参照宣言“usec1ass osaka_
Emp=osaka:::Emp”についても同様の処理を行い、デー
タベース“osaka_db”の“class Emp”の定義を取り出
す。
The class reference declaration “usec1ass osaka_
The same processing is performed for “Emp = osaka ::: Emp”, and the definition of “class Emp” of the database “osaka_db” is extracted.

【0035】コードの出力時(ステップ51)には、別
のデータベースに存在する同名のクラスも区別できるよ
うに一意に判別可能な名前を付けた状態で出力される。
このようにして出力展開した結果を図6の参照番号62
に示す。
At the time of outputting the code (step 51), the code is output with a uniquely identifiable name so that the class having the same name existing in another database can be distinguished.
The result of output expansion in this manner is indicated by reference numeral 62 in FIG.
Shown in

【0036】以上好ましい実施の形態及び実施例をあげ
て本発明を説明したが、本発明は必ずしも上記実施の形
態及び実施例に限定されるものではない。
Although the present invention has been described with reference to the preferred embodiments and examples, the present invention is not necessarily limited to the above embodiments and examples.

【0037】[0037]

【発明の効果】以上説明したように本発明のクラス定義
取り込み方式によれば、第1に、参照するクラスを検索
する際、基底クラスやネストしたクラスを順次辿ってそ
のクラス定義も取り込んで行く処理を行なうため、ソー
スファイル中にクラス参照宣言を記述するだけで、その
クラスを参照するプログラムをコンパイル可能な実行プ
ログラムに変換することができるという優れた効果が得
られる。これにより、クラス毎のソースファイルの管理
を行う必要がなくなる。
As described above, according to the class definition taking-in method of the present invention, first, when searching for a class to be referred to, the base class and nested classes are sequentially traced to take in the class definition. Since the processing is performed, an excellent effect is obtained in that a program referencing the class can be converted into a compilable executable program only by writing a class reference declaration in the source file. This eliminates the need to manage source files for each class.

【0038】第2に、クラス定義情報のクラス定義テー
ブルへの登録においては、別のデータベースに存在する
同名のクラスも区別できるように一意に判別可能な名前
を付けて登録するため、同じ名前で異なる構造を持つク
ラスに別名を付けることができるということである。こ
れにより、同じプログラム中でもそれらを区別して参照
できるようになる。
Secondly, in registering class definition information in the class definition table, classes having the same name existing in different databases are registered with uniquely identifiable names so as to be distinguished. This means that classes with different structures can be aliased. This makes it possible to distinguish and refer to them even in the same program.

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

【図1】 本発明におけるクラス定義取り込み方式の実
施の形態を示す構成ブロック図である。
FIG. 1 is a configuration block diagram showing an embodiment of a class definition capturing method according to the present invention.

【図2】 本発明の実施の形態おけるトランスレート処
理部の機能を説明するブロック図である。
FIG. 2 is a block diagram illustrating functions of a translation processing unit according to the embodiment of the present invention.

【図3】 本発明におけるクラス定義情報の登録機能を
説明するブロック図である。
FIG. 3 is a block diagram illustrating a registration function of class definition information according to the present invention.

【図4】 本発明のクラス定義取り込み方式の処理内容
を説明するフローチャートである。
FIG. 4 is a flowchart illustrating processing contents of a class definition capturing method according to the present invention.

【図5】 本発明の実施例として登録するクラス定義を
表すソースコードの例を示す図である。
FIG. 5 is a diagram showing an example of a source code representing a class definition registered as an embodiment of the present invention.

【図6】 本発明の実施例としてC++言語をクラス参
照宣言対応に拡張した構文のソースコードとそれをクラ
ス定義取り込み方式によって展開したコードを示す図で
ある。
FIG. 6 is a diagram showing a source code having a syntax in which the C ++ language is extended to correspond to a class reference declaration as an embodiment of the present invention, and a code obtained by expanding the source code by a class definition fetching method.

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

10 トランスレート処理部 11 字句解析部 12 構文解析部 13 意味解析部 14 コード出力部 20 データベース 21 データベース管理システム 22 データベース検索部 23 一時ファイル 25 ハッシュテーブル 26 構文木格納部 27 クラス定義テーブル Reference Signs List 10 translation processing unit 11 lexical analysis unit 12 syntax analysis unit 13 semantic analysis unit 14 code output unit 20 database 21 database management system 22 database search unit 23 temporary file 25 hash table 26 syntax tree storage unit 27 class definition table

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】クラス名とデータベース名の対からなるデ
ータベース中のクラス参照宣言を所持するプログラミン
グ言語処理系のクラス定義取り込み方式において、 ソースプログラムのコードを解析して構文木を生成し、
構文木の情報をもとに意味解析を行い、必要に応じてデ
ータベースへ登録するクラス定義情報をクラス定義テー
ブルに格納すると共に、意味解析後の構文木の情報をも
とに展開コードを実行プログラムに出力するトランスレ
ート処理手段と、 前記トランスレート処理においてクラス参照宣言の構文
を解析した場合に、前記クラス参照宣言で指定されたク
ラスの定義情報を前記データベースを検索して取得する
検索手段とを備え、 前記取得したクラス定義情報が前記ソースプログラムに
記述されていたものとしてトランスレート処理を行な
い、かつ取得した前記クラス定義情報を別のデータベー
スに存在する同名のクラスも区別できるように一意に判
別可能な名前を付けて前記クラス定義テーブルに格納
し、 前記クラス定義テーブルの登録内容に基づいてクラス定
義情報の展開コードを実行プログラムに出力することを
特徴とするクラス定義取り込み方式。
In a class definition fetching method of a programming language processing system having a class reference declaration in a database including a pair of a class name and a database name, a syntax tree is generated by analyzing a source program code,
Executes semantic analysis based on the syntax tree information, stores the class definition information to be registered in the database as needed in the class definition table, and executes the expanded code based on the syntax tree information after semantic analysis. Translation processing means for outputting the definition information of the class specified in the class reference declaration by searching the database when the syntax of the class reference declaration is analyzed in the translation processing. The translation processing is performed assuming that the acquired class definition information is described in the source program, and the acquired class definition information is uniquely determined so that a class having the same name existing in another database can be distinguished. Store the class definition table with a possible name, and register it in the class definition table. Class definitions uptake method and outputs the expansion code of the class definition information for executing the program based on.
【請求項2】 前記検索手段は、前記クラス参照宣言で
指定されたクラスの基底クラスの情報について前記デー
タベースを再帰的に検索することにより、最上位の基底
クラスから順次クラス定義情報を取得することを特徴と
する請求項1に記載のクラス定義取り込み方式。
2. The search means obtains class definition information sequentially from a top-level base class by recursively searching the database for base class information of a class specified in the class reference declaration. The class definition taking-in method according to claim 1, wherein:
【請求項3】 前記検索手段によって取得したクラス定
義情報を展開して格納する一時ファィルを備え、 前記一時ファイルのクラス定義情報を前記トランスレー
ト処理手段に入力することにより、前記ソースプログラ
ムに前記クラス定義情報が記述されていたものとしてト
ランスレート処理を行うことを特徴とする請求項1又は
請求項2に記載のクラス定義取り込み方式。
3. A temporary file for expanding and storing the class definition information obtained by the search means, and by inputting the class definition information of the temporary file to the translation processing means, 3. The class definition taking-in method according to claim 1, wherein a translation process is performed assuming that the definition information has been described.
【請求項4】 一意に判別可能な名前を付けたクラス定
義については、クラス定義に対応するソースコードも併
せて前記実行プログラムに出力することを特徴とする請
求項1に記載のクラス定義取り込み方式。
4. The method according to claim 1, wherein a source code corresponding to the class definition is output to the execution program together with a class definition having a uniquely distinguishable name. .
JP2958897A 1997-01-29 1997-01-29 Class definition fetching system Pending JPH10214194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2958897A JPH10214194A (en) 1997-01-29 1997-01-29 Class definition fetching system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2958897A JPH10214194A (en) 1997-01-29 1997-01-29 Class definition fetching system

Publications (1)

Publication Number Publication Date
JPH10214194A true JPH10214194A (en) 1998-08-11

Family

ID=12280245

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2958897A Pending JPH10214194A (en) 1997-01-29 1997-01-29 Class definition fetching system

Country Status (1)

Country Link
JP (1) JPH10214194A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002157118A (en) * 2000-09-06 2002-05-31 Ns Solutions Corp Program generation assisting device, program generating method, storage medium, and program
CN100447805C (en) * 2004-09-17 2008-12-31 富士施乐株式会社 Document processing device, document processing method, and storage medium recording program therefor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002157118A (en) * 2000-09-06 2002-05-31 Ns Solutions Corp Program generation assisting device, program generating method, storage medium, and program
CN100447805C (en) * 2004-09-17 2008-12-31 富士施乐株式会社 Document processing device, document processing method, and storage medium recording program therefor

Similar Documents

Publication Publication Date Title
US10698682B1 (en) Computerized software development environment with a software database containing atomic expressions
US7577946B2 (en) Program product, method, and system for testing consistency of machine code files and source files
US7565364B1 (en) Annotation processor discovery
US9164742B2 (en) Method and a system for searching for parts of a computer program which affects a given symbol
US6286133B1 (en) Method and apparatus for strategic compilation of source programs into two or more target languages
US20130054630A1 (en) Pre-generation of structured query language (sql) from application programming interface (api) defined query systems
JP2002534742A (en) System and method for recursive path analysis of DBMS procedures
JPH0338735A (en) Method of detecting error in parallel program and support system
US20060122973A1 (en) Mechanism for defining queries in terms of data objects
US8539457B2 (en) Partial on-demand lazy semantic analysis
US11294665B1 (en) Computerized software version control with a software database and a human database
Dean et al. Using design recovery techniques to transform legacy systems
US5701490A (en) Method and apparatus for compiler symbol table organization with no lookup in semantic analysis
Bull et al. Semantic grep: Regular expressions+ relational abstraction
US20040010780A1 (en) Method and apparatus for approximate generation of source code cross-reference information
JPH10214194A (en) Class definition fetching system
JP2976891B2 (en) Remote database access method
JPH07182179A (en) Object oriented data base managing device
GB2420638A (en) Method of substituting code fragments in Internal Representation
JP3999949B2 (en) Alias name search apparatus, alias name search method, and alias name search program
JP3531728B2 (en) Apparatus and method for managing configuration relation of program described in object-oriented programming language, and storage medium
JP4090226B2 (en) Display method of stored procedure call relation diagram and database management system
JP2942414B2 (en) Virtual database method
Lerner Type evolution support for complex type changes
van der Spek The overture project: Designing an open source tool set