JPH01166133A - Compile processing system - Google Patents
Compile processing systemInfo
- Publication number
- JPH01166133A JPH01166133A JP62324836A JP32483687A JPH01166133A JP H01166133 A JPH01166133 A JP H01166133A JP 62324836 A JP62324836 A JP 62324836A JP 32483687 A JP32483687 A JP 32483687A JP H01166133 A JPH01166133 A JP H01166133A
- Authority
- JP
- Japan
- Prior art keywords
- dictionary
- work area
- processing
- end processing
- intermediate text
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔目 次〕
概要
産業上の利用分野
従来の技術(第4図、第5図)
発明が解決しようとする問題点
問題点を解決するための手段(第1図)作用
実施例
(a) 一実施例の説明(第2図、第3図)(b)
他の実施例の説明
発明の効果
〔概 要〕
ソースプログラムの翻訳処理を、フロントエンド処理と
バックエンド処理により行うコンパイル処理方式に関し
。[Detailed description of the invention] [Table of contents] Overview Industrial field of application Prior art (Figures 4 and 5) Problems to be solved by the invention Means for solving the problems (Figure 1) Functional example (a) Description of one example (Figures 2 and 3) (b)
Description of Other Embodiments Effects of the Invention [Summary] This invention relates to a compile processing method in which translation processing of a source program is performed by front-end processing and back-end processing.
バックエンド処理における辞書のアクセス時間を短縮し
、翻訳性能を向上することを目的とし。The purpose is to reduce dictionary access time in back-end processing and improve translation performance.
ソースプログラムを解析し、中間テキストと辞書を作成
するフロントエンド処理を行った後、外部作業域に格納
された中間テキストと辞書とを用いてオブジェクトプロ
グラムを生成するバックエンド処理を行うコンパイル処
理方式において、該バックエンド処理において、該中間
テキストを読み込む入力モジニールが該辞書を読み込ん
で内部共通作業域に設定し、オブジェクトプログラムを
生成するための他の処理モジュールが該内部共通作業域
を参照して辞書内容を得る。A compilation processing method that performs front-end processing that analyzes a source program and creates intermediate text and a dictionary, and then performs back-end processing that generates an object program using the intermediate text and dictionary stored in an external work area. , in the back-end processing, the input module that reads the intermediate text reads the dictionary and sets it in the internal common work area, and other processing modules for generating the object program refer to the internal common work area and set the dictionary. Get the content.
本発明は、ソース・プログラムの翻訳処理をフロントエ
ンド処理とバックエンド処理とで行うコンパイル処理方
式に関する。The present invention relates to a compile processing method that performs translation processing of a source program using front-end processing and back-end processing.
ソースプログラム(原始プログラム)を機械語のオブジ
ェクトプログラムに変換することは、簡易な言語プログ
ラムで記述されたプログラムをコンピュータに実行させ
るために必要であり、このためコンパイラが用いられて
いる0
近年2種々のターゲットマシンに適したオブジェクトプ
ログラムが生成できるように、コンパイラが前処理(フ
ロントエンド処理)と後処理(バックエンド処理)に分
割されている。Converting a source program (original program) into a machine language object program is necessary in order for a computer to execute a program written in a simple language program, and for this purpose, compilers are used. The compiler is divided into preprocessing (front-end processing) and post-processing (back-end processing) so that it can generate object programs suitable for the target machine.
このような構成のコンパイラでは、バックエンド処理を
ターゲットマシンに適合したものに変えるだけで9種々
のターゲットマシン、例えば汎用コンピュータ、オフィ
スプロセッサ、ワークステーションのオブジェクトプロ
グラムを生成でき。A compiler with such a configuration can generate object programs for nine different target machines, such as general-purpose computers, office processors, and workstations, simply by changing the back-end processing to match the target machine.
便利である。It's convenient.
このようなコンパイラのバックエンド処理にお゛いて翻
訳時間の短縮化が望まれている。It is desired to reduce the translation time in the back-end processing of such a compiler.
第4図は従来技術の説明図である。 FIG. 4 is an explanatory diagram of the prior art.
図中、SPはソースプログラムで、ifi、 C0B
OL等の言語により記述された原始プログラムであυ、
OPはオブジェクトプログラム(モジュール)であシ9
機械語に翻訳されたものである。In the figure, SP is the source program, ifi, C0B
It is a primitive program written in a language such as OL,
OP is an object program (module)9
It has been translated into machine language.
1はコンパイラでアリ、実際にはデータ処理システムが
行なう翻訳プログラムであシ2字句解析。1 is done by a compiler; in reality, the data processing system performs a translation program. 2) Lexical analysis is performed by a data processing system.
構文解析及び意味解析を行うフロント二ン゛ド処理2と
、オブジェクトを生成するバックエンド処理3とに分か
れている。It is divided into front-end processing 2 that performs syntax analysis and semantic analysis, and back-end processing 3 that generates objects.
フロントエンド処理2では、ソースプログラムSPを読
み込み2字句解析、構文解析及び意味解析を行い、ソー
スプログラムSPをよシ簡潔な形成である中間テキスト
20に変換して出力する。In the front-end processing 2, the source program SP is read, subjected to bilexical analysis, syntactic analysis, and semantic analysis, and the source program SP is converted into intermediate text 20 having a more concise structure and output.
例えば、第5図に示す、「BとCを掛は合わせた積とD
との和をAに格納する」という意味のソースプログラム
の記述は、 l’−BとCの掛は合わせた積をワーク
(WK)に格納し」、「ワークとDとの和をAに格納す
る」という中間テキストエレメントに変換される。For example, as shown in Figure 5, "Multiplying B and C is the combined product and D
The source program description that means "storing the sum of l'-B and C in work (WK)" means "storing the sum of work and D in A". is converted into an intermediate text element called "Storing".
又、フロントエンド処理では、ソースプログラムに記述
された各データに対して辞書21を作成し、辞書中にそ
のデータ(第5図では、A、B。In addition, in the front-end processing, a dictionary 21 is created for each data written in the source program, and the data (A, B in FIG. 5) is stored in the dictionary.
C,D)の属性(桁数等)9割付はアドレスなどの情報
を設定する。For attributes (number of digits, etc.) in C and D), information such as addresses is set.
一方、 ハックエン)”処j13では、フロントエンド
で生成された中間テキスト20を読み込み、処理モジュ
ール30〜3nによって遂次オブジェクトを生成してい
く。On the other hand, in the "hack en)" process j13, the intermediate text 20 generated by the front end is read, and objects are successively generated by the processing modules 30 to 3n.
この処理中に、データの属性を知9たい時には。During this process, when you want to know the attributes of the data.
辞V21を参照する。Refer to V21.
このような中間テキスト20.辞書21は、ソースプロ
グラムのステップ数及び記述のされ方によって9作成さ
れる量は可変である。Such intermediate text20. The amount of dictionary 21 created is variable depending on the number of steps in the source program and how it is written.
このため、コンパイラ内部作業域に固定的に領域を割り
当てることはできず、外部作業域2aに作成される。Therefore, an area cannot be fixedly allocated to the compiler internal work area, but is created in the external work area 2a.
しかしながら、従来技術では、辞書21がコンパイラの
外部作業域2aに作成されるため、バックエンド処理3
の各処理モジュール30〜3nで辞書21を参照するに
は、外部作業域をファイルオープン等の処理によってい
ちいちアクセスする必要があり、アクセス時間に時間が
かかるという問題があった。However, in the conventional technology, since the dictionary 21 is created in the external work area 2a of the compiler, the back-end processing 3
In order for each of the processing modules 30 to 3n to refer to the dictionary 21, it is necessary to access the external work area one by one by processing such as file opening, which poses a problem in that it takes a long time to access.
このため、翻訳と直接関係のないアクセス処理だけでか
なりの時間が必要となシ、コンパイラの翻訳性能を低下
させていた。Therefore, a considerable amount of time is required just for access processing that is not directly related to translation, reducing the translation performance of the compiler.
本発明は、バックエンド処理における辞書のアクセス時
間を短縮し、翻訳性能を向上しうるコンパイル処理方式
を提供することを目的とする。An object of the present invention is to provide a compilation processing method that can shorten dictionary access time in back-end processing and improve translation performance.
第1図は本発明の原理説明図である。 FIG. 1 is a diagram explaining the principle of the present invention.
図中、第4図で示したものと同一のものは同一の記号で
示しである。In the figure, the same parts as those shown in FIG. 4 are indicated by the same symbols.
本発明では、バックエンド処理3において、中間テキス
ト20を読み込む入力モジュール(3a)が、外部作業
域2aの辞書21を読み込んで内部共通作業域3bに設
定し、オブジェクトプログラム(OP)を生成するため
の他の処理モジエール30.31が内部共通作業域3b
を参照して辞書内容を得るようにしたものである。In the present invention, in the back-end processing 3, the input module (3a) that reads the intermediate text 20 reads the dictionary 21 in the external work area 2a, sets it in the internal common work area 3b, and generates an object program (OP). Other processing modules 30 and 31 are in the internal common work area 3b.
The contents of the dictionary are obtained by referring to the .
本発明は、入力モジュール3aが中間テキストに現われ
たオペランドに対応する辞書を読み込み。In the present invention, the input module 3a reads a dictionary corresponding to the operand appearing in the intermediate text.
必要な情報をコンパイラ内部の共通作業域3bに設定し
ている。Necessary information is set in the common work area 3b inside the compiler.
この内部共通作業域3bは、コンパイラを構成するどの
モジュールからも共通に参照可能なため処理モジュール
30.31は外部作業域2aをアクセスすることなく、
データの属性などの必要な辞書内容を参照できる。−
従って、アクセス時間を大幅に短縮でき、翻訳性能を向
上しうる。This internal common work area 3b can be referenced in common from any module that makes up the compiler, so the processing modules 30.31 do not have to access the external work area 2a.
You can refer to necessary dictionary contents such as data attributes. - Therefore, access time can be significantly reduced and translation performance can be improved.
(a) 一実施例の説明
第2図d本発明の詳細な説明図、第3図は第2図におけ
る中間テキストと辞書の関係図である。(a) Description of an Embodiment FIG. 2d is a detailed explanatory diagram of the present invention. FIG. 3 is a diagram showing the relationship between the intermediate text and the dictionary in FIG.
第2図中、第1図及び第4図で示したものと同一のもの
は同一の記号で示してあシ、4は原始プログラムファイ
ルであfi、C0BOL言語等で記述されたソース(原
始)プログラムが格納されているもの、5はオブジェク
トファイルでアシ、生成したオブジェクトプログラムを
格納するものである0
尚、処理モジュール30は、演算処理モジエールであシ
、演算処理のオブジェクトを作成するものでアシ、処理
モジュール31は、転記処理モジュールでアシ、転記処
理のオブジェクトを作成するものである。In Figure 2, the same parts as those shown in Figures 1 and 4 are indicated by the same symbols. 4 is a source program file fi, source written in C0BOL language etc. 5 is an object file in which the program is stored; 0 is the object file that stores the generated object program; 0 is the processing module 30, which is an arithmetic processing module; , the processing module 31 is a transcription processing module that creates an object for transcription processing.
以下、ソースプログラムSPとして、BとCを加えAに
格納するという[cOMPUTE A=B+CJをコ
ード部に、データ部としてデータA。Hereinafter, as a source program SP, B and C are added and stored in A [cOMPUTE A=B+CJ as the code part and data A as the data part.
B、Cの桁数(PIC)等を記述したC0BOL言語の
ものを例に説明する。An example of the C0BOL language that describes the number of digits (PIC) of B and C will be explained.
■ 原始プログラムファイル4のソースプログラムSP
をフロントエンドパス処理2の入力として。■ Source program SP of source program file 4
as input to front end path processing 2.
フロントエンドパス処理を開始する。Start front-end path processing.
■ コンパイラのフロントエンドパス処理2の出力結果
として、中間テキストファイル20と辞書ファイル21
が生成される。■ As the output result of the compiler's front-end pass processing 2, an intermediate text file 20 and a dictionary file 21 are created.
is generated.
第3図に示すように、中間テキストファイル20に、命
令識別コード(ADD)とデータA、B。As shown in FIG. 3, an instruction identification code (ADD) and data A and B are stored in the intermediate text file 20.
Cの辞書参照値が生成され、辞書参照値とは、辞書ファ
イル21の先頭から目的要素までの相対位置を意味する
。A dictionary reference value of C is generated, and the dictionary reference value means the relative position from the beginning of the dictionary file 21 to the target element.
一方、辞書ファイル21には、データA、B。On the other hand, the dictionary file 21 contains data A and B.
Cの要素(桁数、符号2位取シ数等)が格納される0
■ 生成された中間テキストファイル20及び辞書ファ
イル21を、 コンパイラのバックエンドパス処理3の
入力とし、バックエンドパスを開始する0
■ バックエンドパス処理3の開始処理として。0 where the elements of C (number of digits, number of digits in the second place, etc.) are stored ■ The generated intermediate text file 20 and dictionary file 21 are input to the back-end pass processing 3 of the compiler, and the back-end pass is started. Yes 0 ■ As the start process of backend path process 3.
中間テキスト人力モジュール3aが、中間テキストファ
イル20よシ中間テキストを読み込む。The intermediate text human module 3a reads the intermediate text from the intermediate text file 20.
その後、−意名A、B、Cそれぞれの辞書参照値から、
A、B、Cそれぞれに関する要素を辞書ファイル21よ
り読み込む。Then, from the dictionary reference values of names A, B, and C,
Elements related to each of A, B, and C are read from the dictionary file 21.
そして、A、B、Cそれぞれのオペランド原型に値を設
定し、完成させ、コンパイラ内部共通作業域3bに設定
する。Then, values are set in the operand prototypes of A, B, and C, and the completed operands are set in the compiler internal common work area 3b.
オペランド原型とは、以下のモジュールが共通に利用で
きるようなフォーマットである。′■ 次に、演算処理
モジュール30を呼び出す。The operand prototype is a format that can be commonly used by the following modules. '■ Next, the arithmetic processing module 30 is called.
演算処理モジュール30は、中間テキスト入力モジュー
ル3aが作成したオペランド原型よシ属性情報などの必
要な情報を参照し、−意志Bの値と一意志Cの値を加え
るオブジェク) rMOVAX、 −意志BJ 、l’
−ADD AX、 −意志cjをオブジェクトファイ
ル5に出力する。The arithmetic processing module 30 refers to necessary information such as the operand prototype created by the intermediate text input module 3a and the attribute information, and generates an object that adds the value of -will B and the value of will C) rMOVAX, - will BJ, l'
-ADD AX, -Output will cj to object file 5.
その後、演算結果(B+C)が格納されたAXレジスタ
を一意名人のデータ域に転記するため。After that, the AX register in which the calculation result (B+C) is stored is transferred to the unique data area.
転記処理モジュール31を呼び出す。The transcription processing module 31 is called.
■ 転記処理モジ巨−ル31は、AXレジスタを一意名
人のデータ域に転記するオブジェクト[MOv −意志
A、AXJをオブジェクトファイル5に出力する。(2) The transcription processing module 31 outputs to the object file 5 the object [MOv-Will A, AXJ for transcribing the AX register to the unique data area.
この時、オブジェクトを作成するために必要となる人の
属性情報は、中間テキスト人力モジュール3aによシ作
成された一意名人のオペランド原型を参照することによ
シ求める。At this time, the attribute information of the person required to create the object is obtained by referring to the operand prototype of the unique master created by the intermediate text human power module 3a.
このように、中間テキスト人力モジュール3aが、辞書
ファイル21を1回アクセスするだけで。In this way, the intermediate text manual module 3a only needs to access the dictionary file 21 once.
他の下位モジエール30.31は辞書ファイル21をア
クセスしなくても、−意志の属性情報など必要な情報を
判別できる。The other lower module modules 30 and 31 can determine necessary information such as the attribute information of -will without accessing the dictionary file 21.
従って、外部作業域2aである辞書ファイル21をアク
セスする回数が減ることによシ、辞書ファイル21をア
クセスするために費やされる時間が省かれ、翻訳性能が
向上する。Therefore, by reducing the number of times the dictionary file 21, which is the external work area 2a, is accessed, the time spent accessing the dictionary file 21 is saved, and translation performance is improved.
又、中間テキスト入力モジニール3aは中間テキストを
逐次読み込むため、その時に必要な辞書内容を内部共通
作業域3bに読み込むため2作業域3bは固定でよいた
め、内部に設けられる。Further, since the intermediate text input module 3a sequentially reads the intermediate text, the dictionary contents necessary at that time are read into the internal common work area 3b, so the two work areas 3b may be fixed, so they are provided internally.
(b) 他の実施例の説明
上述の実施例では、ソースプログラムにC0BOL言語
を用いたが、他の言語であってもよく。(b) Description of other embodiments In the embodiments described above, the C0BOL language was used for the source program, but other languages may be used.
ソース記述も第2図のものに限られず、他のものにも適
用できる。The source description is not limited to the one shown in FIG. 2, but can also be applied to other sources.
又、処理モジュールを演算と転記のもので説明したが、
オブジェクトの生成に必要なモジュールを種々用いるこ
とができる。Also, the processing module was explained in terms of calculation and transcription, but
Various modules necessary for generating objects can be used.
以上本発明を実施例によシ説明したが9本発明は本発明
の主旨に従い種々の変形が可能であシ。Although the present invention has been described above with reference to embodiments, the present invention can be modified in various ways according to the spirit of the present invention.
本発明からこれらを排除するものではない。These are not excluded from the present invention.
以上説明した様に1本発明によれば、フロントエンドと
バックエンド処理によってコンパイル処理を行なうもの
において、バックエンド処理における外部作業域のアク
セス回数を減少できるので。As explained above, according to one aspect of the present invention, the number of accesses to the external work area during back-end processing can be reduced in a system in which compilation processing is performed by front-end and back-end processing.
翻訳性能を向上することができるという効果を奏し、コ
ンパイル速度を高速化できる。This has the effect of improving translation performance and speeding up compilation speed.
第1図は本発明の原理説明図。 第2図は本発明の詳細な説明図。 第3図は第2図における中間テキストと辞書の関係図。 第4図は従来技術の説明図。 第5図はフロントエンド処理の説明図である。 図中、1・・・コンパイラ。 2・・・フロントエンド処理。 2a・・・外部作業域。 3・・・バックエンド処理。 3a・・・入力モジュール。 3b・・・内部共通作業域。 SP・・・ソースプログラム。 OP・・・オブジェクトプログラム。 21・・・辞書ファイル。 特許田麩 富士通株式会社 FIG. 1 is a diagram explaining the principle of the present invention. FIG. 2 is a detailed explanatory diagram of the present invention. FIG. 3 is a diagram showing the relationship between the intermediate text and the dictionary in FIG. 2. FIG. 4 is an explanatory diagram of the prior art. FIG. 5 is an explanatory diagram of front end processing. In the figure, 1...compiler. 2...Front end processing. 2a...External work area. 3...Backend processing. 3a...input module. 3b... Internal common work area. SP...Source program. OP...Object program. 21...Dictionary file. Patented rice cake Fujitsu Limited
Claims (1)
0)と辞書(21)を作成するフロントエンド処理(2
)を行った後、 外部作業域(2a)に格納された中間テキスト(20)
と辞書(21)とを用いてオブジェクトプログラム(O
P)を生成するバックエンド処理(3)を行うコンパイ
ル処理方式において、 該バックエンド処理(3)において、 該中間テキストを読み込む入力モジュール(3a)が該
辞書を読み込んで内部共通作業域(3b)に設定し、 オブジェクトプログラム(OP)を生成するための他の
処理モジュール(30)が該内部共通作業域(3b)を
参照して辞書内容を得ることを 特徴とするコンパイル処理方式。[Claims] A source program (SP) is analyzed, intermediate text (2
Front-end processing (2) that creates a dictionary (21) and a dictionary (21)
), the intermediate text (20) stored in the external work area (2a)
and dictionary (21) to create an object program (O
In a compilation processing method that performs back-end processing (3) to generate P), in the back-end processing (3), an input module (3a) that reads the intermediate text reads the dictionary and creates an internal common work area (3b). , and another processing module (30) for generating an object program (OP) refers to the internal common work area (3b) to obtain dictionary contents.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62324836A JPH01166133A (en) | 1987-12-22 | 1987-12-22 | Compile processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62324836A JPH01166133A (en) | 1987-12-22 | 1987-12-22 | Compile processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01166133A true JPH01166133A (en) | 1989-06-30 |
Family
ID=18170224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62324836A Pending JPH01166133A (en) | 1987-12-22 | 1987-12-22 | Compile processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01166133A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5924348A (en) * | 1982-07-31 | 1984-02-08 | Fujitsu Ltd | Compilation processing method |
JPS6091450A (en) * | 1983-10-24 | 1985-05-22 | Hitachi Ltd | Table type language interpreter |
JPS61264440A (en) * | 1985-05-20 | 1986-11-22 | Mitsubishi Electric Corp | Compiling system |
-
1987
- 1987-12-22 JP JP62324836A patent/JPH01166133A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5924348A (en) * | 1982-07-31 | 1984-02-08 | Fujitsu Ltd | Compilation processing method |
JPS6091450A (en) * | 1983-10-24 | 1985-05-22 | Hitachi Ltd | Table type language interpreter |
JPS61264440A (en) * | 1985-05-20 | 1986-11-22 | Mitsubishi Electric Corp | Compiling system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Koelbel | The high performance Fortran handbook | |
US7823139B2 (en) | Method and system for translating programming languages | |
JPH0630066B2 (en) | Table type language translation method | |
JPH08202545A (en) | Object-oriented system and method for generation of target language code | |
JPH01166133A (en) | Compile processing system | |
Davidson | Simplifying code generation through peephole optimization | |
US20040064301A1 (en) | Software development system, simulator, and recording medium | |
Liang et al. | Register allocation for QEMU dynamic binary translation systems | |
KR0169909B1 (en) | Method for designing assembly code generator for target processor | |
Labrousse et al. | CREATE-LIFE: a design system for high performances VLSI circuits | |
Bose | Instruction set design for support of high-level languages | |
JPH0272407A (en) | Ladder program converter | |
Gardner | A transportation of ALGOL68C | |
JP3208300B2 (en) | Method of extracting use form of physical entity in program and related extraction method | |
Nobre et al. | Hardware/Software Compilation | |
JPH03144829A (en) | Variable target compiler system | |
JP2003337707A (en) | Method for increasing speed of compiler and loop for processing list structure data | |
Wilcox | The MAINSAIL Project: Developing Tools for Software Portability | |
JPS60181932A (en) | Data managing system | |
JPH04120629A (en) | Code generating method | |
JPS63178345A (en) | Database access processing method | |
Bulyonkov | Mixed computation in novosibirsk | |
JPH0795275B2 (en) | Compile processor | |
JPH0373026A (en) | Compile system | |
JPH0468664B2 (en) |