JPH1011299A - Compiler with delay evaluating function, compiling method, and medium storing compile program - Google Patents

Compiler with delay evaluating function, compiling method, and medium storing compile program

Info

Publication number
JPH1011299A
JPH1011299A JP16775896A JP16775896A JPH1011299A JP H1011299 A JPH1011299 A JP H1011299A JP 16775896 A JP16775896 A JP 16775896A JP 16775896 A JP16775896 A JP 16775896A JP H1011299 A JPH1011299 A JP H1011299A
Authority
JP
Japan
Prior art keywords
token
delay evaluation
evaluation
delay
read
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
JP16775896A
Other languages
Japanese (ja)
Inventor
Masaya Obata
雅哉 小畑
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 JP16775896A priority Critical patent/JPH1011299A/en
Publication of JPH1011299A publication Critical patent/JPH1011299A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Multi Processors (AREA)

Abstract

PROBLEM TO BE SOLVED: To efficiently compile a source program by syntax-analyzing the source program including an instructing sentence instructing for inferring forward whatever syntax analyzing element this instructing sentence is like. SOLUTION: Whether a token, which a token selectively reading part 4 has read from a source file 1, is between the starting position and the finishing position of delaying evaluation or not, is judged by a delay evaluation starting position judging part 5 and a delay evaluation terminating position judging part 6. A token in a section excepting for a delay evaluating section is made an object by an evaluation processing part 9 to be outputted to an object file 10 and a token in the delay evaluating section is stored in a delay evaluating token storing table 2 by a delay evaluation partially storing part 7. After a delay evaluation developing position judging part 8 judges that the read token is a token at a delay evaluation developing position, the reading part 4 reads the token strident in the table 2 to make it an object to output to the file 10.

Description

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

【発明の属する技術分野】本発明は、原始プログラムを
翻訳して目的プログラムを生成するコンパイル装置に関
し、特に、前方参照が発生する可能性のある原始プログ
ラムを翻訳して目的プログラムを生成する遅延評価機能
付きコンパイル装置、コンパイル方法、およびコンパイ
ルプログラムを記憶する媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiling apparatus for translating a source program to generate a target program, and more particularly to a delay evaluation for generating a target program by translating a source program which may cause forward reference. The present invention relates to a compiling device with a function, a compiling method, and a medium for storing a compiling program.

【0001】[0001]

【従来の技術】「佐々政孝著、プログラミング言語処理
系、岩波書店、1989年10月31日発行」には、
「前方参照」と「バックパッチング」について記載され
ている。
2. Description of the Related Art "Masataka Sasa, Programming Language Processing System, Iwanami Shoten, Published October 31, 1989"
"Forward reference" and "back patching" are described.

【0002】前方参照とは、ソースプログラム中の命令
文が後から定義されるものを参照することを指示する方
法であり、例えばgoto文の飛び先のラベルが該go
to文より後で定義されている場合がこれに当てはま
る。
[0002] Forward reference is a method of instructing a statement in a source program to refer to a statement defined later. For example, a label at a jump destination of a goto statement is referred to as the go statement.
This is the case if it is defined after the to statement.

【0003】このような前方参照を指示するgoto文
を含むソースプログラムを頭から順番に入力して目的プ
ログラムを生成する場合には、該goto文に関しては
飛び先の番地をその場では決定することができないた
め、とりあえずそのgoto文の位置を覚えておき、後
で飛び先のラベルが実際に定義されたときに、先ほど覚
えておいたgoto文の飛び先の欄に正しい番地を埋め
込む。この方法をバックパッチングと呼ぶ。
When a source program including a goto statement indicating such forward reference is input in order from the beginning to generate a target program, the jump address of the goto statement must be determined on the spot. Therefore, the position of the goto statement is memorized for the time being, and when the label of the jump destination is actually defined later, a correct address is embedded in the jump destination column of the goto statement that was previously remembered. This method is called back patching.

【0004】[0004]

【発明が解決しようとする課題】この従来のバックパッ
チング方法は、goto文のラベルを処理対象としてい
る。該バックパッチング方法においては、goto文の
ラベルが必要とする情報が、定義されたラベル位置だけ
なので、該ラベルが未定義であっても構文解析を続ける
ことができる。
In this conventional back patching method, a label of a goto sentence is processed. In the backpatching method, since the information required by the label of the goto statement is only the defined label position, the syntax analysis can be continued even if the label is undefined.

【0005】例えば、以下のようなソースプログラムに
おいて、 goto文のラベルL1が未定義であっても、構文解析
の要素としては該ラベルを含んだgoto文の全てを識
別子として扱うことで構文解析木を作成することができ
るので、構文解析処理を続行することができる。
For example, in the following source program, Even if the label L1 of the goto statement is undefined, a parsing tree can be created by treating all of the goto statements including the label as identifiers as elements of the parsing, so that the parsing processing is continued. can do.

【0006】しかしながら、以下のようなgoto文を
含まないソースプログラムでは、 Tがどのような構文解析の要素なのかを特定することが
できないため、構文解析木を作成することができず、こ
のような命令文が出現した時点で構文解析処理を続行す
ることができなくなるという問題点があった。
However, in the following source program that does not include a goto statement, Since it is not possible to specify what kind of parsing element T is, a parsing tree cannot be created, and the parsing process cannot be continued when such a command statement appears. There was a problem.

【0007】本発明の目的は、前方参照を指示する命令
文がどのような構文解析の要素であるかにかかわらず、
該命令文を含むソースプログラムを構文解析し、効率良
くコンパイルすることができるコンパイル装置を提供す
ることにある。
[0007] The object of the present invention is to provide a method for parsing a sentence indicating a forward reference irrespective of the type of parsing element.
It is an object of the present invention to provide a compiling device capable of parsing a source program including the statement and compiling it efficiently.

【0008】[0008]

【課題を解決するための手段】本発明の第1の遅延評価
機能付きコンパイル装置は、ソースプログラムに含まれ
るトークン列からトークンを順次読み込むトークン選択
読み込み部と、前記トークン選択読み込み部が読み込ん
だトークンが、予め前記トークン列の任意の区間に設定
した遅延評価区間内のトークンである場合には、該トー
クンを遅延評価トークン記憶テーブルに記憶する遅延評
価部分記憶部と、前記遅延評価部分記憶部により前記遅
延評価トークン記憶テーブルに記憶されたトークンを順
次読み込み、オブジェクト化してオブジェクトファイル
へ出力する評価処理部とから構成されている。
According to a first aspect of the present invention, there is provided a compiling device having a delay evaluation function, comprising: a token selection reading unit for sequentially reading tokens from a token sequence included in a source program; and a token read by the token selection reading unit. Is a token in a delay evaluation section set in advance in an arbitrary section of the token string, a delay evaluation section storage section that stores the token in a delay evaluation token storage table, and a delay evaluation section storage section. An evaluation processing unit for sequentially reading the tokens stored in the delay evaluation token storage table, converting the tokens into objects, and outputting the objects to an object file.

【0009】本発明の第2の遅延評価機能付きコンパイ
ル装置は、第1の遅延評価機能付きコンパイル装置にお
いて、前記評価処理部が、さらに、前記トークン選択読
み込み部が読み込んだトークンが、予め前記トークン列
の任意の区間に設定した遅延評価区間外のトークンであ
る場合には、該トークンをオブジェクト化してオブジェ
クトファイルへ出力することを特徴とする。
A second compiling device with a delay evaluation function according to the present invention is the compiling device with the first delay evaluation function, wherein the evaluation processing unit further includes a token read by the token selection reading unit. If the token is outside the delay evaluation section set in an arbitrary section of the column, the token is turned into an object and output to an object file.

【0010】本発明の第3の遅延評価機能付きコンパイ
ル装置は、第2の遅延評価機能付きコンパイル装置にお
いて、さらに、前記トークン選択読み込み部が読み込ん
だトークンが予め前記トークン列の任意の箇所に設定し
た遅延評価の開始位置のトークンに一致するか否かを判
定し、一致した場合には読み込んだトークンに対応する
オブジェクトを生成し、オブジェクトファイルへ出力す
る遅延評価開始位置判定部と、前記ソースプログラムか
ら前記遅延評価開始位置判定部がオブジェクト化したト
ークンの位置以降のトークンを順次読み込み、該トーク
ンが予め前記トークン列の任意の箇所に設定した遅延評
価の終了位置のトークンに一致するか否かを判定する遅
延評価終了位置判定部とを備え、前記遅延評価部分記憶
部が、前記遅延評価終了位置判定部が前記遅延評価の終
了位置のトークンに一致するトークンを読み込んだ時点
で、該遅延評価終了位置判定部がそれまでに読み込んだ
トークンを定義情報なしに変更することができる状態に
まで評価して前記遅延評価トークン記憶テーブルに記憶
することを特徴とする。
A third compiling device with a delay evaluation function according to the present invention is the compiling device with the second delay evaluation function, wherein the token read by the token selection reading unit is set in advance at an arbitrary position in the token sequence. A delay evaluation start position determining unit that determines whether or not the token matches the token at the start position of the delayed evaluation, generates an object corresponding to the read token if the match, and outputs the object to an object file; The delay evaluation start position determination unit sequentially reads tokens after the position of the tokenized object, and determines whether or not the token matches the token at the delay evaluation end position set in advance in any part of the token sequence. A delay evaluation end position determination unit for determining, wherein the delay evaluation partial storage unit stores the delay evaluation When the end position determination unit reads a token that matches the token at the end position of the delay evaluation, the delay evaluation end position determination unit returns to a state in which the previously read token can be changed without definition information. It is characterized in that it is evaluated and stored in the delay evaluation token storage table.

【0011】本発明の第4の遅延評価機能付きコンパイ
ル装置は、第3の遅延評価機能付きコンパイル装置にお
いて、さらに、前記トークン選択読み込み部が読み込ん
だトークンが、予め設定した遅延評価の展開位置のトー
クンに一致するか否かを判定する遅延評価展開位置判定
部を備え、前記トークン選択読み込み部が、読み込んだ
トークンが前記遅延評価展開位置判定部により遅延評価
の展開位置のトークンに一致すると判定された場合、そ
の後は前記遅延評価トークン記憶テーブルからトークン
を読み込み、読み込んだトークンを前記評価処理部によ
ってオブジェクト化して前記オブジェクトファイルへ出
力することを特徴とする。
The fourth compiling device with a delay evaluation function according to the present invention is the compiling device with the third delay evaluation function, wherein the token read by the token selection reading unit further includes a predetermined delay evaluation developing position. A delay evaluation deployment position determination unit that determines whether or not the token matches the token; and the token selection reading unit determines that the read token matches the token at the delay evaluation deployment position by the delay evaluation deployment position determination unit. Then, the token is read from the delay evaluation token storage table, and the read token is converted into an object by the evaluation processing unit and output to the object file.

【0012】本発明の第5の遅延評価機能付きコンパイ
ル装置は、第4の遅延評価機能付きコンパイル装置にお
いて、さらに、前記トークン選択読み込み部が、前記遅
延評価トークン記憶テーブルからトークンを読み込むこ
とができない場合には、前記ソースプログラムからトー
クンを読み込むことを特徴とする。
In a fifth aspect of the present invention, in the compiling apparatus with a delay evaluation function, the token selecting and reading section may not read a token from the delay evaluation token storage table. In this case, a token is read from the source program.

【0013】本発明の第1の遅延評価機能付きコンパイ
ル方法は、ソースプログラムに含まれるトークン列から
トークンを順次読み込むトークン選択読み込みステップ
と、前記トークン選択読み込みステップが読み込んだト
ークンが、予め前記トークン列の任意の区間に設定した
遅延評価区間内のトークンである場合には、該トークン
を遅延評価トークン記憶テーブルに記憶する遅延評価部
分記憶ステップと、前記遅延評価部分記憶ステップによ
り前記遅延評価トークン記憶テーブルに記憶されたトー
クンを順次読み込み、オブジェクト化してオブジェクト
ファイルへ出力する評価処理ステップとを含む。
A first compiling method with a delay evaluation function according to the present invention includes a token selecting and reading step for sequentially reading tokens from a token sequence included in a source program; If the token is within a delay evaluation section set in an arbitrary section of the delay evaluation token storage table, the token is stored in a delay evaluation token storage table. Evaluation processing step of sequentially reading the tokens stored in the object file, converting the tokens into objects, and outputting the objects to an object file.

【0014】本発明の第2の遅延評価機能付きコンパイ
ル方法は、第1の遅延評価機能付きコンパイル方法にお
いて、前記評価処理ステップが、さらに、前記トークン
選択読み込みステップが読み込んだトークンが、予め前
記トークン列の任意の区間に設定した遅延評価区間外の
トークンである場合には、該トークンをオブジェクト化
してオブジェクトファイルへ出力することを特徴とす
る。
According to a second compiling method with a delayed evaluation function of the present invention, in the first compiling method with a delayed evaluation function, the evaluation processing step further comprises the step of: If the token is outside the delay evaluation section set in an arbitrary section of the column, the token is turned into an object and output to an object file.

【0015】本発明の第3の遅延評価機能付きコンパイ
ル方法は、第2の遅延評価機能付きコンパイル方法にお
いて、さらに、前記トークン選択読み込みステップが読
み込んだトークンが予め前記トークン列の任意の箇所に
設定した遅延評価の開始位置のトークンに一致するか否
かを判定し、一致した場合には読み込んだトークンに対
応するオブジェクトを生成し、オブジェクトファイルへ
出力する遅延評価開始位置判定ステップと、前記ソース
プログラムから前記遅延評価開始位置判定ステップがオ
ブジェクト化したトークンの位置以降のトークンを順次
読み込み、該トークンが予め前記トークン列の任意の箇
所に設定した遅延評価の終了位置のトークンに一致する
か否かを判定する遅延評価終了位置判定ステップとを含
み、前記遅延評価部分記憶ステップが、前記遅延評価終
了位置判定ステップが前記遅延評価の終了位置のトーク
ンに一致するトークンを読み込んだ時点で、該遅延評価
終了位置判定ステップがそれまでに読み込んだトークン
を定義情報なしに変更することができる状態にまで評価
して前記遅延評価トークン記憶テーブルに記憶すること
を特徴とする。
A third compilation method with a delay evaluation function according to the present invention is the compilation method with the second delay evaluation function, wherein the token read by the token selection reading step is previously set at an arbitrary position in the token sequence. A delay evaluation start position determining step of determining whether or not the token matches the token at the start position of the delayed evaluation, generating an object corresponding to the read token if the match is found, and outputting the object to an object file; The delay evaluation start position determination step sequentially reads tokens after the position of the tokenized object, and determines whether or not the token matches the token at the delay evaluation end position set in advance in any part of the token string. Determining a delay evaluation end position determining step; When the delay evaluation end position determination step reads a token that matches the token at the delay evaluation end position, the delay evaluation end position determination step stores the token that has been read so far without definition information. It is characterized in that the state is evaluated up to a state where it can be changed and stored in the delay evaluation token storage table.

【0016】本発明の第4の遅延評価機能付きコンパイ
ル方法は、第3の遅延評価機能付きコンパイル方法にお
いて、さらに、前記トークン選択読み込みステップが読
み込んだトークンが、予め設定した遅延評価の展開位置
のトークンに一致するか否かを判定する遅延評価展開位
置判定ステップを含み、前記トークン選択読み込みステ
ップが、読み込んだトークンが前記遅延評価展開位置判
定ステップにより遅延評価の展開位置のトークンに一致
すると判定された場合、その後は前記遅延評価トークン
記憶テーブルからトークンを読み込み、読み込んだトー
クンを前記評価処理ステップによってオブジェクト化し
て前記オブジェクトファイルへ出力することを特徴とす
る。
A fourth compilation method with a delay evaluation function according to the present invention is the compilation method with the third delay evaluation function, further comprising the step of: A delay evaluation deployment position determination step of determining whether or not the token matches the token; the token selection reading step determines that the read token matches the delay evaluation development position token by the delay evaluation deployment position determination step. Then, the token is read from the delay evaluation token storage table, and the read token is converted into an object in the evaluation processing step and output to the object file.

【0017】本発明の第5の遅延評価機能付きコンパイ
ル方法は、第4の遅延評価機能付きコンパイル方法にお
いて、さらに、前記トークン選択読み込みステップが、
前記遅延評価トークン記憶テーブルからトークンを読み
込むことができない場合には、前記ソースプログラムか
らトークンを読み込むことを特徴とする。
According to a fifth compilation method with a delay evaluation function of the present invention, in the fourth compilation method with a delay evaluation function, the token selection reading step may further comprise:
If the token cannot be read from the delay evaluation token storage table, the token is read from the source program.

【0018】本発明の第1の媒体は、ソースプログラム
に含まれるトークン列からトークンを順次読み込むトー
クン選択読み込みステップと、前記トークン選択読み込
みステップが読み込んだトークンが、予め前記トークン
列の任意の区間に設定した遅延評価区間内のトークンで
ある場合には、該トークンを遅延評価トークン記憶テー
ブルに記憶する遅延評価部分記憶ステップと、前記遅延
評価部分記憶ステップにより前記遅延評価トークン記憶
テーブルに記憶されたトークンを順次読み込み、オブジ
ェクト化してオブジェクトファイルへ出力する評価処理
ステップとを含む処理をコンピュータに行わせるプログ
ラムを記憶する。
According to a first aspect of the present invention, there is provided a medium comprising: a token selecting and reading step for sequentially reading tokens from a token sequence included in a source program; If the token is within the set delay evaluation section, a delay evaluation partial storage step of storing the token in the delay evaluation token storage table; and a token stored in the delay evaluation token storage table by the delay evaluation partial storage step Are sequentially read, and an evaluation processing step of converting the object into an object and outputting the object to an object file is stored.

【0019】本発明の第2の媒体は、第1の媒体におい
て、前記評価処理ステップが、さらに、前記トークン選
択読み込みステップが読み込んだトークンが、予め前記
トークン列の任意の区間に設定した遅延評価区間外のト
ークンである場合には、該トークンをオブジェクト化し
てオブジェクトファイルへ出力することを特徴とする。
In a second medium according to the present invention, in the first medium, the evaluation processing step further includes a step of determining whether the token read by the token selection reading step is a delay evaluation set in advance in an arbitrary section of the token sequence. If the token is outside the section, the token is converted into an object and output to an object file.

【0020】本発明の第3の媒体は、第2の媒体におい
て、さらに、前記プログラムが、前記トークン選択読み
込みステップが読み込んだトークンが予め前記トークン
列の任意の箇所に設定した遅延評価の開始位置のトーク
ンに一致するか否かを判定し、一致した場合には読み込
んだトークンに対応するオブジェクトを生成し、オブジ
ェクトファイルへ出力する遅延評価開始位置判定ステッ
プと、前記ソースプログラムから前記遅延評価開始位置
判定ステップがオブジェクト化したトークンの位置以降
のトークンを順次読み込み、該トークンが予め前記トー
クン列の任意の箇所に設定した遅延評価の終了位置のト
ークンに一致するか否かを判定する遅延評価終了位置判
定ステップとを含み、前記遅延評価部分記憶ステップ
が、前記遅延評価終了位置判定ステップが前記遅延評価
の終了位置のトークンに一致するトークンを読み込んだ
時点で、該遅延評価終了位置判定ステップがそれまでに
読み込んだトークンを定義情報なしに変更することがで
きる状態にまで評価して前記遅延評価トークン記憶テー
ブルに記憶することを特徴とする。
A third medium according to the present invention is the second medium, wherein the program further comprises: a program which, when the token is read by the token selection reading step, starts the delay evaluation at a predetermined position in the token sequence. A delay evaluation start position determining step of determining whether or not the token matches the token, and if so, generating an object corresponding to the read token and outputting the object to an object file; and The determining step sequentially reads tokens after the position of the tokenized object and determines whether or not the token matches the token at the ending position of the delay evaluation set in advance in any part of the token sequence. A delay evaluation partial storage step, wherein the delay evaluation end is stored. When the position determination step reads a token that matches the token at the end position of the delay evaluation, the delay evaluation end position determination step evaluates the token so far that the previously read token can be changed without definition information. Stored in the delay evaluation token storage table.

【0021】本発明の第4の媒体は、第3の媒体におい
て、さらに、前記プログラムが、前記トークン選択読み
込みステップが読み込んだトークンが、予め設定した遅
延評価の展開位置のトークンに一致するか否かを判定す
る遅延評価展開位置判定ステップを含み、前記トークン
選択読み込みステップが、読み込んだトークンが前記遅
延評価展開位置判定ステップにより遅延評価の展開位置
のトークンに一致すると判定された場合、その後は前記
遅延評価トークン記憶テーブルからトークンを読み込
み、読み込んだトークンを前記評価処理ステップによっ
てオブジェクト化して前記オブジェクトファイルへ出力
することを特徴とする。
A fourth medium according to the present invention is the third medium, wherein the program further checks whether the token read by the token selection reading step matches a token at a predetermined delay evaluation development position. A delay evaluation deployment position determination step of determining whether the read token matches the token at the delay evaluation deployment position by the delay evaluation deployment position determination step. A token is read from the delay evaluation token storage table, and the read token is converted into an object in the evaluation processing step and output to the object file.

【0022】本発明の第5の媒体は、第4の媒体におい
て、さらに、前記トークン選択読み込みステップが、前
記遅延評価トークン記憶テーブルからトークンを読み込
むことができない場合には、前記ソースプログラムから
トークンを読み込むことを特徴とする。
A fifth medium of the present invention is the fourth medium, wherein the token selection reading step further comprises the step of, if the token cannot be read from the delay evaluation token storage table, reading the token from the source program. It is characterized by reading.

【0023】[0023]

【発明の実施の形態】以下、本発明の実施例について、
図を参照しながら詳細に説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, embodiments of the present invention will be described.
This will be described in detail with reference to the drawings.

【0024】図1を参照すると、本発明の第1の実施例
である遅延評価機能付きコンパイル装置は、前方参照が
生じる可能性がある高級言語で記述されたソースプログ
ラムを含むソースファイル1と、遅延評価トークン記憶
テーブル2と、ソースプログラム解析部3と、オブジェ
クトファイル10とを含み、ソースプログラム解析部3
は、トークン選択読み込み部4と、遅延評価開始位置判
定部5と、遅延評価終端位置判定部6と、遅延評価部分
記憶部7と、遅延評価展開位置判定部8と、評価処理部
9とを含む。
Referring to FIG. 1, a compiling apparatus with a lazy evaluation function according to a first embodiment of the present invention includes a source file 1 including a source program described in a high-level language in which forward reference may occur, A delay evaluation token storage table 2, a source program analysis unit 3, and an object file 10;
Includes a token selection reading unit 4, a delay evaluation start position determination unit 5, a delay evaluation end position determination unit 6, a delay evaluation partial storage unit 7, a delay evaluation development position determination unit 8, and an evaluation processing unit 9. Including.

【0025】トークン選択読み込み部4は、遅延評価展
開位置判定部8からの制御情報によって、ソースファイ
ル1と遅延評価トークン記憶テーブル2とのいずれか
ら、識別子・リテラル・文字列・予約語・演算子等の字
句要素(以下、トークンとする)を読み込むかを決定
し、該トークンを読み込む処理を行う。
The token selection reading unit 4 reads the identifier / literal / character string / reserved word / operator from either the source file 1 or the delay evaluation token storage table 2 according to the control information from the delay evaluation development position determination unit 8. It determines whether to read a lexical element (hereinafter, referred to as a token) such as, and performs a process of reading the token.

【0026】遅延評価開始位置判定部5は、トークン選
択読み込み部4から渡されるトークン列の種別および順
番から遅延評価を開始するか否かを判定し、遅延評価を
開始するトークンであると判定した場合には、該トーク
ンを評価し、必要なオブジェクトをオブジェクトファイ
ル10へ出力する。
The delay evaluation start position judging section 5 judges whether or not to start the delay evaluation based on the type and order of the token string passed from the token selection reading section 4, and judges that the token is the one to start the delay evaluation. In this case, the token is evaluated and necessary objects are output to the object file 10.

【0027】遅延評価終端位置判定部6は、ソースファ
イル1からトークンを読み込み、読み込んだトークン列
の種別および順番から遅延評価を終了するか否かを判定
する。
The delay evaluation end position determining unit 6 reads a token from the source file 1 and determines whether to end the delay evaluation based on the type and order of the read token string.

【0028】遅延評価部分記憶部7は、遅延評価終端位
置判定部6から渡されるトークンを、該トークンの定義
情報が不要な部分までの評価を予め解決してから遅延評
価トークン記憶テーブル2に記憶する。
The delay evaluation partial storage unit 7 stores the token passed from the delay evaluation end position determination unit 6 in the delay evaluation token storage table 2 after resolving the evaluation up to the portion where the definition information of the token is unnecessary. I do.

【0029】遅延評価展開位置判定部8は、遅延評価開
始位置判定部5または遅延評価終端位置判定部6から渡
されるトークン列の種別および順番から遅延評価させる
部分を展開するか否かを判定する。
The delay evaluation developing position judging section 8 judges whether or not to expand the part to be subjected to delay evaluation based on the type and order of the token string passed from the delay evaluating start position judging section 5 or the delay evaluating end position judging section 6. .

【0030】評価処理部9は、遅延評価展開位置判定部
8から渡されるトークンを評価し、必要なオブジェクト
をオブジェクトファイル10へ出力する。
The evaluation processing section 9 evaluates the token passed from the delay evaluation development position determination section 8 and outputs necessary objects to the object file 10.

【0031】以下に本発明の第1の実施例である遅延評
価機能付きコンパイル装置について、図1〜図4を参照
して説明する。
A compile device with a delay evaluation function according to a first embodiment of the present invention will be described below with reference to FIGS.

【0032】図3は、仮想的な高級言語で記述されたソ
ースプログラムの例であり、アルファベットは単なるト
ークンを、<refer Z> はZを参照するトークンを、<def
ineZ>はZを定義するトークンを示す。
FIG. 3 shows an example of a source program described in a virtual high-level language, where the alphabet represents a simple token, <refer Z> represents a token referring to Z, and <def
ineZ> indicates a token defining Z.

【0033】図4は、図3のソースプログラムがどのよ
うにコンパイルされていくかを示すタイミングチャート
であり、C’はC定義情報が不要な部分まで評価したト
ークンを、()で囲まれたアルファベットはそれぞれのト
ークンに対応するオブジェクトを、... はそれ以降にト
ークンが続くことを示す。
FIG. 4 is a timing chart showing how the source program of FIG. 3 is compiled. In FIG. 4, C ′ indicates a token evaluated to a portion where C definition information is unnecessary. The alphabet indicates the object corresponding to each token, and ... indicates that the token follows.

【0034】また、この仮想的な高級言語で記述された
ソースプログラムの例では、遅延評価開始位置はB、遅
延評価終端位置はD、遅延評価展開位置はGであるとす
る。
In the example of the source program described in this virtual high-level language, it is assumed that the delay evaluation start position is B, the delay evaluation end position is D, and the delay evaluation development position is G.

【0035】今、ソースファイル1の初期状態が図4
(1)であるとする。
Now, the initial state of the source file 1 is shown in FIG.
Assume that (1).

【0036】初期状態において、トークン読み込み部4
は、ソースファイル1からAトークンの読み込み処理を
行い、該Aトークンを遅延評価開始位置判定部5へ送る
(ステップS1、ステップS2、およびステップS
4)。
In the initial state, the token reading unit 4
Performs the reading process of the A token from the source file 1 and sends the A token to the delay evaluation start position determining unit 5 (step S1, step S2, and step S2).
4).

【0037】遅延評価開始位置判定部5は、Aトークン
は遅延評価開始位置でないことを判定して、該Aトーク
ンを遅延評価展開位置判定部8へ送る(ステップS
6)。
The delay evaluation start position judging unit 5 judges that the A token is not the delay evaluation start position, and sends the A token to the delay evaluation development position judging unit 8 (Step S).
6).

【0038】遅延評価展開位置判定部8は、Aトークン
は遅延評価展開位置でないことを判定して、該Aトーク
ンを評価処理部9へ送る(ステップS12)。
The delay evaluation development position determination unit 8 determines that the A token is not the delay evaluation development position, and sends the A token to the evaluation processing unit 9 (step S12).

【0039】評価処理部9は、Aトークンを受け取り、
該Aトークンに対応するオブジェクトを生成して、オブ
ジェクトファイル10へ出力する(ステップS14)。
The evaluation processing unit 9 receives the A token,
An object corresponding to the A token is generated and output to the object file 10 (Step S14).

【0040】この状態が図4(2)である。FIG. 4B shows this state.

【0041】次に、トークン読み込み部4は、ソースフ
ァイル1からBトークンの読み込み処理を行い、該Bト
ークンを遅延評価開始位置判定部5へ送る(ステップS
1、ステップS2、およびステップS4)。
Next, the token reading unit 4 reads the B token from the source file 1 and sends the B token to the delay evaluation start position determining unit 5 (step S).
1, Step S2, and Step S4).

【0042】遅延評価開始位置判定部5は、Bトークン
が遅延評価開始位置であることを判定して、該Bトーク
ンを評価し、必要なオブジェクトを生成して、オブジェ
クトファイル10へ出力する(ステップS6、およびス
テップS7)。
The delay evaluation start position judging section 5 judges that the B token is the delay evaluation start position, evaluates the B token, generates a necessary object, and outputs it to the object file 10 (step). S6, and step S7).

【0043】遅延評価終端位置判定部6は、ソースファ
イル1から<refer Z> トークンの読み込み処理を行い、
<refer Z> トークンが遅延評価終端位置でないことを判
定して、該<refer Z> トークンを遅延評価部分記憶部7
へ送る(ステップS8、およびステップ9)。
The delay evaluation end position determining unit 6 reads the <refer Z> token from the source file 1,
It is determined that the <refer Z> token is not at the delay evaluation end position, and the <refer Z> token is stored in the delay evaluation partial storage unit 7.
(Step S8 and Step 9).

【0044】遅延評価部分記憶部7は、<refer Z> トー
クンは定義情報なしには変換することができないトーク
ンであることを判定して、<refer Z> トークンをそのま
ま遅延評価トークン記憶テーブル2に記憶する(ステッ
プS10、およびステップS11)。
The delay evaluation partial storage unit 7 determines that the <refer Z> token cannot be converted without definition information, and stores the <refer Z> token as it is in the delay evaluation token storage table 2. It is stored (step S10 and step S11).

【0045】この状態が図4(3)である。This state is shown in FIG.

【0046】次に、遅延評価終端位置判定部6は、ソー
スファイル1からCトークンの読み込み処理を行い、該
Cトークンが遅延評価終端位置でないことを判定して、
該Cトークンを遅延評価部分記憶部7へ送る(ステップ
S8、およびステップS9)。
Next, the delay evaluation end position determining section 6 reads the C token from the source file 1 and determines that the C token is not the delay evaluation end position.
The C token is sent to the delay evaluation partial storage unit 7 (steps S8 and S9).

【0047】遅延評価部分記憶部7は、Cトークンは定
義情報なしにC’トークンに変更することができるトー
クンであることを判定して、C’トークンを遅延評価ト
ークン記憶テーブル2に記憶する(ステップS10、お
よびステップS11)。ここで、Cトークンをそのまま
でなく、定義情報なしに変更することができる状態にま
で評価したC’トークンに変更してから遅延評価トーク
ン記憶テーブル2に記憶する点も本発明の特徴である。
The delay evaluation partial storage unit 7 determines that the C token is a token that can be changed to a C ′ token without definition information, and stores the C ′ token in the delay evaluation token storage table 2 ( Step S10 and step S11). Here, it is a feature of the present invention that the C token is changed to a C 'token that has been evaluated to a state where it can be changed without definition information, and then stored in the delay evaluation token storage table 2.

【0048】この状態が図4(4)である。FIG. 4D shows this state.

【0049】次に、遅延評価終端位置判定部6は、ソー
スファイル1からDトークンの読み込み処理を行い、該
Dトークンが遅延評価終端位置であることを判定して、
該Dトークンを遅延評価展開位置判定部8へ送る(ステ
ップS8、およびステップS9)。
Next, the delay evaluation terminal position determining unit 6 reads the D token from the source file 1 and determines that the D token is the delay evaluation terminal position.
The D token is sent to the delay evaluation developed position determination unit 8 (Step S8 and Step S9).

【0050】遅延評価展開位置判定部8は、Dトークン
は遅延評価展開位置でないことを判定して、該Dトーク
ンを評価処理部9へ送る(ステップS12)。
The delay evaluation development position determination unit 8 determines that the D token is not at the delay evaluation development position, and sends the D token to the evaluation processing unit 9 (step S12).

【0051】評価処理部9は、Dトークンを受け取り、
該Dトークンに対応するオブジェクトを生成して、オブ
ジェクトファイル10へ出力する(ステップS14)。
The evaluation processing unit 9 receives the D token,
An object corresponding to the D token is generated and output to the object file 10 (Step S14).

【0052】この状態が図4(5)である。FIG. 4 (5) shows this state.

【0053】次に、トークン選択読み込み部4は、ソー
スファイル1からE、<define Z>、Fトークンの読み込
み処理を順次行い、E、<define Z>、Fトークンをそれ
ぞれ遅延評価開始位置判定部5へ送る(ステップS1、
ステップS2、およびステップS4)。
Next, the token selection reading unit 4 sequentially reads E, <define Z>, and F tokens from the source file 1 and stores the E, <define Z>, and F tokens respectively in the delay evaluation start position determination unit. 5 (step S1,
Step S2 and step S4).

【0054】遅延評価開始位置判定部5は、E、<defin
e Z>、Fトークンがそれぞれ遅延評価開始位置でないこ
とを判定して、該E、<define Z>、Fトークンを遅延評
価展開位置判定部8へ送る(ステップS6)。
The delay evaluation start position judging section 5 sets E, <defin
It is determined that the eZ> and F tokens are not the delay evaluation start positions, and the E, <define Z> and F tokens are sent to the delay evaluation development position determination unit 8 (step S6).

【0055】遅延評価展開位置判定部8は、E、<defin
e Z>、Fトークンがそれぞれ遅延評価展開位置でないこ
とを判定して、該E、<define Z>、Fトークンを評価処
理部9へ送る(ステップS12)。
The delay evaluation development position determination unit 8 calculates E, <defin
It is determined that the eZ> and F tokens are not at the delay evaluation development position, and the E, <define Z> and F tokens are sent to the evaluation processing unit 9 (step S12).

【0056】評価処理部9は、E、<define Z>、Fトー
クンをそれぞれ受け取り、該E、<define Z>、Fトーク
ンに対応するオブジェクトを生成して、オブジェクトフ
ァイル10へ出力する(ステップS14)。
The evaluation processing unit 9 receives the E, <define Z>, and F tokens, generates objects corresponding to the E, <define Z>, and F tokens, and outputs the objects to the object file 10 (step S14). ).

【0057】この状態が図4(6)である。This state is shown in FIG.

【0058】次に、トークン選択読み込み部4は、ソー
スファイル1からGトークンの読み込み処理を行い、G
トークンを遅延評価開始位置判定部5へ送る(ステップ
S1、ステップS2、およびステップS4)。
Next, the token selection reading section 4 reads G tokens from the source file 1 and
The token is sent to the delay evaluation start position determination unit 5 (Step S1, Step S2, and Step S4).

【0059】遅延評価開始位置判定部5は、Gトークン
は遅延評価開始位置でないことを判定して、該Gトーク
ンを遅延評価展開位置判定部8へ送る(ステップS
6)。
The delay evaluation start position judging section 5 judges that the G token is not the delay evaluation start position, and sends the G token to the delay evaluation development position judging section 8 (Step S).
6).

【0060】遅延評価展開位置判定部8は、Gトークン
が遅延評価展開位置であることを判定して、該Gトーク
ンを評価処理部9へ送る。また同時に、トークン選択読
み込み部4に対して、今後のトークン読み込み処理は遅
延評価トークン記憶テーブル2から行うという制御情報
を送る(ステップS12、およびステップS13)。
The delay evaluation development position determination unit 8 determines that the G token is the delay evaluation development position, and sends the G token to the evaluation processing unit 9. At the same time, it sends control information to the token selection reading unit 4 that future token reading processing will be performed from the delay evaluation token storage table 2 (steps S12 and S13).

【0061】評価処理部9は、Gトークンを受け取り、
該Gトークンに対応するオブジェクトを生成して、オブ
ジェクトファイル10へ出力する(ステップS14)。
The evaluation processing unit 9 receives the G token,
An object corresponding to the G token is generated and output to the object file 10 (Step S14).

【0062】この状態が図4(7)である。This state is shown in FIG.

【0063】次に、トークン選択読み込み部4は、遅延
評価トークン記憶テーブル2から<refer Z> 、C’トー
クンの読み込み処理を順次行い、<refer Z> 、C’トー
クンをそれぞれ遅延評価開始位置判定部5へ送る(ステ
ップS1、ステップS3、およびステップS5)。
Next, the token selection reading section 4 sequentially reads <refer Z> and C ′ tokens from the delay evaluation token storage table 2 and determines the <refer Z> and C ′ tokens respectively as the delay evaluation start position determination. It is sent to the unit 5 (step S1, step S3, and step S5).

【0064】遅延評価開始位置判定部5は、<refer Z>
、C’トークンがそれぞれ遅延評価開始位置でないこ
とを判定して、該<refer Z> 、C’トークンを遅延評価
展開位置判定部8へ送る(ステップS6)。
The delay evaluation start position judging section 5 sets the <refer Z>
, C ′ tokens are not at the delay evaluation start position, and the <refer Z> and C ′ tokens are sent to the delay evaluation development position determination unit 8 (step S6).

【0065】遅延評価展開位置判定部8は、<refer Z>
、C’トークンがそれぞれ遅延評価展開位置でないこ
とを判定して、該<refer Z> 、C’トークンを評価処理
部9へ送る(ステップS12)。
The delay evaluation developing position determination unit 8 sets the <refer Z>
, And C ′ tokens are not at the delay evaluation development position, and sends the <refer Z> and C ′ tokens to the evaluation processing unit 9 (step S12).

【0066】評価処理部9は、<refer Z> 、C’トーク
ンを受け取り、該<refer Z> 、C’トークンに対応する
オブジェクトを生成して、オブジェクトファイル10へ
出力する(ステップS14)。
The evaluation processing unit 9 receives the <refer Z> and C ′ tokens, generates an object corresponding to the <refer Z> and C ′ tokens, and outputs the object to the object file 10 (step S14).

【0067】この状態が図4(8)である。This state is shown in FIG.

【0068】次に、トークン選択読み込み部4は、遅延
評価トークン記憶テーブル2からトークンを読み込もう
とするが、もはやトークンはないことを判定し、今後の
トークン読み込み処理はソースファイル1から行うとい
う制御情報を送る。そして、ソースファイル1からHト
ークンの読み込み処理を行い、Hトークンを遅延評価開
始位置判定部5へ送る(ステップS1、ステップS3、
ステップS15、ステップS2、およびステップS
4)。
Next, the token selection reading unit 4 attempts to read a token from the delay evaluation token storage table 2, but determines that there is no more token, and determines that the token reading process will be performed from the source file 1 in the future. Send. Then, an H token is read from the source file 1, and the H token is sent to the delay evaluation start position determination unit 5 (steps S1, S3,
Step S15, step S2, and step S
4).

【0069】遅延評価開始位置判定部5は、Hトークン
は遅延評価開始位置でないことを判定して、該Hトーク
ンを遅延評価展開位置判定部8へ送る(ステップS
6)。
The delay evaluation start position determining section 5 determines that the H token is not the delay evaluation start position, and sends the H token to the delay evaluation development position determining section 8 (step S).
6).

【0070】遅延評価展開位置判定部8は、Hトークン
は遅延評価展開位置でないことを判定して、該Hトーク
ンを評価処理部9へ送る(ステップS12)。
The delay evaluation development position determination unit 8 determines that the H token is not the delay evaluation development position, and sends the H token to the evaluation processing unit 9 (step S12).

【0071】評価処理部9は、Hトークンを受け取り、
該Hトークンに対応するオブジェクトを生成して、オブ
ジェクトファイル10へ出力する(ステップS14)。
The evaluation processing unit 9 receives the H token,
An object corresponding to the H token is generated and output to the object file 10 (step S14).

【0072】この状態が図4(9)である。This state is shown in FIG.

【0073】以上により、本発明の第1の実施例である
遅延評価機能付きコンパイル装置の処理が完了する。
With the above, the processing of the compiling device with a delay evaluation function according to the first embodiment of the present invention is completed.

【0074】本発明の第1の実施例である遅延評価機能
付きコンパイル装置は、ソースプログラム解析部3が、
トークン選択読み込み部4、遅延評価開始位置判定部
5、遅延評価終端位置判定部6、遅延評価部分記憶部
7、遅延評価展開位置判定部8、およぴ評価処理部9と
を含み、前方参照が行われる可能性のある高級言語で記
述されたソースプログラム1の一部を遅延評価部分とし
て記憶し、該遅延評価部分を必要な個所で展開すること
によって、該ソースプログラムのコンパイル処理におけ
る走査を一度で済むようにすることにより、該コンパイ
ル処理を高速に実行することができる効果を有してい
る。
In the compiling device with a delay evaluation function according to the first embodiment of the present invention, the source program analyzing unit 3
It includes a token selection reading unit 4, a delay evaluation start position determining unit 5, a delay evaluation end position determining unit 6, a delay evaluation partial storage unit 7, a delay evaluation developing position determining unit 8, and an evaluation processing unit 9, and includes a forward reference. By storing a part of the source program 1 described in a high-level language where the execution of the source program 1 is likely to be performed as a delay evaluation part and expanding the delay evaluation part at a necessary place, the scanning in the compilation processing of the source program can be performed. By performing the processing once, the compile process can be executed at high speed.

【0075】また、本発明の他の実施例である遅延評価
機能付きコンパイル装置として、図5に示すように、遅
延評価展開位置判定部8と遅延評価開始位置判定部4と
の処理順序を入れ替えたり、図6に示すように遅延評価
トークン記憶テーブル2を遅延評価トークン記憶ファイ
ル11に置き換えることができる。
As shown in FIG. 5, in a compiling device with a delay evaluation function according to another embodiment of the present invention, the processing order of the delay evaluation development position determination unit 8 and the delay evaluation start position determination unit 4 is switched. Alternatively, the delay evaluation token storage table 2 can be replaced with the delay evaluation token storage file 11 as shown in FIG.

【0076】[0076]

【発明の効果】以上説明したように、本発明の遅延評価
機能付きコンパイル装置、コンパイル方法、およびコン
パイルプログラムを記憶する媒体は、前方参照を指示す
る命令文がどのような構文解析の要素であるかにかかわ
らず、該命令文を含むソースプログラムを構文解析し、
効率良くコンパイルすることができる効果を有してい
る。
As described above, in the compiling apparatus with the delay evaluation function, the compiling method, and the medium for storing the compiling program according to the present invention, what kind of parsing element is a statement for designating a forward reference. Parse the source program containing the statement,
This has the effect of being able to compile efficiently.

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

【図1】図1は、本発明の第1の実施例である遅延評価
機能付きコンパイル装置の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a configuration of a compiling device with a delay evaluation function according to a first embodiment of the present invention.

【図2】図2は、本発明の第1の実施例におけるソース
プログラム解析部3、トークン選択読み込み部4、遅延
評価開始位置判定部5、遅延評価終端位置判定部6、遅
延評価部分記憶部7、遅延評価展開位置判定部8、およ
び評価処理部9の処理を示す流れ図である。
FIG. 2 is a diagram illustrating a source program analysis unit 3, a token selection reading unit 4, a delay evaluation start position determination unit 5, a delay evaluation end position determination unit 6, and a delay evaluation partial storage unit according to the first embodiment of the present invention. 7 is a flowchart showing processing of a delay evaluation development position determination unit 8 and an evaluation processing unit 9;

【図3】図3は、本発明の第1の実施例における仮想的
な高級言語で記述されたソースプログラムを示す図であ
る。
FIG. 3 is a diagram showing a source program described in a virtual high-level language according to the first embodiment of the present invention.

【図4】図4は、第1の実施例において、ソースプログ
ラムがどのようにコンパイルされていくかを示すタイミ
ングチャートである。
FIG. 4 is a timing chart showing how a source program is compiled in the first embodiment.

【図5】図5は、本発明の他の実施例である遅延評価機
能付きコンパイル装置の構成を示すブロック図である。
FIG. 5 is a block diagram showing a configuration of a compiling device with a delay evaluation function according to another embodiment of the present invention.

【図6】図6は、本発明の他の実施例である遅延評価機
能付きコンパイル装置の構成を示すブロック図である。
FIG. 6 is a block diagram showing a configuration of a compiling device with a delay evaluation function according to another embodiment of the present invention.

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

1 ソースファイル 2 遅延評価トークン記憶テーブル 3 ソースプログラム解析部 4 トークン選択読み込み部 5 遅延評価開始位置判定部 6 遅延評価終端位置判定部 7 遅延評価部分記憶部 8 遅延評価展開位置判定部 9 評価処理部 10 オブジェクトファイル 11 遅延評価トークン記憶ファイル REFERENCE SIGNS LIST 1 Source file 2 Delay evaluation token storage table 3 Source program analysis unit 4 Token selection reading unit 5 Delay evaluation start position determination unit 6 Delay evaluation end position determination unit 7 Delay evaluation partial storage unit 8 Delay evaluation development position determination unit 9 Evaluation processing unit 10 Object file 11 Delay evaluation token storage file

Claims (15)

【特許請求の範囲】[Claims] 【請求項1】 ソースプログラムに含まれるトークン列
からトークンを順次読み込むトークン選択読み込み部
と、 前記トークン選択読み込み部が読み込んだトークンが、
予め前記トークン列の任意の区間に設定した遅延評価区
間内のトークンである場合には、該トークンを遅延評価
トークン記憶テーブルに記憶する遅延評価部分記憶部
と、 前記遅延評価部分記憶部により前記遅延評価トークン記
憶テーブルに記憶されたトークンを順次読み込み、オブ
ジェクト化してオブジェクトファイルへ出力する評価処
理部とを備えたことを特徴とする遅延評価機能付きコン
パイル装置。
A token selection reading unit for sequentially reading tokens from a token sequence included in a source program; and a token read by the token selection reading unit,
If the token is within a delay evaluation section set in advance in an arbitrary section of the token string, a delay evaluation section storage section that stores the token in a delay evaluation token storage table; A compiling device having a delay evaluation function, comprising: an evaluation processing unit that sequentially reads tokens stored in an evaluation token storage table, converts the tokens into objects, and outputs the objects to an object file.
【請求項2】 前記評価処理部は、さらに、前記トーク
ン選択読み込み部が読み込んだトークンが、予め前記ト
ークン列の任意の区間に設定した遅延評価区間外のトー
クンである場合には、該トークンをオブジェクト化して
オブジェクトファイルへ出力することを特徴とする請求
項1記載の遅延評価機能付きコンパイル装置。
2. The evaluation processing unit further includes: if the token read by the token selection reading unit is a token outside a delay evaluation section set in advance in an arbitrary section of the token sequence, 2. The compiling device with a delay evaluation function according to claim 1, wherein the compiling device outputs the object to an object file.
【請求項3】 さらに、前記トークン選択読み込み部が
読み込んだトークンが予め前記トークン列の任意の箇所
に設定した遅延評価の開始位置のトークンに一致するか
否かを判定し、一致した場合には読み込んだトークンに
対応するオブジェクトを生成し、オブジェクトファイル
へ出力する遅延評価開始位置判定部と、 前記ソースプログラムから前記遅延評価開始位置判定部
がオブジェクト化したトークンの位置以降のトークンを
順次読み込み、該トークンが予め前記トークン列の任意
の箇所に設定した遅延評価の終了位置のトークンに一致
するか否かを判定する遅延評価終了位置判定部とを備
え、 前記遅延評価部分記憶部は、前記遅延評価終了位置判定
部が前記遅延評価の終了位置のトークンに一致するトー
クンを読み込んだ時点で、該遅延評価終了位置判定部が
それまでに読み込んだトークンを定義情報なしに変更す
ることができる状態にまで評価して前記遅延評価トーク
ン記憶テーブルに記憶することを特徴とする請求項2記
載の遅延評価機能付きコンパイル装置。
Further, it is determined whether or not the token read by the token selection reading unit matches the token at the start position of the delay evaluation previously set at an arbitrary position in the token string. A delay evaluation start position determining unit that generates an object corresponding to the read token and outputs the object to an object file; and sequentially reads tokens after the position of the tokenized object by the delay evaluation start position determining unit from the source program. A delay evaluation end position determining unit that determines whether or not the token matches a token at a delay evaluation end position set in advance in an arbitrary part of the token sequence. The delay evaluation partial storage unit includes: When the end position determination unit reads a token that matches the token at the end position of the delay evaluation, 3. The delay evaluation function according to claim 2, wherein the evaluation end position determination unit evaluates the token read so far until the token can be changed without definition information and stores the token in the delay evaluation token storage table. Compiling device with.
【請求項4】 さらに、前記トークン選択読み込み部が
読み込んだトークンが、予め設定した遅延評価の展開位
置のトークンに一致するか否かを判定する遅延評価展開
位置判定部を備え、 前記トークン選択読み込み部は、読み込んだトークンが
前記遅延評価展開位置判定部により遅延評価の展開位置
のトークンに一致すると判定された場合、その後は前記
遅延評価トークン記憶テーブルからトークンを読み込
み、読み込んだトークンを前記評価処理部によってオブ
ジェクト化して前記オブジェクトファイルへ出力するこ
とを特徴とする請求項3記載の遅延評価機能付きコンパ
イル装置。
4. A delay evaluation deployment position determination unit that determines whether a token read by the token selection read unit matches a token at a preset delay evaluation deployment position, The unit reads the token from the delay evaluation token storage table when it is determined by the delay evaluation expansion position determination unit that the read token matches the token at the expansion position of the delay evaluation, and performs the evaluation processing on the read token. 4. The compiling device with a delay evaluation function according to claim 3, wherein the compiling device converts the object into an object and outputs the object file to the object file.
【請求項5】 さらに、前記トークン選択読み込み部
は、前記遅延評価トークン記憶テーブルからトークンを
読み込むことができない場合には、前記ソースプログラ
ムからトークンを読み込むことを特徴とする請求項4記
載の遅延評価機能付きコンパイル装置。
5. The delay evaluation unit according to claim 4, wherein the token selection reading unit reads a token from the source program when the token cannot be read from the delay evaluation token storage table. Compiler with functions.
【請求項6】 ソースプログラムに含まれるトークン列
からトークンを順次読み込むトークン選択読み込みステ
ップと、 前記トークン選択読み込みステップが読み込んだトーク
ンが、予め前記トークン列の任意の区間に設定した遅延
評価区間内のトークンである場合には、該トークンを遅
延評価トークン記憶テーブルに記憶する遅延評価部分記
憶ステップと、 前記遅延評価部分記憶ステップにより前記遅延評価トー
クン記憶テーブルに記憶されたトークンを順次読み込
み、オブジェクト化してオブジェクトファイルへ出力す
る評価処理ステップとを含むことを特徴とする遅延評価
機能付きコンパイル方法。
6. A token selecting and reading step for sequentially reading tokens from a token string included in a source program, wherein the token read by the token selecting and reading step is a delay evaluation section set in advance in an arbitrary section of the token string. In the case of a token, a delay evaluation partial storage step of storing the token in a delay evaluation token storage table, and a token stored in the delay evaluation token storage table by the delay evaluation partial storage step are sequentially read and converted into an object. A compiling method with a delayed evaluation function, comprising: an evaluation processing step of outputting to an object file.
【請求項7】 前記評価処理ステップは、さらに、前記
トークン選択読み込みステップが読み込んだトークン
が、予め前記トークン列の任意の区間に設定した遅延評
価区間外のトークンである場合には、該トークンをオブ
ジェクト化してオブジェクトファイルへ出力することを
特徴とする請求項6記載の遅延評価機能付きコンパイル
方法。
7. The evaluation processing step further includes, if the token read by the token selection reading step is a token outside a delay evaluation section set in advance in an arbitrary section of the token string, 7. The compiling method with a delay evaluation function according to claim 6, wherein the compiling method outputs the object to an object file.
【請求項8】 さらに、前記トークン選択読み込みステ
ップが読み込んだトークンが予め前記トークン列の任意
の箇所に設定した遅延評価の開始位置のトークンに一致
するか否かを判定し、一致した場合には読み込んだトー
クンに対応するオブジェクトを生成し、オブジェクトフ
ァイルへ出力する遅延評価開始位置判定ステップと、 前記ソースプログラムから前記遅延評価開始位置判定ス
テップがオブジェクト化したトークンの位置以降のトー
クンを順次読み込み、該トークンが予め前記トークン列
の任意の箇所に設定した遅延評価の終了位置のトークン
に一致するか否かを判定する遅延評価終了位置判定ステ
ップとを含み、 前記遅延評価部分記憶ステップは、前記遅延評価終了位
置判定ステップが前記遅延評価の終了位置のトークンに
一致するトークンを読み込んだ時点で、該遅延評価終了
位置判定ステップがそれまでに読み込んだトークンを定
義情報なしに変更することができる状態にまで評価して
前記遅延評価トークン記憶テーブルに記憶することを特
徴とする請求項7記載の遅延評価機能付きコンパイル方
法。
Further, it is determined whether or not the token read by the token selection reading step matches a token at a delay evaluation start position set in advance in an arbitrary part of the token string. A delay evaluation start position determining step of generating an object corresponding to the read token and outputting the generated object to an object file; and sequentially reading tokens after the position of the tokenized object in the delay evaluation start position determining step from the source program. A delay evaluation end position determining step of determining whether or not a token matches a token at a delay evaluation end position set in advance in an arbitrary position of the token sequence, wherein the delay evaluation partial storage step includes: End position judgment step matches the token at the end position of the delay evaluation At the time of reading the token, the delay evaluation end position determining step evaluates the token read so far to a state where it can be changed without definition information and stores the token in the delay evaluation token storage table. 8. The compiling method with a delay evaluation function according to claim 7.
【請求項9】 さらに、前記トークン選択読み込みステ
ップが読み込んだトークンが、予め設定した遅延評価の
展開位置のトークンに一致するか否かを判定する遅延評
価展開位置判定ステップを含み、 前記トークン選択読み込みステップは、読み込んだトー
クンが前記遅延評価展開位置判定ステップにより遅延評
価の展開位置のトークンに一致すると判定された場合、
その後は前記遅延評価トークン記憶テーブルからトーク
ンを読み込み、読み込んだトークンを前記評価処理ステ
ップによってオブジェクト化して前記オブジェクトファ
イルへ出力することを特徴とする請求項8記載の遅延評
価機能付きコンパイル方法。
9. The method further comprises the step of determining whether or not the token read by the token selection reading step matches a token at a predetermined delay evaluation expansion position. The step is, when it is determined that the read token matches the token at the delay evaluation deployment position by the delay evaluation deployment position determination step,
9. The compiling method according to claim 8, further comprising reading a token from the delay evaluation token storage table, converting the read token into an object in the evaluation processing step, and outputting the object to the object file.
【請求項10】 さらに、前記トークン選択読み込みス
テップは、前記遅延評価トークン記憶テーブルからトー
クンを読み込むことができない場合には、前記ソースプ
ログラムからトークンを読み込むことを特徴とする請求
項9記載の遅延評価機能付きコンパイル方法。
10. The delay evaluation according to claim 9, wherein the token selection reading step reads a token from the source program when a token cannot be read from the delay evaluation token storage table. Compile method with functions.
【請求項11】 ソースプログラムに含まれるトークン
列からトークンを順次読み込むトークン選択読み込みス
テップと、 前記トークン選択読み込みステップが読み込んだトーク
ンが、予め前記トークン列の任意の区間に設定した遅延
評価区間内のトークンである場合には、該トークンを遅
延評価トークン記憶テーブルに記憶する遅延評価部分記
憶ステップと、 前記遅延評価部分記憶ステップにより前記遅延評価トー
クン記憶テーブルに記憶されたトークンを順次読み込
み、オブジェクト化してオブジェクトファイルへ出力す
る評価処理ステップとを含む処理をコンピュータに行わ
せるプログラムを記憶する媒体。
11. A token selecting and reading step for sequentially reading tokens from a token string included in a source program, and the token read by the token selecting and reading step is set in a delay evaluation section set in advance in an arbitrary section of the token string. In the case of a token, a delay evaluation partial storage step of storing the token in a delay evaluation token storage table, and a token stored in the delay evaluation token storage table by the delay evaluation partial storage step are sequentially read and converted into an object. A medium that stores a program that causes a computer to perform processing including an evaluation processing step of outputting to an object file.
【請求項12】 前記評価処理ステップは、さらに、前
記トークン選択読み込みステップが読み込んだトークン
が、予め前記トークン列の任意の区間に設定した遅延評
価区間外のトークンである場合には、該トークンをオブ
ジェクト化してオブジェクトファイルへ出力することを
特徴とする請求項11記載の媒体。
12. The evaluation processing step further includes the step of, if the token read by the token selection reading step is a token outside a delay evaluation section previously set in an arbitrary section of the token string, The medium according to claim 11, wherein the medium is converted into an object and output to an object file.
【請求項13】 さらに、前記プログラムが、前記トー
クン選択読み込みステップが読み込んだトークンが予め
前記トークン列の任意の箇所に設定した遅延評価の開始
位置のトークンに一致するか否かを判定し、一致した場
合には読み込んだトークンに対応するオブジェクトを生
成し、オブジェクトファイルへ出力する遅延評価開始位
置判定ステップと、 前記ソースプログラムから前記遅延評価開始位置判定ス
テップがオブジェクト化したトークンの位置以降のトー
クンを順次読み込み、該トークンが予め前記トークン列
の任意の箇所に設定した遅延評価の終了位置のトークン
に一致するか否かを判定する遅延評価終了位置判定ステ
ップとを含み、 前記遅延評価部分記憶ステップは、前記遅延評価終了位
置判定ステップが前記遅延評価の終了位置のトークンに
一致するトークンを読み込んだ時点で、該遅延評価終了
位置判定ステップがそれまでに読み込んだトークンを定
義情報なしに変更することができる状態にまで評価して
前記遅延評価トークン記憶テーブルに記憶することを特
徴とする請求項12記載の媒体。
13. The program further determines whether or not the token read by the token selection reading step matches a token at a delay evaluation start position set in advance at an arbitrary position in the token sequence. In this case, an object corresponding to the read token is generated, and a delay evaluation start position determining step of outputting the object to an object file; Sequentially reading, and a delay evaluation end position determining step of determining whether or not the token matches a token at a delay evaluation end position set in advance in an arbitrary position of the token sequence. Wherein the delay evaluation end position determination step is the end of the delay evaluation. When the token that matches the token of the position is read, the delay evaluation end position determining step evaluates the token that has been read so far until it can be changed without the definition information, and stores the token in the delay evaluation token storage table. 13. The medium according to claim 12, wherein the medium is stored.
【請求項14】 さらに、前記プログラムが、前記トー
クン選択読み込みステップが読み込んだトークンが、予
め設定した遅延評価の展開位置のトークンに一致するか
否かを判定する遅延評価展開位置判定ステップを含み、 前記トークン選択読み込みステップは、読み込んだトー
クンが前記遅延評価展開位置判定ステップにより遅延評
価の展開位置のトークンに一致すると判定された場合、
その後は前記遅延評価トークン記憶テーブルからトーク
ンを読み込み、読み込んだトークンを前記評価処理ステ
ップによってオブジェクト化して前記オブジェクトファ
イルへ出力することを特徴とする請求項13記載の媒
体。
14. The program further includes a delay evaluation developing position determining step of determining whether the token read by the token selecting reading step matches a token at a predetermined delay evaluating developing position, The token selection reading step, if it is determined that the read token matches the token of the deployment position of the delay evaluation by the delay evaluation deployment position determination step,
14. The medium according to claim 13, wherein a token is read from the delay evaluation token storage table, and the read token is converted into an object in the evaluation processing step and output to the object file.
【請求項15】 さらに、前記トークン選択読み込みス
テップは、前記遅延評価トークン記憶テーブルからトー
クンを読み込むことができない場合には、前記ソースプ
ログラムからトークンを読み込むことを特徴とする請求
項14記載の媒体。
15. The medium according to claim 14, wherein the token selection reading step reads the token from the source program when the token cannot be read from the delay evaluation token storage table.
JP16775896A 1996-06-27 1996-06-27 Compiler with delay evaluating function, compiling method, and medium storing compile program Pending JPH1011299A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16775896A JPH1011299A (en) 1996-06-27 1996-06-27 Compiler with delay evaluating function, compiling method, and medium storing compile program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16775896A JPH1011299A (en) 1996-06-27 1996-06-27 Compiler with delay evaluating function, compiling method, and medium storing compile program

Publications (1)

Publication Number Publication Date
JPH1011299A true JPH1011299A (en) 1998-01-16

Family

ID=15855554

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16775896A Pending JPH1011299A (en) 1996-06-27 1996-06-27 Compiler with delay evaluating function, compiling method, and medium storing compile program

Country Status (1)

Country Link
JP (1) JPH1011299A (en)

Similar Documents

Publication Publication Date Title
US5606697A (en) Compiler system for language processing program
US8161466B2 (en) Method of pre-processing conditional region
JPH1011299A (en) Compiler with delay evaluating function, compiling method, and medium storing compile program
JP2006338399A (en) Program developing device, program development software and storage medium
JP3921288B2 (en) Computer-readable storage medium storing language processing apparatus and inline expansion program
JPH11110224A (en) Language processing device, its method and information storage medium
JP2007265098A (en) Macro definition information acquisition device
JP3665392B2 (en) Information processing device
JP2009064207A (en) Compiler
JP2000132405A (en) In-line expansion processing device and method
JP2001075831A (en) Program processor, ic test system, program processing method and storage medium
JP2827979B2 (en) Assembler processing apparatus and assembler processing method
JPH05313878A (en) Program coding back-up system
JPH06242958A (en) Compilation system
JPH0353333A (en) Assembly processing system for assembler
JPH0449421A (en) File editing system
JPH1049378A (en) Compiler development device
JP2001134431A (en) Method for deciding reinput possibility of function
JPH0512030A (en) Execution-form program generating system
JPH03186933A (en) Symbol processing system for language processing system
JPH06119203A (en) Debugging line deleting device
JPH05298116A (en) Compiler system
JPH04233636A (en) Computer
JP2000207225A (en) Method and device for optimization and recording medium
JPH0535455A (en) Scroll display system for program

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990511