JPH1021078A - Combined view reference expression compilation system - Google Patents

Combined view reference expression compilation system

Info

Publication number
JPH1021078A
JPH1021078A JP8188337A JP18833796A JPH1021078A JP H1021078 A JPH1021078 A JP H1021078A JP 8188337 A JP8188337 A JP 8188337A JP 18833796 A JP18833796 A JP 18833796A JP H1021078 A JPH1021078 A JP H1021078A
Authority
JP
Japan
Prior art keywords
class
type
type information
view
code
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
JP8188337A
Other languages
Japanese (ja)
Inventor
Tomoaki Sato
友昭 佐藤
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 JP8188337A priority Critical patent/JPH1021078A/en
Publication of JPH1021078A publication Critical patent/JPH1021078A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the description quantity of an expression for reference to a combined-view specified object by providing a syntax analyzing means for a source code, a type information table generating means for a table wherein type information on syntax is analyzed, a reference code generating means, and an expansion code output means. SOLUTION: A source file generating device 4 analyzes a source file from an input device 1 and sets type information in a storage device 3. A syntax analysis part 4-1 analyzes the syntax of the source file from the input device 1 and passes its analytic information to a type analysis part 4-2. The type analysis part 4-2 extracts the type information from the analytic information passed from the syntax analysis part 4-1 and sets it in the type information table 3-1. A code composition part 4-3 refers to the type information table 3-1 and passes an expansion code to an output part 4-4. At this time, when there is an object of a combined-view class, a combination object holding the address of a combined-view specified object is generated.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータ等情
報処理装置における言語処理系に関し、特に、複数のデ
ータ定義のオブジェクトを結合したオブジェクトを一つ
のデータ定義のオブジェクトとして参照することを可能
とする結合ビュー参照式コンパイル方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a language processing system in an information processing apparatus such as a computer, and more particularly, to a connection which enables an object obtained by connecting a plurality of data definition objects to be referred to as one data definition object. Regarding the view reference formula compilation method.

【0002】[0002]

【従来の技術】この種の従来のソースファイル生成装置
として、例えば特開平5−40617号公報には、Co
mmon LispやC++などのオブジェクト指向言
語によるプログラムの編集の際のソースコードの管理を
簡易なものとしてソースファイルを生成する装置を提供
することを目的として、ソースプログラムのクラス定義
及びメソッド定義を入力する手段と、入力されたクラス
定義、メソッド定義、およびクラス定義と対応するメソ
ッド定義の関連付けを示すメソッド定義リストとを含む
関連情報テーブルを記憶するプログラム定義格納手段
と、クラス名から前記関連情報テーブルを参照し当該ク
ラス名に属するクラス定義と対応するメソッッド定義を
読み出して、ソースファイルを生成するようにした装置
が提案されている。
2. Description of the Related Art As a conventional source file generating apparatus of this kind, for example, Japanese Patent Laid-Open Publication No.
Input a class definition and a method definition of a source program for the purpose of providing a device for generating a source file for simplifying management of a source code at the time of editing a program in an object-oriented language such as mmon Lisp or C ++. Means, a program definition storing means for storing a related information table including an input class definition, a method definition, and a method definition list indicating association between the class definition and the corresponding method definition, and the related information table from the class name. There has been proposed an apparatus which reads out a method definition corresponding to a class definition belonging to the class name and generates a source file.

【0003】図5は、上記公報に提案されるソースファ
イル生成装置の構成を示す図である。図5を参照する
と、ソースファイル生成装置11は、定義格納機構12
と定義格納領域13と、ソースファイル生成機構14
と、を備えて構成されている。
FIG. 5 is a diagram showing a configuration of a source file generation device proposed in the above publication. Referring to FIG. 5, the source file generation device 11 includes a definition storage mechanism 12
And definition storage area 13 and source file generation mechanism 14
And is provided.

【0004】ソースファイル生成装置11は、プログラ
ム編集装置10からソースプログラムを入力すると、入
力したソースプログラム中のクラス定義、メソッド定
義、およびクラス定義とメソッド定義との関連情報等の
定義情報を定義格納機構12により定義格納領域13に
格納し、ソースファイル生成機構14により定義格納領
域13の情報を参照し、ソースファイル15を生成して
いる。
[0004] When a source program is input from the program editing device 10, the source file generation device 11 stores definition information such as class definitions and method definitions in the input source program and information related to the class definitions and the method definitions. The source file 15 is generated by storing it in the definition storage area 13 by the mechanism 12 and referring to the information of the definition storage area 13 by the source file generation mechanism 14.

【0005】ここで、以降の説明のためにまず用語の説
明を行う。
Here, terms will be explained first for the following explanation.

【0006】「クラス」とは、オブジェクト指向言語に
おけるユーザー定義の型である。
A "class" is a user-defined type in an object-oriented language.

【0007】「メンバ」とは、クラスの構成要素であ
り、データメンバとメンバ関数から構成される。
A "member" is a component of a class, and is composed of a data member and a member function.

【0008】「結合クラス」とは、複数のクラスを一つ
のクラスに結合したクラスである。
[0008] A "joined class" is a class in which a plurality of classes are joined into one class.

【0009】「結合オブジェクト」は、複数のオブジェ
クトを結合したオブジェクトである。
A "combined object" is an object obtained by combining a plurality of objects.

【0010】「結合ビュー参照方式」とは、オブジェク
ト指向言語において、複数のクラスのオブジェクトをあ
たかも一つのクラスのオブジェクトとして参照すること
を可能とする方式である。
The "combined view reference method" is a method in an object-oriented language that makes it possible to refer to objects of a plurality of classes as if they were objects of a single class.

【0011】また、オブジェクト指向言語において、複
数のクラスのオブジェクトをあたかも一つのクラスのオ
ブジェクトとして参照することを可能としたクラスを
「結合ビュークラス」と呼ぶ。
In an object-oriented language, a class that makes it possible to refer to an object of a plurality of classes as if it were an object of a single class is called a “join view class”.

【0012】また、特開平4−299423号公報に
は、オブジェクトをコピーせずに、結合の対応関係を保
持するオブジェクトを生成することによって結合演算の
高速化を図るオブジェクトの結合方式が提案されてい
る。この従来のオブジェクトの結合方式では、オブジェ
クトの結合を行うと、結合オブジェクトは、被結合オブ
ジェクトを保持する。オブジェクトのメンバを参照する
には、結合オブジェクトの保持する被結合メンバとして
参照する。
Japanese Patent Application Laid-Open No. Hei 4-299423 proposes a method of combining objects in which an object that retains the correspondence of the combination is generated without copying the object, thereby speeding up the combining operation. I have. In this conventional object combining method, when objects are combined, the combined object holds the combined object. To refer to a member of an object, refer to the member to be joined held by the joined object.

【0013】ところで、従来技術により、結合ビュー参
照と同じ処理を行おうとした場合、以下のような記述を
ソースファイル上にする必要がある。
[0013] By the way, when the same processing as the reference of the combined view is to be performed by the conventional technique, it is necessary to write the following description in the source file.

【0014】結合するクラスに対する結合クラスを定義
する。定義する結合クラスは被結合クラスのオブジェク
トを保持する構造を持つ必要がある。
[0014] Define a binding class for the binding class. The binding class to be defined must have a structure that holds the objects of the binding class.

【0015】結合クラスのオブジェクトの宣言を行う。
宣言時には被結合クラスのオブジェクトを引き数として
宣言する。
Declares an object of the combined class.
At the time of declaration, declare the object of the joined class as an argument.

【0016】結合ビュークラスと同じ処理を行う場合
は、結合クラスのオブジェクトの保持する被結合クラス
のオブジェクトのメンバとして参照する必要がある。結
合のネストが深くなると、その分だけ参照のネストも深
くなることになる。
When performing the same processing as that of the combined view class, it is necessary to refer to it as a member of the object of the combined class held by the object of the combined class. The deeper the nest of joins, the deeper the nest of references.

【0017】上記の結合クラスのオブジェクトの宣言に
ついて、上記の方法以外に関数として結合オブジェクト
の宣言を実現する方法もある。これは、導出関数といっ
て、どのオブジェクトを結合ビュー指定するかを限定す
る関数で、関数中でオブジェクトを結合し、結合した結
合オブジェクトを返却する。
In addition to the above-mentioned method, there is a method of declaring a combined object as a function, in addition to the above method. This is a derivation function that limits which objects are to be specified as a joined view. In the function, the objects are joined, and the joined object is returned.

【0018】[0018]

【発明が解決しようとする課題】このようにした上記従
来のソースファイル生成方式においては、複数のクラス
のオブジェクトをあたかも一つのオブジェクトであるか
のように参照できる結合ビュー指定したオブジェクトに
おいて、そのなかのあるクラスのオブジェクトのメンバ
を参照する場合には結合ビュー指定したオブジェクトを
生成する際に生成される結合オブジェクトを経由して参
照する必要があり、結合ビュー指定のクラスのネストが
深くなると参照式の記述量が多くなってしまうという問
題点を有している。
In the above-described conventional source file generation method, a plurality of objects of a class can be referred to as if they are one object. When referencing a member of an object of a certain class, it is necessary to refer via the joined object generated when the object specified in the join view is generated, and when the nest of the class specified in the join view becomes deeper, the reference expression However, there is a problem that the description amount becomes large.

【0019】その理由は、複数のクラスを結合ビュー指
定したオブジェクトの参照方法についての考慮がなされ
ていない、ことによる。
The reason is that no consideration is given to a method of referring to an object in which a plurality of classes are specified as a combined view.

【0020】したがって、本発明は、上記事情に鑑みて
なされたものであって、その目的は、複数のクラスを結
合ビュー指定したオブジェクトを一つのクラスのオブジ
ェクトとして参照することを可能とすることにより、結
合ビュー指定したオブジェクトへの参照式の記述量を縮
減することを可能とした結合ビュー参照式コンパイル方
式を提供することにある。
Accordingly, the present invention has been made in view of the above circumstances, and an object of the present invention is to make it possible to refer to an object in which a plurality of classes are designated as a combined view as an object of one class. It is another object of the present invention to provide a combined view reference expression compiling method capable of reducing the amount of description of a reference expression to an object designated by a combined view.

【0021】[0021]

【課題を解決するための手段】前記目的を達成するため
に本発明の結合ビュー参照式コンパイル方式は、複数の
データ定義を結合し、新たな結合ビュー定義を所持する
プログラミング言語処理系において、そのソースコード
の構文を解析する手段と、解析した構文の型情報を解析
し型情報テーブルを生成する手段と、型情報テーブルを
参照し、参照コードを生成する手段と、展開コードを出
力する手段と、を備えて構成されている。
In order to achieve the above object, a combined view reference type compiling method according to the present invention combines a plurality of data definitions in a programming language processing system having a new combined view definition. Means for analyzing the syntax of the source code; means for analyzing the type information of the analyzed syntax to generate a type information table; means for referring to the type information table to generate a reference code; and means for outputting an expanded code , Is configured.

【0022】本発明の概要を説明する。結合ビュー参照
式コンパイル方式においては、構文解析部がソースファ
イルの構文を解析し、型解析部で型情報を解析し、型情
報テーブルに型情報を設定する。このとき、結合ビュー
指定したクラスがあれば、そのクラス情報も設定する。
参照コード組み立て部では、ソースコード中に結合ビュ
ークラス型のオブジェクトのメンバを直接参照する参照
式があれば、これを結合ビュー指定されたオブジェクト
へのポインタを保持する結合クラスオブジェクト経由の
参照式に展開する。本発明によれば、このように、ソー
スコードの解析中の型解析部にて、結合ビュー指定クラ
スの情報を型情報テーブルに保持しておき、この情報を
使って、結合オブジェクトを参照する展開コードを出力
する、ように構成したことにより、参照式の記述量を縮
減し、これに伴いソフトウェアのバグを減らすことによ
り、ソフトウェアの保守性を向上する。
An outline of the present invention will be described. In the combined view reference type compiling method, the syntax analyzer analyzes the syntax of the source file, analyzes the type information in the type analyzer, and sets the type information in the type information table. At this time, if there is a class specified for the combined view, the class information is also set.
In the reference code assembler, if there is a reference expression that directly references the member of the joined view class type object in the source code, this is converted into a reference expression via the joined class object that holds a pointer to the object specified in the joined view. expand. According to the present invention, as described above, in the type analysis unit during the analysis of the source code, the information of the join view specification class is held in the type information table, and the expansion is performed using this information to refer to the join object. By outputting the code, the amount of description of the reference expression is reduced, and the bug of the software is reduced, thereby improving the maintainability of the software.

【0023】[0023]

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

【0024】図1は、本発明の実施の形態に係る結合ビ
ュー参照式コンパイル方式の機能構成をブロック図にて
示したものである。図1を参照すると、本発明の実施の
形態は、入力装置1と、ソースファイル生成装置4と、
出力装置2と、記憶装置3と、を備えて構成されてい
る。
FIG. 1 is a block diagram showing a functional configuration of a combined view reference type compiling method according to an embodiment of the present invention. Referring to FIG. 1, an embodiment of the present invention includes an input device 1, a source file generation device 4,
It comprises an output device 2 and a storage device 3.

【0025】入力装置1は、例えばキーボード、フロッ
ピーディスクドライブ、ハードディスクドライブなど
の、ソースファイルを入力可能な装置からなる。出力装
置2は、例えばディスプレイ、フロッピーディスクドラ
イブ、ハードディスクドライブなどの、出力ファイルを
出力可能な装置からなる。記憶装置3は、一時記憶装置
などの一時的に情報を格納可能な記憶装置である。
The input device 1 is a device that can input a source file, such as a keyboard, a floppy disk drive, or a hard disk drive. The output device 2 is a device that can output an output file, such as a display, a floppy disk drive, or a hard disk drive. The storage device 3 is a storage device such as a temporary storage device capable of temporarily storing information.

【0026】ソースファイル生成装置4はプログラム制
御によって動作する装置で、入力されたソースファイル
を解析して、組み当てなおしたソースファイルを出力す
る装置である。このソースファイル生成装置4は、構文
解析部4−1、型解析部4−2、コード組み立て部4−
3、出力部4−4と、を含む。
The source file generation device 4 is a device that operates under program control, and that analyzes an input source file and outputs a reassembled source file. The source file generation device 4 includes a syntax analysis unit 4-1, a type analysis unit 4-2, a code assembly unit 4-
3, an output unit 4-4.

【0027】記憶装置3は、型情報テーブル3−1を含
む。記憶装置3は、型解析部4−1により、型情報テー
ブル3−1を生成する。
The storage device 3 includes a type information table 3-1. The storage device 3 generates the type information table 3-1 by the type analysis unit 4-1.

【0028】ソースファイル生成装置4は、入力装置1
から入力されたソースファイルを解析し、記憶装置3に
型情報を設定し、これを用いて、コードを組み立て、出
力装置2に対して、展開されたコードを出力する。
The source file generation device 4 includes the input device 1
It analyzes the source file input from, sets type information in the storage device 3, assembles a code using this, and outputs the expanded code to the output device 2.

【0029】その際、構文解析部4−1は、入力装置1
から入力されたソースファイルの構文の解析を行い、解
析情報を型解析部4−2に受け渡す。型解析部4−2は
構文解析部4−1から受け渡された解析情報から、型情
報を抽出し、型情報テーブル3−1に設定する。
At this time, the syntax analyzer 4-1 sends the input device 1
The analysis of the syntax of the source file input from is performed, and the analysis information is transferred to the type analysis unit 4-2. The type analysis unit 4-2 extracts the type information from the analysis information passed from the syntax analysis unit 4-1 and sets the type information in the type information table 3-1.

【0030】この設定にあたって、複数のクラスを結合
ビュー指定した結合ビュークラスがあれば、その結合ビ
ュークラスは、 ・どのクラスを結合しているか、 ・その結合ビュークラスにはどんなメンバが存在してい
るか、 ・各クラスにどんなメンバが存在していて、結合ビュー
クラスのどのメンバと関連づけられているか、等の型情
報の設定も行う。
In this setting, if there is a combined view class in which a plurality of classes are designated as a combined view, the combined view class is: which class is combined; and what members are present in the combined view class. And setting of type information such as what members are present in each class and which members of the combined view class are associated with each other.

【0031】コード組み立て部4−3では、型情報テー
ブル3−1を参照し、展開コードを出力部4−4に受け
渡す。その際、結合ビュークラスのオブジェクトがあっ
た場合は、その結合ビュー指定されたオブジェクトのア
ドレスを保持する結合オブジェクトを生成する。
The code assembling unit 4-3 refers to the type information table 3-1 and transfers the expanded code to the output unit 4-4. At this time, if there is an object of the combined view class, a combined object that holds the address of the object specified by the combined view is generated.

【0032】結合ビュークラスのメンバに対する参照コ
ードがあった場合は、当該メンバが、結合ビュー指定さ
れた各クラスの中で、どのクラスのメンバに対応してい
るかを、型情報テーブル3−1から参照し、結合オブジ
ェクトからそのメンバが存在するクラスのオブジェクト
に対する参照コードに書き換えて展開する。
If there is a reference code for a member of the combined view class, the type information table 3-1 indicates which class member the member corresponds to in each class specified in the combined view. It references and rewrites from the combined object to the reference code for the object of the class in which the member exists, and expands it.

【0033】出力部4−4では、コード組み立て部4−
3から受け取った展開コードを出力装置2に受け渡す。
In the output unit 4-4, the code assembling unit 4-
3 is transferred to the output device 2.

【0034】次に、図1及び、図2を参照して、本発明
の実施の形態の動作について説明する。図2は、本発明
の実施の形態の動作を説明するためのフローチャートで
ある。
Next, the operation of the embodiment of the present invention will be described with reference to FIGS. FIG. 2 is a flowchart for explaining the operation of the embodiment of the present invention.

【0035】入力装置1から入力されたソースコードは
構文解析部4−1に渡される。構文解析部4−1では、
構文の解析を行い(ステップA1)、型情報があった場
合には、その型情報を型解析部4−2に受け渡す(ステ
ップA2)。
The source code input from the input device 1 is passed to the syntax analyzer 4-1. In the syntax analysis unit 4-1,
The syntax is analyzed (step A1), and if there is type information, the type information is transferred to the type analysis unit 4-2 (step A2).

【0036】型解析部4−2では、型の定義の場合、型
情報を型情報テーブル3−1に設定する。また、ある型
のオブジェクトの宣言がある場合は、そのオブジェクト
と型の対応関係を型情報テーブル3−1に設定する(ス
テップA3)。
In the case of the type definition, the type analysis unit 4-2 sets the type information in the type information table 3-1. If there is a declaration of an object of a certain type, the correspondence between the object and the type is set in the type information table 3-1 (step A3).

【0037】結合ビュークラスの定義の場合は、それに
加えて、結合ビュー指定されたクラスの情報と、結合ビ
ュークラスのどのメンバがどのクラスのメンバと関連づ
けられているかを型情報テーブル3−1に設定する。
In the case of the definition of the join view class, in addition to the above, the type information table 3-1 shows information on the class designated by the join view and which member of the join view class is associated with which class member. Set.

【0038】結合ビュークラス型のオブジェクトの宣言
がある場合は、そのオブジェクトと型の対応関係を型情
報テーブル3−1に設定する(ステップA4,A5)。
If there is a declaration of a combined view class type object, the correspondence between the object and the type is set in the type information table 3-1 (steps A4 and A5).

【0039】次に、コード組み立て部4−3で、結合ビ
ュークラス型のオブジェクト宣言があるかどうかを判定
し(ステップA6)、結合オブジェクトの生成を結合ビ
ュークラス内で指定された生成関数内で行うようなコー
ドを出力する(ステップA7)。
Next, the code assembling unit 4-3 determines whether or not there is an object declaration of the combined view class type (step A6), and generates the combined object in the generation function specified in the combined view class. A code to be executed is output (step A7).

【0040】結合ビュークラス型のオブジェクトのメン
バに対する参照式が解析されたコード中にあった場合に
は(ステップA8)、その結合ビュークラスがどのクラ
スを結合ビュー指定した型なのかの情報と、参照してい
るメンバは、どのクラスのメンバなのかの情報を型情報
テーブル3−1を参照して、結合ビュー指定されたオブ
ジェクトへのポインタを保持する結合クラス経由の参照
式に展開する(ステップA9)。
If the reference expression for the member of the object of the join view class type is present in the analyzed code (step A8), information on which class is the join view class and the type in which the join view is specified, and The referencing member expands the information of which class the member belongs to with reference to the type information table 3-1 to a reference expression via a joint class holding a pointer to an object designated by the joint view (step A9).

【0041】出力部4−4でコード組み立て部から受け
取ったコードを出力装置に出力する(ステップA1
0)。
The output unit 4-4 outputs the code received from the code assembling unit to the output device (step A1).
0).

【0042】上記した本発明の実施の形態を更に具体的
に説明すべく、本発明の実施例について図3及び図4を
参照して詳細に説明する。
In order to more specifically describe the embodiment of the present invention, an embodiment of the present invention will be described in detail with reference to FIGS.

【0043】図3は、オブジェクト指向言語であるC+
+を結合ビュークラス対応に拡張した構文のソースコー
ドと、このソースコードを本実施例により展開したコー
ドの一部を示す。図4は、ソース実行時のオブジェクト
の状態を示している。
FIG. 3 shows an object-oriented language C +
The following shows a source code of a syntax in which + is extended to support a combined view class and a part of a code obtained by expanding the source code according to the present embodiment. FIG. 4 shows the state of the object when the source is executed.

【0044】図3では、クラスAとクラスBとクラスC
の結合していない基本クラスがある。次に、クラスAと
クラスBを結合した結合ビュークラスA_Bを定義す
る。
In FIG. 3, class A, class B and class C
There is a base class that is not combined. Next, a combined view class A_B that combines the class A and the class B is defined.

【0045】更に、クラスCと結合ビュークラスA_B
を結合した結合ビュークラスのC__A_Bを定義す
る。
Further, the class C and the combined view class A_B
Is defined as a combined view class C__A_B.

【0046】結合ビュークラス中では、従来技術で説明
した導出関数をメンバ関数名derive()として必
ず記述する必要がある。
In the join view class, the derived function described in the related art must be described as a member function name drive ().

【0047】derive()関数は、結合ビュークラ
スのオブジェクトを生成する時に起動し、結合ビュー指
定されるオブジェクト、ここでは、objAxやobj
By(xは1、2、3のいずれか、yは4、5、6のい
ずれか)のアドレスを保持する結合オブジェクトJOI
N<A*,B*>を生成し、そのアドレスを返却する。
The drive () function is activated when an object of the combined view class is generated, and the object specified by the combined view, here, objAx or obj
A combined object JOI holding an address of By (x is one of 1, 2, and 3, and y is one of 4, 5, and 6)
N <A *, B *> is generated, and the address is returned.

【0048】図3のclassA_Bと、classC
__B_A中の、derive()関数中のExten
tは、<>の中のポインタ型の指すクラスのオブジェク
トの集合オブジェクトを表し、Extentのメンバ関
数select(where条件式)は、条件式に該当
するオブジェクトのアドレスを返却するメンバ関数であ
る。
ClassA_B and classC in FIG.
Exten in the drive () function in __B_A
t represents a set object of the object of the class indicated by the pointer type in <>, and the member function select (where conditional expression) of Extent is a member function for returning the address of the object corresponding to the conditional expression.

【0049】図3に示したソースコードを入力とする場
合について、図2のフローチャートを参照して本実施例
の動作を説明すると、ステップA6で結合ビュークラス
のオブジェクトかどうかの判定を行い、オブジェクトo
bj_A_Bと、オブジェクトobj_C__A_Bが
結合ビュークラスのオブジェクトであるという情報を設
定する。
The operation of the present embodiment when the source code shown in FIG. 3 is input will be described with reference to the flow chart of FIG. 2. In step A6, it is determined whether or not the object is a combined view class object. o
Information that bj_A_B and the object obj_C__A_B are objects of the combined view class is set.

【0050】ステップA8で、結合ビュークラスのオブ
ジェクトのメンバの参照式かどうかの判定を行い、ob
j_C__A_B.a等の参照式があった場合、型情報
テーブルを参照し、元のオブジェクトの値を取り出すた
めに、元のオブジェクトへのポインタを保持しているJ
OIN<C*,JOIN<A*,B*>>型のオブジェ
クトのポインタ、JOIN<A*,B*>型のオブジェ
クトのポインタを経由したコードを展開する。
In step A8, it is determined whether or not the expression is a reference expression of a member of the object of the combined view class.
j_C__A_B. If there is a reference expression such as “a”, J that holds a pointer to the original object to refer to the type information table and extract the value of the original object
The code through the pointer of the object of the type OIN <C *, JOIN <A *, B *> and the pointer of the object of the type JOIN <A *, B *> is developed.

【0051】図4は、図3に示したソースコードを実行
した時のオブジェクトの状態を示す。基本型のクラスの
classAのオブジェクトにはobjA1、objA
2、objA3が存在する(図4(a)参照)。
FIG. 4 shows the state of the object when the source code shown in FIG. 3 is executed. ObjA1 and objA are the objects of classA of the basic type class.
2, objA3 exists (see FIG. 4A).

【0052】基本型のクラスのclassBのオブジェ
クトにはobjB1、objB2、objB3が存在す
る(図4(b)参照)。
ObjB1, objB2, and objB3 exist as class B objects of the basic type class (see FIG. 4B).

【0053】基本型のクラスのclassCのオブジェ
クトにはobjC1、objC2、objC3が存在す
る(図4(c)参照)。
There are objC1, objC2, and objC3 in the classC object of the basic type class (see FIG. 4C).

【0054】結合ビュークラス型のオブジェクトは、o
bj_A_BとobjC__A_Bが存在する。obj
_A_Bは、クラスAとクラスBを結合ビュー指定した
場合ビュークラスのオブジェクトである。obj_A_
Bは、図4(d)に示すように、結合オブジェクトJO
IN<A*,B*>を保持しており、結合オブジェクト
JOIN<A*,B*>は、objAxとobjByを
保持している。objAxは、objA1、objA
2、及びobjA3のうちのいずれかを示しており、o
bjByは、objB1、objB2、及びobjB3
のうちのいずれかを示す。
An object of the combined view class type is o
bj_A_B and objC__A_B exist. obj
_A_B is a view class object when a combined view is specified for class A and class B. obj_A_
B is, as shown in FIG.
IN <A *, B *>, and the combined object JOIN <A *, B *> holds objAx and objBy. objAx is objA1, objA
2, and any of objA3, and o
bjBy is objB1, objB2, and objB3
Indicates one of the following.

【0055】obj_C__A_Bは、クラスCと結合
オブジェクトJOIN<A*,B*>を結合ビュー指定
した結合ビュークラスのオブジェクトである(図4
(e)参照)。
Obj_C__A_B is an object of a combined view class that specifies a combined view of the class C and the combined object JOIN <A *, B *> (FIG. 4).
(E)).

【0056】obj_C__A_Bは、結合オブジェク
トJOIN<C*,JOIN<A*,B*>*>を保持
しており、結合オブジェクトのJOIN<C*,JOI
N<A*,B*>*>はobjCxとJOIN<A*,
B*>を保持している。objCzは、objC1、o
bjC2、及びobjC3のうちのいずれかを示す。
Obj_C__A_B holds connection objects JOIN <C *, JOIN <A *, B *>*>, and stores connection objects JOIN <C *, JOI.
N <A *, B *>*> are objCx and JOIN <A *,
B *> is held. objCz is objC1, o
Indicates any of bjC2 and objC3.

【0057】すなわち、図3(A)のC++ソースプロ
グラムのA−1コード部は、展開されて図3(B)のB
−1に示すようなものとなる。
That is, the A-1 code portion of the C ++ source program of FIG.
-1.

【0058】[0058]

【発明の効果】以上説明したように、本発明によれば、
複数のクラスを結合ビュー指定したオブジェクトのメン
バの参照式の記述量を簡略化するという効果を奏する。
本発明によれば、特に、複数回結合ビュー指定したクラ
スのオブジェクトの場合には、より簡略化されることと
なる。このため、本発明によれば、参照式の記述量の縮
減を達成し、これに伴いソフトウェアのバグを減らすこ
とができ、保守性を向上するという効果を奏するもので
ある。
As described above, according to the present invention,
This has the effect of simplifying the description amount of the reference expression of the member of the object for which a plurality of classes are specified as a combined view.
According to the present invention, in particular, in the case of an object of a class for which a combined view is specified a plurality of times, the simplification is further simplified. Therefore, according to the present invention, it is possible to achieve a reduction in the amount of description of a reference expression, thereby reducing software bugs and improving maintainability.

【0059】この理由は、本発明においては、ソースコ
ードの解析中の型解析部にて、結合ビュー指定クラスの
情報を型情報テーブルに保持しておき、この情報を使っ
て、結合オブジェクトを参照する展開コードを出力でき
る、ことによる。
The reason for this is that, in the present invention, the type analysis unit during the analysis of the source code holds the information of the join view designation class in the type information table, and refers to the join object using this information. To be able to output the expansion code.

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

【図1】本発明の実施の形態に係る結合ビュー参照式コ
ンパイル方式の構成を機能ブロックにて示した図であ
る。
FIG. 1 is a functional block diagram showing a configuration of a combined view reference type compiling method according to an embodiment of the present invention.

【図2】本発明の実施の形態に係る結合ビュー参照式コ
ンパイル方式の動作を説明するためのフローチャートで
ある。
FIG. 2 is a flowchart for explaining the operation of a combined view reference type compiling method according to the embodiment of the present invention;

【図3】本発明の一実施例を説明するための図であり、
C++言語を結合ビュークラス対応に拡張した構文のソ
ースコードと、それを結合ビュー参照式コンパイル方式
で、C++対応に展開したソースを示す図である。
FIG. 3 is a diagram for explaining one embodiment of the present invention;
It is a figure which shows the source code of the syntax which expanded the C ++ language in correspondence with the combined view class, and the source which expanded it in C ++ correspondence by the combined view reference formula compilation method.

【図4】本発明の一実施例を説明するための図であり、
図3のソースコードにおける、オブジェクトの状態を示
す図である。
FIG. 4 is a diagram for explaining one embodiment of the present invention;
FIG. 4 is a diagram showing a state of an object in the source code of FIG. 3.

【図5】従来技術のソースファイル生成装置の構成を機
能ブロックにて示した図である。
FIG. 5 is a diagram showing the configuration of a source file generating apparatus according to the related art in functional blocks.

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

1 入力装置 2 出力装置 3 記憶装置 3−1 型情報テーブル 4 ソースファイル生成装置 4−1 構文解析部 4−2 型解析部 4−3 コード組み立て部 4−4 出力部 10 プログラム編集装置 11 ソースファイル生成装置 12 定義格納機構 13 定義格納領域 14 ソースファイル生成機構 15 ソースファイル Reference Signs List 1 input device 2 output device 3 storage device 3-1 type information table 4 source file generation device 4-1 syntax analysis unit 4-2 type analysis unit 4-3 code assembling unit 4-4 output unit 10 program editing device 11 source file Generator 12 definition storage mechanism 13 definition storage area 14 source file generation mechanism 15 source file

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】複数のデータ定義を結合し新たな結合ビュ
ー定義を所持するプログラミング言語処理系において、 ソースコードの構文を解析する手段と、 解析した構文の型情報を解析し型情報テーブルを生成す
る手段と、 前記型情報テーブルを参照し参照コードを生成する手段
と、 展開コードを出力する手段と、 を備えたことを特徴とする結合ビュー参照式コンパイル
方式。
1. A means for analyzing a syntax of a source code in a programming language processing system having a new combined view definition by combining a plurality of data definitions, and analyzing a type information of the analyzed syntax to generate a type information table. And a means for referring to the type information table to generate a reference code; and a means for outputting an expanded code.
【請求項2】前記型情報を解析し型情報テーブルを生成
する手段が、結合ビュー指定したクラスを検出した際に
該クラス情報も設定し、前記参照コードを生成する手段
は、前記ソースコード中に結合ビュークラス型のオブジ
ェクトのメンバを直接参照する参照式があれば、これを
結合ビュー指定されたオブジェクトへのポインタを保持
する結合クラスオブジェクト経由の参照式に展開する、
ことを特徴とする請求項1記載の結合ビュー参照式コン
パイル方式。
2. The method according to claim 1, wherein the means for analyzing the type information and generating a type information table also sets the class information when detecting a class designated as a combined view, and the means for generating the reference code includes: If there is a reference expression that directly references a member of an object of the join view class type, expand this into a reference expression via the join class object that holds a pointer to the specified object in the join view,
3. The compiling method according to claim 1, wherein:
【請求項3】複数のデータ定義のオブジェクトを結合し
たオブジェクトを一つのデータ定義のオブジェクトとし
て参照することを可能とする結合ビュー参照式コンパイ
ル方式であって、ソースコードのコンパイル時に、該ソ
ースファイル中に、結合ビュークラスのオブジェクトが
あった場合に、結合クラスのオブジェクトを生成し、 結合ビュークラスのオブジェクトのメンバの参照式が存
在した場合には、生成した前記結合クラスのオブジェク
ト経由の参照式となるように展開して出力ファイルを出
力することを特徴とする結合ビュー参照式コンパイル方
式。
3. A combined view reference type compiling method that enables an object obtained by combining a plurality of data definition objects to be referred to as a single data definition object. In the case where there is an object of the joined view class, an object of the joined class is generated, and if a reference expression of a member of the object of the joined view class exists, a reference expression via the object of the generated joined class is generated. A combined view reference type compiling method characterized in that the output file is output after being expanded.
JP8188337A 1996-06-28 1996-06-28 Combined view reference expression compilation system Pending JPH1021078A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8188337A JPH1021078A (en) 1996-06-28 1996-06-28 Combined view reference expression compilation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8188337A JPH1021078A (en) 1996-06-28 1996-06-28 Combined view reference expression compilation system

Publications (1)

Publication Number Publication Date
JPH1021078A true JPH1021078A (en) 1998-01-23

Family

ID=16221856

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8188337A Pending JPH1021078A (en) 1996-06-28 1996-06-28 Combined view reference expression compilation system

Country Status (1)

Country Link
JP (1) JPH1021078A (en)

Similar Documents

Publication Publication Date Title
EP1388064B1 (en) System and method for combinatorial test generation in a compatibility testing environment
US5799266A (en) Automatic generation of test drivers
JPH11242597A (en) Method for generation of flow graph of java byte code data
US7624381B1 (en) Portable detection of start and completion of object construction
JP3196675B2 (en) Language processing method
JPH1021078A (en) Combined view reference expression compilation system
JP3327674B2 (en) Program translation apparatus and method
JP3260264B2 (en) How to create and operate patches at a high-level language level
JP3019874B2 (en) Program generation / synthesis apparatus and method
JP3604936B2 (en) Optimization method, optimization device, and recording medium
JP2882876B2 (en) Program test method
JPH11154093A (en) Program compiler and storage medium recording compiler program
JP3210203B2 (en) Program test method and SQL simulator
JPH02245934A (en) Data processor
JP2009515243A (en) Method for generating a simulation program executable on a host computer
JPH0689187A (en) Inline expansion optimizing method
JPH02236732A (en) Source program generating system
JPH1083328A (en) Pseudo input/output realizing system for single body test
JP2003330731A (en) Project management file generating device
CN117149207A (en) Method and system for realizing automatic formatting generation of frame work construction number through RunScript
JPH06250882A (en) Program test execution system
JP2001075815A (en) Methods for generating and loading source built-in type executable program and computer-readable recording medium with source built-in type executable program generation program recorded thereon
JPH0922359A (en) Method for initializing simulation system
JP2000047862A (en) Software development supporting method, device therefor and storage medium
JPH06266562A (en) Object code size optimizing system in object-oriented language processing system

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000328