JPH04264924A - Complier - Google Patents

Complier

Info

Publication number
JPH04264924A
JPH04264924A JP3025839A JP2583991A JPH04264924A JP H04264924 A JPH04264924 A JP H04264924A JP 3025839 A JP3025839 A JP 3025839A JP 2583991 A JP2583991 A JP 2583991A JP H04264924 A JPH04264924 A JP H04264924A
Authority
JP
Japan
Prior art keywords
analysis processing
program
processing section
code generation
program management
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
JP3025839A
Other languages
Japanese (ja)
Inventor
Shinichi Ishizuka
進一 石塚
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP3025839A priority Critical patent/JPH04264924A/en
Publication of JPH04264924A publication Critical patent/JPH04264924A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To enable plural programs to be compiled by loading one time a vocabulary analysis processing part, a syntax analysis processing part, a meaning analysis processing part, and a code generation processing part respectively by providing a program control means for the code generation processing part to control the code generation processing part so as to output plural object programs. CONSTITUTION:The code generation processing part 10 is controlled by the program control means 6 for the code generation processing part. Namely, first of all, a text is inputted from a place shown by the text starting address area of the first entry of a program control table 13 for the meaning analysis processing part in an intermediate text file 16, and usual code generation is executed. Then, the object program of the name of the program shown by the program name area of the first entry of the meaning analyzing program control table 13 is generated in an object program library. Then, this is repeated until the entry of the program control table 13 for the meaning analysis processing part is finished.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はコンパイラ、特に複数原
始プログラムを一括コンパイルするコンパイラに関する
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a compiler, and more particularly to a compiler that compiles multiple source programs at once.

【0002】0002

【従来の技術】従来の一括コンパイルの処理方式は、指
定された複数のプログラムに対して、1プログラム単位
毎にコンパイラを1回動作させ目的プログラムを生成し
ていく方式をとっている。
2. Description of the Related Art A conventional batch compilation processing method uses a method in which a compiler is operated once for each program unit to generate a target program for a plurality of specified programs.

【0003】0003

【発明が解決しようとする課題】上述した従来のコンパ
イラでは、指定されたプログラムの数だけコンパイラが
繰り返して動作するため、コンパイラ内部の、語彙解析
処理部,構文解析処理部,意味解析処理部およびコード
生成処理部の各処理部がその度にロードされなければな
らないという欠点がある。
[Problems to be Solved by the Invention] In the above-mentioned conventional compiler, the compiler operates repeatedly for the number of specified programs, so the lexical analysis processing section, syntax analysis processing section, semantic analysis processing section and There is a drawback that each processing section of the code generation processing section must be loaded each time.

【0004】0004

【発明が解決しようとする課題】本発明のコンパイラは
、複数原始プログラムを一括コンパイルするコンパイラ
において、原始プログラムをコンパイルして目的プログ
ラムを得る各段階での中間テキストをプログラムの翻訳
単位毎に管理する語彙解析処理部用プログラム管理テー
ブルと、構文解析処理部用プログラム管理テーブルと、
意味解析処理部用プログラム管理テーブルと、コード生
成処理部用プログラム管理テーブルとを有し、語彙解析
処理部が出力する中間テキストを制御する語彙解析処理
部用プログラム管理手段と、構文解析処理部が入出力す
る中間テキストを制御する構文解析処理部用プログラム
管理手段と、意味解析処理部が入出力する中間テキスト
を制御する意味解析処理部用プログラム管理手段と、コ
ード生成処理部が複数の目的プログラムを出力すること
を制御するコード生成処理部用プログラム管理手段とを
設けたことを特徴とする。
[Problems to be Solved by the Invention] The compiler of the present invention, in a compiler that compiles multiple source programs at once, manages intermediate text for each translation unit of the program at each stage of compiling the source programs to obtain the target program. A program management table for the lexical analysis processing section, a program management table for the syntactic analysis processing section,
A lexical analysis processing unit program management means that has a semantic analysis processing unit program management table and a code generation processing unit program management table, and controls intermediate text output by the lexical analysis processing unit, and a syntactic analysis processing unit. A program management means for a syntactic analysis processing unit that controls intermediate text to be input and output by the semantic analysis processing unit, a program management unit for a semantic analysis processing unit that controls intermediate text input and output by the semantic analysis processing unit, and a code generation processing unit that has a plurality of target programs. The present invention is characterized in that it is provided with a program management means for the code generation processing section that controls the output of the code generation processing section.

【0005】[0005]

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

【0006】図1は、本発明の一実施例を示す流れ図で
ある。図1を参照して原始プログラムライブラリ1中に
存在する、原始プログラムa,原始プログラムbなどの
複数の原始プログラムを一括してコンパイルする場合に
ついてのコンパイラ2の処理を説明する。
FIG. 1 is a flow chart showing one embodiment of the present invention. With reference to FIG. 1, the processing of the compiler 2 when a plurality of source programs such as source program a and source program b existing in the source program library 1 are compiled at once will be described.

【0007】まずコンパイルを開始する前に、プログラ
ム名とテキスト開始アドレスを1エントリとして、一括
コンパイルするプログラムの数分のエントリを持つ語彙
解析処理部用プログラム管理テーブル11,構文解析処
理部用プログラム管理テーブル12および意味解析処理
部用プログラム管理テーブル13をそれぞれ領域として
確保する。
First, before starting compilation, a program management table 11 for the lexical analysis processing section and a program management table 11 for the syntactic analysis processing section, each containing a program name and a text start address as one entry, and entries for the number of programs to be compiled at once. The table 12 and the program management table 13 for the semantic analysis processing section are each secured as areas.

【0008】語彙解析処理部7は原始プログラムライブ
ラリ1中から、指定された原始プログラムを取り出して
語彙解析処理を行い、構文解析処理部8に渡すための中
間テキストを中間テキストファイル14に出力する処理
を行う。
The lexical analysis processing unit 7 extracts a specified source program from the source program library 1, performs lexical analysis processing, and outputs intermediate text to be passed to the syntactic analysis processing unit 8 to an intermediate text file 14. I do.

【0009】この語彙解析処理部7を、語彙解析処理部
用プログラム管理手段3によって以下の様に制御する。 まず語彙解析処理部用プログラム管理テーブル11の1
エントリ目のプログラム名領域に、最初にコンパイルす
る原始プログラムのプログラム名を設定し、その原始プ
ログラムに対して語彙解析処理によって生成する中間テ
キストが出力される中かテキストファイル14上の先頭
アドレスを、語彙解析処理部用プログラム管理テーブル
11の1エントリ目のテキスト開始アドレス領域に設定
する。
The vocabulary analysis processing section 7 is controlled by the vocabulary analysis processing section program management means 3 as follows. First, 1 of the program management table 11 for the vocabulary analysis processing section
Set the program name of the source program to be compiled first in the program name area of the entry, and specify the start address on the text file 14 where intermediate text generated by lexical analysis processing for that source program is output. It is set in the text start address area of the first entry in the program management table 11 for the vocabulary analysis processing section.

【0010】そして当該原始プログラムに対して通常の
語彙解析処理を行う。そのとき、中間テキストは、中間
テキストファイル14上の語彙解析処理部用プログラム
管理テーブル11のテキスト開始アドレス領域で示され
た位置から出力する。
[0010] Then, normal vocabulary analysis processing is performed on the source program. At that time, the intermediate text is output from the position indicated by the text start address area of the program management table 11 for the vocabulary analysis processing section on the intermediate text file 14.

【0011】次に、指定された原始プログラムがまだあ
る場合は、次の原始プログラムを当該原始プログラムと
して、語彙解析処理部用プログラム管理テーブル11の
次のエントリのプログラム名領域とテキスト開始アドレ
ス領域を前述の様に設定し、当該原始プログラムに対す
る語彙解析処理を行う。これを、指定された原始プログ
ラムが終了するまで繰り返し、語彙解析処理を終了する
Next, if the specified source program still exists, the program name area and text start address area of the next entry in the program management table 11 for the vocabulary analysis processing section are set as the next source program. The settings are made as described above, and vocabulary analysis processing is performed on the source program. This is repeated until the specified source program is completed, and the vocabulary analysis process is completed.

【0012】構文解析処理部8は中間テキストファイル
14中から、語彙解析処理部7からの中間テキストを取
り出し、それを入力テキストとして構文解析処理を行い
、意味解析処理部9に渡すための中間テキストを中間テ
キストファイル15に出力する処理を行う。
The syntactic analysis processing unit 8 extracts the intermediate text from the lexical analysis processing unit 7 from the intermediate text file 14, performs syntactic analysis processing using it as input text, and generates an intermediate text to be passed to the semantic analysis processing unit 9. A process is performed to output the file to the intermediate text file 15.

【0013】この構文解析処理部8を、構文解析処理部
用プログラム管理手段4によって以下の様に制御する。 まず、構文解析処理部用プログラム管理テーブル12の
1エントリ目のプログラム名領域に、語彙解析処理部用
プログラム管理テーブル11の1エントリ目のプログラ
ム名を設定し、当該プログラムに対して構文解析処理に
よって生成する中間テキストが出力される中間テキスト
ファイル15上の先頭アドレスを、構文解析処理部用プ
ログラム管理テーブル12の1エントリ目のテキスト開
始アドレス領域に設定する。
The syntax analysis processing section 8 is controlled by the syntax analysis processing section program management means 4 as follows. First, the program name of the first entry of the program management table 11 for the vocabulary analysis processing section is set in the program name area of the first entry of the program management table 12 for the syntax analysis processing section, and the program is subjected to the syntax analysis processing for the program. The start address on the intermediate text file 15 to which the intermediate text to be generated is output is set in the text start address area of the first entry of the program management table 12 for the syntax analysis processing section.

【0014】そして、中間テキストファイル14内の、
語彙解析処理部用プログラム管理テーブル11の1エン
トリ目のテキスト開始アドレス領域が示す箇所からテキ
ストを入力して通常の構文解析処理を行う。そのとき、
中間テキストは、中間テキストファイル15上の構文解
析処理部用プログラム管理テーブル12のテキスト開始
アドレス領域で示された位置から出力する。
[0014] Then, in the intermediate text file 14,
Text is input from the location indicated by the text start address area of the first entry in the program management table 11 for the vocabulary analysis processing section, and normal syntax analysis processing is performed. then,
The intermediate text is output from the position indicated by the text start address area of the program management table 12 for the syntax analysis processing section on the intermediate text file 15.

【0015】次に、語彙解析処理部用プログラム管理テ
ーブル11のエントリがまだある場合は、語彙解析処理
部用プログラム管理テーブル11の次のエントリが示す
ものを当該プログラムとして、構文解析処理部用プログ
ラム管理テーブル12の次のエントリのプログラム名領
域とテキスト開始アドレス領域を前述の様に設定し、当
該プログラムに対する構文解析処理を行う。これを、語
彙解析処理部プログラム管理テーブル11のエントリが
終了するまで繰り返し、構文解析処理を終了する。
Next, if there are still entries in the program management table 11 for the vocabulary analysis processing section, the next entry in the program management table 11 for the vocabulary analysis processing section is designated as the program, and the program for the syntax analysis processing section is The program name area and text start address area of the next entry in the management table 12 are set as described above, and the syntax analysis process for the program is performed. This is repeated until the entries in the lexical analysis processing unit program management table 11 are completed, and the syntactic analysis processing is completed.

【0016】意味解析処理部9は中間テキストファイル
15中から、構文解析処理部8からの中間テキストを取
り出し、それを入力テキストとして意味解析処理を行い
、コード生成処理部10に渡すための中間テキストを中
間テキストファイル16に出力する処理を行う。
The semantic analysis processing unit 9 extracts the intermediate text from the syntactic analysis processing unit 8 from the intermediate text file 15, performs semantic analysis processing on it as input text, and generates an intermediate text to be passed to the code generation processing unit 10. A process is performed to output the file to the intermediate text file 16.

【0017】この意味解析処理部9を、意味解析処理部
用プログラム管理手段5によって以下の様に制御する。 まず、意味解析処理部用プログラム管理テーブル13の
1エントリ目のプログラム名領域に、構文解析処理部用
プログラム管理テーブル12の1エントリ目のプログラ
ム名を設定し、当該プログラムに対して意味解析処理に
よって生成する中間テキストが出力される中間テキスト
ファイル16上の先頭アドレスを、意味解析処理部用プ
ログラム管理テーブル13の1エントリ目のテキスト開
始アドレス領域に設定する。
The semantic analysis processing section 9 is controlled by the semantic analysis processing section program management means 5 as follows. First, the program name of the first entry of the program management table 12 for the syntax analysis processing section is set in the program name area of the first entry of the program management table 13 for the semantic analysis processing section, and the program is subjected to semantic analysis processing for the program. The start address on the intermediate text file 16 to which the intermediate text to be generated is output is set in the text start address area of the first entry of the program management table 13 for the semantic analysis processing section.

【0018】そして、中間テキストファイル15内の、
構文解析処理部用プログラム管理テーブル12の1エン
トリ目のテキスト開始アドレス領域が示す箇所からテキ
ストを入力して通常の意味解析処理を行う。そのとき、
中間テキストは、中間テキストファイル16上の意味解
析処理部用プログラム管理テーブル13のテキスト開始
アドレス領域で示された位置から出力する。
[0018] Then, in the intermediate text file 15,
Text is input from the location indicated by the text start address area of the first entry in the program management table 12 for the syntax analysis processing section, and normal semantic analysis processing is performed. then,
The intermediate text is output from the position indicated by the text start address area of the program management table 13 for the semantic analysis processing section on the intermediate text file 16.

【0019】次に、構文解析処理部用プログラム管理テ
ーブル12のエントリがまだある場合は、構文解析処理
部用プログラム管理テーブル12の次のエントリが示す
ものを当該プログラムとして、意味解析処理部用プログ
ラム管理テーブル13の次のエントリのプログラム名領
域とテキスト開始アドレス領域を前述の様に設定し、当
該プログラムに対する意味解析処理を行う。これを、構
文解析処理部用プログラム管理テーブル12のエントリ
が終了するまで繰り返し、意味解析処理を終了する。
Next, if there are still entries in the program management table 12 for the syntactic analysis processing section, the next entry in the program management table 12 for the syntactic analysis processing section is designated as the program, and the program for the semantic analysis processing section is The program name area and text start address area of the next entry in the management table 13 are set as described above, and the semantic analysis process for the program is performed. This is repeated until the entries in the program management table 12 for the syntactic analysis processing section are completed, and the semantic analysis processing is completed.

【0020】コード生成処理部10は中間テキストファ
イル16中から、意味解析処理部9からの中間テキスト
を取り出し、それを入力テキストとしてコード生成処理
を行い、目的プログラムライブラリ17中に目的プログ
ラムを出力する処理を行う。
The code generation processing unit 10 extracts the intermediate text from the semantic analysis processing unit 9 from the intermediate text file 16, performs code generation processing using it as input text, and outputs the target program into the target program library 17. Perform processing.

【0021】このコード生成処理部10を、コード生成
処理部用プログラム管理手段6によって以下の様に制御
する。まず、中間テキストファイル16内の、意味解析
処理部用プログラム管理テーブル13のエントリ目のテ
キスト開始アドレス領域が示す箇所からテキストを入力
して通常のコード生成処理を行い、目的プログラムライ
ブラリ中に、意味解析処理部用プログラム管理テーブル
13の1エントリ目のプログラム名領域で示されるプロ
グラム名の目的プログラムを生成する。
The code generation processing section 10 is controlled by the code generation processing section program management means 6 as follows. First, text is input from the location indicated by the text start address area of the entry number of the program management table 13 for the semantic analysis processing unit in the intermediate text file 16, and normal code generation processing is performed. A target program with the program name indicated in the program name area of the first entry of the program management table 13 for the analysis processing unit is generated.

【0022】次に、意味解析処理部用プログラム管理テ
ーブル13のエントリがまだある場合は、意味解析処理
部用プログラム管理テーブル13の次のエントリが示す
ものを当該プログラムとして、当該プログラムに対する
コード生成処理を前述の様に行い、目的プログラムを出
力する。これを、意味解析処理部用プログラム管理テー
ブル13のエントリが終了するまで繰り返し、コード生
成処理を終了するとともにコンパイラ2を終了する。
Next, if there are still entries in the program management table 13 for the semantic analysis processing section, the next entry in the program management table 13 for the semantic analysis processing section is designated as the program, and code generation processing for the program is performed. Execute as described above and output the target program. This is repeated until the entries in the program management table 13 for the semantic analysis processing section are completed, and the code generation process is completed and the compiler 2 is also terminated.

【0023】[0023]

【発明の効果】以上説明したように本発明は、一括コン
パイルのとき、指定されたプログラムの数だけコンパイ
ラが繰り返し動作せずに一回の動作で終了するため、コ
ンパイラ内部の、語彙解析処理部,構文解析処理部,意
味解析処理部およびコード生成処理部がそれぞれ一回づ
つロードされればよい。したがって、各処理部のロード
によるコンパイラの性能低下が防げる。
Effects of the Invention As explained above, in the present invention, when performing batch compilation, the compiler does not repeatedly operate for the specified number of programs and completes the operation in one operation. , the syntactic analysis processing section, the semantic analysis processing section, and the code generation processing section each need to be loaded once. Therefore, deterioration in compiler performance due to loading of each processing unit can be prevented.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明を実施する手段のコンパイラ内の構造お
よび各処理やテキストの流れを示した図である。
FIG. 1 is a diagram showing the structure within a compiler and the flow of each process and text of a means for implementing the present invention.

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

1    原始プログラムライブラリ 2    コンパイラ 3    語彙解析処理部用プログラム管理手段4  
  構文解析処理部用プログラム管理手段5    意
味解析処理部用プログラム管理手段6    コード生
成処理部用プログラム管理手段7    語彙解析処理
部 8    構文解析処理部 9    意味解析処理部 10    コード生成処理部 11    語彙解析処理部用プログラム管理テーブル
12    構文解析処理部用プログラム管理テーブル
13    意味解析処理部用プログラム管理テーブル
14    中間テキストファイル 15    中間テキストファイル 16    中間テキストファイル
1 Source program library 2 Compiler 3 Program management means for vocabulary analysis processing section 4
Program management means for syntax analysis processing section 5 Program management means for semantic analysis processing section 6 Program management means for code generation processing section 7 Vocabulary analysis processing section 8 Syntax analysis processing section 9 Semantic analysis processing section 10 Code generation processing section 11 Vocabulary analysis processing Department program management table 12 Syntax analysis processing section program management table 13 Semantic analysis processing section program management table 14 Intermediate text file 15 Intermediate text file 16 Intermediate text file

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  複数原始プログラムを一括コンパイル
するコンパイラにおいて、原始プログラムをコンパイル
して目的プログラムを得る各段階での中間テキストをプ
ログラムの翻訳単位毎に管理する語彙解析処理部用プロ
グラム管理テーブルと、構文解析処理部用プログラム管
理テーブルと、意味解析処理部用プログラム管理テーブ
ルと、コード生成処理部用プログラム管理テーブルとを
有し、語彙解析処理部が出力する中間テキストを制御す
る語彙解析処理部用プログラム管理手段と、構文解析処
理部が入出力する中間テキストを制御する構文解析処理
部用プログラム管理手段と、意味解析処理部が入出力す
る中間テキストを制御する意味解析処理部用プログラム
管理手段と、コード生成処理部が複数の目的プログラム
を出力することを制御するコード生成処理部用プログラ
ム管理手段とを設けたことを特徴とするコンパイラ。
1. In a compiler that compiles multiple source programs at once, a program management table for a lexical analysis processing unit that manages intermediate text for each program translation unit at each stage of compiling source programs to obtain a target program; A program management table for the syntactic analysis processing section, a program management table for the semantic analysis processing section, and a program management table for the code generation processing section, and for controlling the intermediate text output by the vocabulary analysis processing section. A program management means, a program management means for a syntactic analysis processing section that controls intermediate text input and output by the syntax analysis processing section, and a program management means for a semantic analysis processing section that controls intermediate text input and outputted by the semantic analysis processing section. A compiler comprising: program management means for a code generation processing section that controls output of a plurality of target programs by the code generation processing section.
JP3025839A 1991-02-20 1991-02-20 Complier Pending JPH04264924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3025839A JPH04264924A (en) 1991-02-20 1991-02-20 Complier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3025839A JPH04264924A (en) 1991-02-20 1991-02-20 Complier

Publications (1)

Publication Number Publication Date
JPH04264924A true JPH04264924A (en) 1992-09-21

Family

ID=12177023

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3025839A Pending JPH04264924A (en) 1991-02-20 1991-02-20 Complier

Country Status (1)

Country Link
JP (1) JPH04264924A (en)

Similar Documents

Publication Publication Date Title
US5606697A (en) Compiler system for language processing program
US5586328A (en) Module dependency based incremental compiler and method
JP3032031B2 (en) Loop optimization method and apparatus
JPH08202545A (en) Object-oriented system and method for generation of target language code
JPH04264924A (en) Complier
JPH10187461A (en) Language processing system
JPH07160490A (en) Coding assistance device
JPH0683597A (en) Object oriented program development device and object oriented program development method
JPH0659933A (en) Code converter
JPH0535494A (en) Interactive optimization compile system for high-level program language
JPS62182930A (en) Function dividion type parallel compiling system
JPH02100732A (en) Program grammar checking system
CN112579094A (en) Lightweight thermal restoration method based on template code matching
JPS62166432A (en) Control system for program translation
JPH0695890A (en) Name replacement system in compiler
JPH02253443A (en) Program generating method
JPH08194624A (en) Executing form program preparing method
JPH0749788A (en) Compile processing system
JPH0795275B2 (en) Compile processor
JPH08263272A (en) Library registration method and device for common routine
Babich et al. An approach to compiler construction for a general-purpose simulation language
JPH03144830A (en) Parallel processing system
JPH0573330A (en) Syntax analysis processing system
JPH0371229A (en) Program controller
JPH04308934A (en) Electronic computer