JPH0414144A - Compilation processing method - Google Patents
Compilation processing methodInfo
- Publication number
- JPH0414144A JPH0414144A JP11786090A JP11786090A JPH0414144A JP H0414144 A JPH0414144 A JP H0414144A JP 11786090 A JP11786090 A JP 11786090A JP 11786090 A JP11786090 A JP 11786090A JP H0414144 A JPH0414144 A JP H0414144A
- Authority
- JP
- Japan
- Prior art keywords
- architecture
- intermediate language
- general
- semantic analysis
- code generation
- 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
【発明の詳細な説明】
〔概要〕
C0BOLコンパイラやF]RTRANコンパイラなど
のデータ処理装置におけるコンパイル処理方法に関し
コンパイラにおける意味解析処理の手続き中から、アー
キテクチャ依存部分を分離し、テーブル化することによ
り、コンパイラの開発効率を向上させることを目的とし
計算機アーキテクチャに依存しない汎用的な意味解析を
行い、原始プログラムから汎用中間言を生成する意味解
析処理過程と、汎用中間言と計算機アーキテクチャに応
じた中間言との対応情報が格納された中間言用スケルト
ンテーブルを使用し。[Detailed Description of the Invention] [Summary] Regarding the compilation processing method in a data processing device such as a COBOL compiler or F]RTRAN compiler, by separating architecture-dependent parts from the semantic analysis processing procedure in the compiler and creating a table, The aim is to improve the development efficiency of compilers by performing general-purpose semantic analysis that does not depend on computer architecture, and to create a general-purpose intermediate language from a source program. It uses a skeleton table for intermediate language that stores correspondence information with .
汎用中間言を計算機アーキテクチャに依存した中間型に
変換するアーキテクチャ依存処理過程とを備え、意味解
析およびコード生成の双方でテーブルを用いたスケルト
ン展開を行うように構成する。It is equipped with an architecture-dependent processing process that converts a general-purpose intermediate language into an intermediate type that depends on the computer architecture, and is configured to perform skeleton expansion using tables in both semantic analysis and code generation.
本発明は、C0BOLコンパイラやFORTRANコン
パイラなどのデータ処理装置におけるコンパイル処理方
法に関する。The present invention relates to a compilation processing method in a data processing device such as a COBOL compiler or a FORTRAN compiler.
第6図は従来技術の例を示す。 FIG. 6 shows an example of the prior art.
第6図において、11はコンパイル対象となる原始プロ
グラム、13はアーキテクチャに依存したコード生成に
使用されるコード生成用スケルトンテーブル、16は意
味解析結果の中間的なテキストである中間型、17は最
適化中間型、18はコンパイル結果の目的プログラム、
60は意味解析処理、61は最適化処理、62はコード
生成処理を表す。In FIG. 6, 11 is a source program to be compiled, 13 is a code generation skeleton table used for architecture-dependent code generation, 16 is an intermediate type that is an intermediate text of the semantic analysis result, and 17 is an optimal intermediate type, 18 is the target program of the compilation result,
60 represents a semantic analysis process, 61 represents an optimization process, and 62 represents a code generation process.
C0BOLの原始プログラム11を翻訳する場合を例に
して、従来技術を説明する。The prior art will be explained using an example of translating a COBOL source program 11.
意味解析処理60では、原始プログラム11を入力し、
その意味解析を行って、中間型16を出力する。ここで
は、外部10進で定義された変数B、 Cを、内部10
進に変換し5それについて内部10進加算命令を用いて
加算する中間型16を生成している。In the semantic analysis process 60, the source program 11 is input,
The semantic analysis is performed and an intermediate type 16 is output. Here, variables B and C defined in external decimal are converted into internal decimal
An intermediate type 16 is generated which is converted to decimal and added to it using an internal decimal add instruction.
最適化処理61では、中間型16についての実行論理の
変更や不要な手続きの削除などの最適化を行い5その結
果を最適化中間型17として出力する。In the optimization process 61, the intermediate type 16 is optimized by changing the execution logic, deleting unnecessary procedures, etc. 5 and outputs the result as the optimized intermediate type 17.
コード生成処理62では、コート生成用スケルトンテー
ブル13を用いて最適化中間型17から目的プログラム
18を生成する処理を行う。コード生成用スケルトンテ
ーブル13は、ターゲットとなる計算機アーキテクチャ
に依存したコードの形式をテーブルとして持つものであ
る。コード生成処理62において、最適化中間型17の
中間型をもとにしてコード生成用スケルトンテーブル1
3を検索することにより、出力するコードを決定する。In the code generation process 62, a process of generating the target program 18 from the optimization intermediate mold 17 using the code generation skeleton table 13 is performed. The code generation skeleton table 13 has a code format depending on the target computer architecture as a table. In the code generation process 62, a code generation skeleton table 1 is created based on the intermediate type of the optimization intermediate type 17.
3, the code to be output is determined.
目的プログラム18におけるPACK命令は外部10進
(ゾーン形式)を内部10進(パンク形式)に変換する
命令、AP命令は、内部10進を加算する命令、UNP
K命令は、内部10進を外部10進に変換する命令であ
る。中間型16における一時域のT3は、目的プログラ
ム18では一時域のT2に重ねられている。The PACK instruction in the target program 18 is an instruction to convert external decimal (zone format) to internal decimal (punk format), and the AP instruction is an instruction to add internal decimal, UNP
The K instruction is an instruction to convert internal decimal to external decimal. The temporary area T3 in the intermediate type 16 is overlapped with the temporary area T2 in the target program 18.
従来技術では、コード生成処理62の中で、アーキテク
チャに依存したコード生成を行うためのコード生成用ス
ケルトンテーブル13が用いられていたが、意味解析処
理60では、アーキテクチャに依存した部分を処理する
ための手続きが、意味解析の処理の中に混在していた。In the conventional technology, the code generation skeleton table 13 is used in the code generation process 62 to perform architecture-dependent code generation, but in the semantic analysis process 60, the code generation skeleton table 13 is used to process architecture-dependent parts. These procedures were mixed into the semantic analysis process.
従来技術では1例えば第6図に示すように、コンパイラ
の意味解析処理60部分で、計算機アーキテクチャに依
存した中間型16を出力し、コード生成処理62部分で
は、その中間型16または最適化中間型17とコード生
成用スケルトンテーブル13とをもとにして、生成する
コードを決定していた。In the conventional technology 1, for example, as shown in FIG. 6, the semantic analysis processing 60 of the compiler outputs an intermediate type 16 that depends on the computer architecture, and the code generation processing 62 outputs the intermediate type 16 or the optimized intermediate type. 17 and the code generation skeleton table 13, the code to be generated is determined.
これは、対象となるアーキテクチャにおいて高性能なオ
ブジェクトを生成するために2中間言16の出力元であ
る意味解析処理60部分で、計算機アーキテクチャを意
識しなければならなかったためである。しかし、意味解
析処理60部分にアーキテクチャに依存した処理を混在
させると対象アーキテクチャが変更になるごとに、意味
解析の手続きを変更する必要が生し、開発効率が悪くな
るという問題がある。This is because the computer architecture had to be taken into consideration in the semantic analysis processing 60, which is the output source of the binary intermediate language 16, in order to generate a high-performance object in the target architecture. However, if architecture-dependent processing is mixed in the semantic analysis processing 60 part, the semantic analysis procedure will need to be changed every time the target architecture changes, resulting in a problem that development efficiency will be reduced.
本発明は上記問題点の解決を図り、コンパイラにおける
意味解析処理の手続き中から、アーキテクチャ依存部分
を分離し、テーブル化することにより、コンパイラの開
発効率を向上させることを目的としている。The present invention aims to solve the above-mentioned problems and improve the efficiency of compiler development by separating architecture-dependent parts from the semantic analysis process in the compiler and creating a table.
第1図は本発明の原理説明図である。 FIG. 1 is a diagram explaining the principle of the present invention.
第1図において、10はCPUおよびメモリなどからな
るデータ処理装置、11はコンパイル対象となる原始プ
ログラム、12はアーキテクチャに依存した中間型の生
成に使用される中間言用スケルトンテーブル、13はア
ーキテクチャに依存したコード生成に使用されるコード
生成用スケルトンテーブル、14はアーキテクチャに依
存しない意味解析結果の汎用中間型、15は最適化され
た中間型である最適化汎用中間型、16はアーキテクチ
ャに応じた中間型、17は最適化された最適化中間型、
18はコンパイル結果の目的プログラム、20は意味解
析処理、21は汎用中間言置適化処理、22はアーキテ
クチャ依存処理、23は中間言置適化処理、24はコー
ド生成処理を表す。In FIG. 1, 10 is a data processing device consisting of a CPU and memory, 11 is a source program to be compiled, 12 is an intermediate language skeleton table used to generate architecture-dependent intermediate types, and 13 is an architecture-dependent intermediate language skeleton table. A skeleton table for code generation used for dependent code generation, 14 is a general-purpose intermediate type of the semantic analysis result that does not depend on the architecture, 15 is an optimized general-purpose intermediate type that is an optimized intermediate type, and 16 is a general-purpose intermediate type that is an optimized intermediate type, 16 is a general-purpose intermediate type that is an optimized intermediate type. intermediate type, 17 is an optimized intermediate type,
Reference numeral 18 represents a target program of the compilation result, 20 represents a semantic analysis process, 21 represents a general-purpose intermediate language optimization process, 22 represents an architecture-dependent process, 23 represents an intermediate language optimization process, and 24 represents a code generation process.
意味解析処理20では、原始プログラム11を入力して
、所定の文法に従った意味解析を行い。In the semantic analysis process 20, the source program 11 is input and semantic analysis is performed according to a predetermined grammar.
アーキテクチャに依存しない汎用中間型14を出力する
。汎用中間言置適化処理21では、必要に応じて汎用中
間型14に対する最適化のための変更を行い、その結果
を最適化汎用中間型15として出力する。An architecture-independent general-purpose intermediate type 14 is output. In the general-purpose intermediate statement optimization process 21, changes are made to the general-purpose intermediate type 14 for optimization as necessary, and the results are output as an optimized general-purpose intermediate type 15.
アーキテクチャ依存処理22は、従来の意味解析に関係
するアーキテクチャに依存した処理を行う部分で、ここ
で中間言用スケルトンテーブル12を用いることにより
、最適化汎用中間型15から計算機アーキテクチャに依
存した中間型16を生成する。The architecture-dependent processing 22 is a part that performs architecture-dependent processing related to conventional semantic analysis, and by using the skeleton table 12 for intermediate language, the optimization general-purpose intermediate type 15 is changed to an intermediate type depending on the computer architecture. Generate 16.
中間言置適化処理23では、中間型16についての実行
論理の変更や不要な手続きの削除などの最適化を行い、
最適化中間型17を出力する。In the intermediate statement optimization process 23, optimization is performed such as changing the execution logic of the intermediate type 16 and deleting unnecessary procedures.
The optimized intermediate type 17 is output.
コード生成処理24では、コード生成用スケルトンテー
ブル13を用いて、最適化中間型17から機械語命令列
などからなる目的プログラム18を生成する。In the code generation process 24, the code generation skeleton table 13 is used to generate an object program 18 consisting of a machine language instruction sequence from the optimization intermediate type 17.
コード生成用スケルトンテーブル13は、アーキテクチ
ャに依存した中間型16または最適化中間型17をもと
に、アーキテクチャに合致したオブジェクトコードを生
成するためのテーブルで従来から用いられていたもので
ある。The code generation skeleton table 13 is a table that has been conventionally used to generate object code that matches the architecture based on the architecture-dependent intermediate type 16 or the optimized intermediate type 17.
本発明では、さらに汎用中間型14または最適化汎用中
間型15から、アーキテクチャに依存した中間型16を
切り分ける中間言用スケルトンテーブル12が設けられ
、これによって、意味解析処理20の本体部分と、アー
キテクチャ依存処理22とを分離させる。In the present invention, an intermediate language skeleton table 12 is further provided that separates an architecture-dependent intermediate type 16 from the general-purpose intermediate type 14 or the optimization general-purpose intermediate type 15. The dependent processing 22 is separated.
クチャに依存するため、アーキテクチャが変更となるご
とに変更が必要になるが、アーキテクチャに依存した部
分が手続き部分に入らないため、意味解析処理20を各
アーキテクチャで共通化することができる。したがって
、コンパイラの効率的な開発が可能になり、保守性も向
上する。Because it depends on the architecture, it needs to be changed every time the architecture changes, but since the architecture-dependent parts are not included in the procedure part, the semantic analysis process 20 can be shared by each architecture. Therefore, efficient development of the compiler becomes possible and maintainability is improved.
アーキテクチャ間の相違点を吸収する箇所をテーブル化
して、意味解析と分離する。そして、意味解析処理20
では、意味解析だけに徹し2各アーキテクチヤに対して
汎用的な中間型を出力する。Create a table that absorbs differences between architectures and separate them from semantic analysis. Then, semantic analysis processing 20
Now, we will concentrate on semantic analysis and output general-purpose intermediate types for each architecture.
アーキテクチャ依存処理22では、意味解析処理20.
汎用中間言置適化処理21が出力した汎用中間型14ま
たは最適化汎用中間型15をもとに、中間言用スケルト
ンテーブル12を参照することにより、汎用中間型14
または最適化汎用中間型15を5従来のアーキテクチャ
に依存した中間型16に変換する処理を行う。In the architecture dependent processing 22, the semantic analysis processing 20.
Based on the general-purpose intermediate type 14 or the optimized general-purpose intermediate type 15 output by the general-purpose intermediate expression optimization process 21, the general-purpose intermediate type 14 is created by referring to the intermediate language skeleton table 12.
Alternatively, processing is performed to convert the optimized general-purpose intermediate type 15 into an intermediate type 16 that depends on the conventional architecture.
中間言用スケルトンテーブル12は、アーキテ〔実施例
〕
第2圀は本発明の一実施例による展開例、第3図ないし
第5図は本発明の一実施例で用いる中間言用スケルトン
テーブルの構成例を示す。The intermediate language skeleton table 12 is an architecture (embodiment). The second section shows an example of development according to an embodiment of the present invention, and FIGS. 3 to 5 show the structure of the intermediate language skeleton table used in an embodiment of the present invention. Give an example.
以下、C0BOLのコンパイラについての例を説明する
が、他の計算機言語についても同様に本発明を適用する
ことが可能である。An example of a COBOL compiler will be described below, but the present invention can be similarly applied to other computer languages.
意味解析処理では、第2図に示す原始プログラム11を
入力すると、その意味解析を行い、汎用中間型14を出
力する。ここで、r#ADD AB、CJは、変数B
と変数Cの加算結果を、変数Aに代入することを示す中
間型である。この段階では、変数A、B、Cのデータ属
性は、まだ決まっていない。In the semantic analysis process, when the source program 11 shown in FIG. 2 is input, its meaning is analyzed and a general-purpose intermediate type 14 is output. Here, r#ADD AB, CJ are variables B
This is an intermediate type that indicates that the result of addition of and variable C is assigned to variable A. At this stage, the data attributes of variables A, B, and C have not yet been determined.
原始プログラム11中では、変数A、B、Cが外部lO
進で定義されているが、内部では必ずしも外部10進で
ある必要はない。どのデータ属性で扱えば高速なオブジ
ェクトになるかは、対象となる計算機アーキテクチャに
依存する。そこで。In the source program 11, variables A, B, and C are external
Although it is defined in decimal, internally it does not necessarily have to be externally in decimal. Which data attributes should be used to create a high-speed object depends on the target computer architecture. Therefore.
アーキテクチャ依存最適化により1例えば変数A。1, e.g. variable A, by architecture-dependent optimization.
B、Cの属性を内部10進とすることが決まるとその条
件に応して汎用中間型14を中間型16にスケルトン展
開する。When it is decided that the attributes of B and C should be internal decimal, the general-purpose intermediate type 14 is skeleton-developed into the intermediate type 16 according to the condition.
rADDP−L A、B、Cjは、内部10進の変数
Bと変数Cを加算して、結果を内部10進の変数Aに代
入することを示す中間型16である。rADDP-L A, B, and Cj are intermediate types 16 that indicate adding internal decimal variables B and C and assigning the result to internal decimal variable A.
第2図に示す目的プログラム18は、中間型16にもと
づいて、最終的に出力されたオブジェクトコードであり
、 rAP A、B、CJは、BとCとを足し、A
に代入する処理を実行する内部10進の加算命令である
。変数Aの属性が、内部10進に変更されたため、1つ
のAP命令だけで手続きが完了している。The object program 18 shown in FIG. 2 is the object code finally output based on the intermediate type 16, and rAP A, B, CJ is the sum of B and C, and A
This is an internal decimal addition instruction that executes the process of assigning to . Since the attribute of variable A has been changed to internal decimal, the procedure is completed with only one AP command.
次に、Xという計算機アーキテクチャと、Yという計算
機アーキテクチャの2種類のアーキテクチャをサポート
する場合を例に、第1図に示す中間言用スケルトンテー
ブル12の構成について説明する。Next, the configuration of the intermediate language skeleton table 12 shown in FIG. 1 will be explained using an example in which two types of architectures, a computer architecture X and a computer architecture Y are supported.
例えば、第3図(イ)に示す汎用中間型14について、
アーキテクチャに依存した中間型を生成するものとする
。なお、変数の属性は、それぞれAは外部10進、Bは
内部10進、Cは2進で定義されているとする。For example, regarding the general-purpose intermediate mold 14 shown in FIG. 3(a),
An architecture-dependent intermediate type shall be generated. It is assumed that the attributes of the variables are defined as A in external decimal, B in internal decimal, and C in binary.
中間言用スケルトンテーブル12のテーブル本体は2例
えばXアーキテクチャの場合、あらかじめ第3図(ロ)
に示すように作成され、Xアーキテクチャの場合、第3
図(ハ)に示すように作成される。For example, in the case of
and for X architecture, the third
It is created as shown in Figure (c).
このテーブル本体における中間型は、それぞれ次のよう
な意味を持っている。The intermediate types in this table body have the following meanings.
(a)CVBP 内部10進を2進に変換する。(a) CVBP Convert internal decimal to binary.
(b)ADDB 2進同士を加算する。(b) ADDB Add binary numbers together.
(C)CVZB 2進を外部10進に変換する。(C)CVZB Convert binary to external decimal.
(d)CVPB 2進を内部10進に変換する。(d)CVPB Converts binary to internal decimal.
(e)ADDP 内部10進同士を加算する。(e) ADDP Add internal decimal numbers.
(f)CVZP 内部10進を外部10進に変換する。(f) CVZP Convert internal decimal to external decimal.
(6)ADDZ 外部10進同士を加算する。(6) ADDZ Add external decimals.
スケルトンテーブル本体の他に、Xアーキテクチャの場
合、第4回(イ)に示す条件識別チーフルと、第4図(
ロ)に示す取出しビットテーブルとが用意される。一方
、Xアーキテクチャの場合第5図(イ)に示す条件識別
テーブルと、第5図(ロ)に示す取出しビットテーブル
とが用意される。In addition to the skeleton table itself, in the case of the
The extraction bit table shown in b) is prepared. On the other hand, in the case of the X architecture, a condition identification table shown in FIG. 5(a) and an extraction bit table shown in FIG. 5(b) are prepared.
各条件識別テーブルにおけるBINは、演算が2進モー
ドになる条件、PACKは、演算が内部10進モードに
なる条件、ZONEは、演算が外部10進モードになる
条件であり1条件識別テーブルには、アーキテクチャに
応して決定する演算モートの条件が記述されている。In each condition identification table, BIN is the condition for the operation to be in binary mode, PACK is the condition for the operation to be in the internal decimal mode, and ZONE is the condition for the operation to be in the external decimal mode. , the conditions of the calculation mote determined according to the architecture are described.
取出しビットテーブルには2条件識別テーブルにより決
定された演算モードに対して2スケルトンチ一フル本体
から、どの中間型を取り出すべきかの情報が記述されて
いる。取出しビットテーブルにおける値が“0”ならば
、取出しを行わす“°1°゛ならば取出しを行うことを
示している。The extraction bit table describes information on which intermediate type should be extracted from the two-skeleton full body for the operation mode determined by the two-condition identification table. If the value in the extraction bit table is "0", it means that the extraction is to be performed, and if the value is "°1°", the extraction is to be performed.
取出しビットテーブルの上欄に表した数字と。The numbers shown in the upper column of the extraction bit table.
スケルトンテーブル本体の左側に表した数字とが対応し
ている。The numbers shown on the left side of the skeleton table correspond to each other.
アーキテクチャ依存処理の手順は、各アーキテクチャに
共通であり、以下のとおりである。The architecture-dependent processing procedure is common to each architecture and is as follows.
(1)条件識別テーブルを参照し、どの演算モードでの
処理が妥当かを判断する。(1) Refer to the condition identification table and determine which calculation mode is appropriate for processing.
(2) その後、決定した演算モード用の取出しピン
トテーブルを参照し、出力する中間型を第3図(ロ)ま
たは(ハ)に示すスケルトンテーブル本体から取り出す
。(2) Thereafter, referring to the take-out focus table for the determined calculation mode, take out the intermediate mold to be output from the skeleton table main body shown in FIG. 3 (b) or (c).
この例の場合、Xアーキテクチャでは、外部10進の機
械語命令があり、Xアーキテクチャでは外部10進の機
械語命令はない、XアーキテクチャとXアーキテクチャ
とでは1条件識別テーブルの内容が異なり、特にXアー
キテクチャで外部10進の演算モードが選択されること
はないため。In this example, the X architecture has external decimal machine language instructions, the X architecture has no external decimal machine language instructions, the contents of the condition identification table differ between the X architecture and the This is because the external decimal arithmetic mode is never selected in the architecture.
外部10進となるモード(ZONE)の条件は存在しな
い。そのため、取出しビットテーブルのZONEモード
用のテーブルには、第5図(ロ)に示すように値が“0
”以外は設定されない。There is no condition for the mode (ZONE) to be external decimal. Therefore, the ZONE mode table of the extraction bit table has the value "0" as shown in Figure 5 (b).
” will not be set.
Xアーキテクチャの場合、第3図(イ)に示すような汎
用中間型14に対して、第4図(イ)に示す条件識別テ
ーブルによる条件判定を行い、各演算モードに応して2
次のような中間型を出力する。In the case of the
Outputs an intermediate type like the following:
(a) 演算モードが2進(BIN)の場合第3図(
ロ)に示す1番から3番までの中間型を出力する。(a) When the calculation mode is binary (BIN) Figure 3 (
Output intermediate molds from No. 1 to No. 3 shown in b).
[有])演算モードが内部10進(PACK)の場合第
3図(ロ)に示す4番から6番までの中間易を出力する
。[Yes]) When the operation mode is internal decimal (PACK), intermediate numbers 4 to 6 shown in FIG. 3 (b) are output.
(C)゛ 演算モードが外部10進(ZONE)の場合
第3図(ロ)に示す7番から9番までの中間型を出力す
る。(C) If the operation mode is external decimal (ZONE), intermediate types from No. 7 to No. 9 shown in FIG. 3 (B) are output.
一方、Yアーキテクチャの場合、第3図(イ)に示すよ
うな汎用中間型14に対して、第5回(イ)に示す条件
識別テーブルによる条件判定を行い、各演算モードに応
じて1次のような中間型を出力する。On the other hand, in the case of Y architecture, condition determination is performed using the condition identification table shown in Part 5 (a) for the general-purpose intermediate type 14 as shown in Figure 3 (a), and the primary Outputs an intermediate type like .
(a) 演算モードが2進(BIN)の場合第3図(
ハ)に示す1番から4番までの中間型を出力する。(a) When the calculation mode is binary (BIN) Figure 3 (
Output intermediate molds No. 1 to No. 4 shown in c).
0)演算モードが内部10進(PACK)の場合第3図
(ハ)に示す5番から7番までの中間型を出力する。0) When the calculation mode is internal decimal (PACK), intermediate types from No. 5 to No. 7 shown in FIG. 3 (C) are output.
Xアーキテクチャでは、Xアーキテクチャとは異なり、
直接、2進を外部10進に変換する命令がないため、−
旦、内部10進を経由する処理(CVPB、CVZP)
の追加が必要になってい以上のように、各アーキテクチ
ャごとに、実際には、意味解析結果の中間型が違うこと
になるが中間8用スケルトンテーブルで、その違いを吸
収することができる。なお、第1図に示す中間型16を
生成した後の中間言置適化処理23およびコド生成処理
24の処理は、従来と同様でよいので、その詳しい説明
を省略する。In the X architecture, unlike the X architecture,
Since there is no instruction to directly convert binary to external decimal, -
Processing via internal decimal (CVPB, CVZP)
As mentioned above, the intermediate type of the semantic analysis result will actually be different for each architecture, but the intermediate 8 skeleton table can absorb these differences. It should be noted that the processes of the intermediate position optimization process 23 and the code generation process 24 after generating the intermediate type 16 shown in FIG. 1 may be the same as those in the conventional art, and detailed explanation thereof will be omitted.
以上説明したように7本発明によれば、2段スケルトン
を使用することにより、アーキテクチャに依存した部分
を手続きから分離することができ。As explained above, according to the present invention, by using a two-stage skeleton, architecture-dependent parts can be separated from procedures.
特に多数のアーキテクチャに対する開発効率が向上する
。また、アーキテクチャ依存部分のテーブル化によって
保守性も向上し、信頼性が高くなる。In particular, development efficiency for a large number of architectures is improved. Furthermore, by creating tables for architecture-dependent parts, maintainability is improved and reliability is increased.
第3図ないし第5図は本発明の一実施例で用いる中間8
用スケルトンテーブルの構成例第6図は従来技術の例を
示す。Figures 3 to 5 show an intermediate 8 used in one embodiment of the present invention.
FIG. 6 shows an example of the prior art.
図中、10はデータ処理装置、11は原始プログラム、
12は中間8用スケルトンテーブル、13はコード生成
用スケルトンテーブル、14は汎用中間型、15は最適
化汎用中間型、16は中間型、17は最適化中間型、1
8は目的プログラム20は意味解析処理、21は汎用中
間型最適化処理、22はアーキテクチャ依存処理、23
は中間言置適化処理、24はコード生成処理を表す。In the figure, 10 is a data processing device, 11 is a source program,
12 is a skeleton table for intermediate 8, 13 is a code generation skeleton table, 14 is a general-purpose intermediate type, 15 is an optimization general-purpose intermediate type, 16 is an intermediate type, 17 is an optimization intermediate type, 1
8 is a target program 20 is a semantic analysis process, 21 is a general-purpose intermediate optimization process, 22 is an architecture-dependent process, 23
24 represents an intermediate position optimization process, and 24 represents a code generation process.
Claims (1)
行った結果の中間言(16)から、目的プログラム(1
8)の対象となる計算機アーキテクチャに応じてあらか
じめ用意されたコード生成用スケルトンテーブル(13
)を使用して、出力するコードを決定するコード生成処
理過程(24)を備えたデータ処理装置(10)におけ
るコンパイル処理方法において、計算機アーキテクチャ
に依存しない汎用的な意味解析を行い、原始プログラム
から汎用中間言を生成する意味解析処理過程(20)と
、 汎用中間言と計算機アーキテクチャに応じた中間言との
対応情報が格納された中間言用スケルトンテーブル(1
2)を使用し、汎用中間言を計算機アーキテクチャに依
存した中間言に変換するアーキテクチャ依存処理過程(
22)とを備え、 意味解析およびコード生成の双方でテーブルを用いたス
ケルトン展開を行うことを特徴とするコンパイル処理方
法。[Claims] From the intermediate language (16) as a result of semantic analysis and optimization processing of the source program (11), the target program (1
8) A code generation skeleton table (13) prepared in advance according to the target computer architecture.
) is used to perform a general-purpose semantic analysis independent of computer architecture in a compilation processing method in a data processing device (10) equipped with a code generation processing step (24) that determines the code to be output, from a source program. A semantic analysis process (20) that generates a general-purpose intermediate language, and an intermediate language skeleton table (1) that stores correspondence information between the general-purpose intermediate language and the intermediate language according to the computer architecture.
2) to convert a general-purpose intermediate language into an intermediate language that depends on the computer architecture (
22) A compilation processing method, characterized in that skeleton expansion using tables is performed in both semantic analysis and code generation.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP11786090A JPH0414144A (en) | 1990-05-08 | 1990-05-08 | Compilation processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP11786090A JPH0414144A (en) | 1990-05-08 | 1990-05-08 | Compilation processing method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0414144A true JPH0414144A (en) | 1992-01-20 |
Family
ID=14722091
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP11786090A Pending JPH0414144A (en) | 1990-05-08 | 1990-05-08 | Compilation processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0414144A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6305013B1 (en) | 1998-04-01 | 2001-10-16 | Nec Corporation | Compiling method for generating target program in accordance with target processor type, compiling device, recording medium with compiling program recorded therein and recording medium with conversion table used in compiling recorded therein |
| JP2006525572A (en) * | 2003-05-02 | 2006-11-09 | トランジティブ リミテッド | Improved architecture for generating intermediate representations for program code conversion |
| USRE40498E1 (en) | 1993-05-27 | 2008-09-09 | Matsushita Electric Industrial Co., Ltd. | Variable address length compiler and processor improved in address management |
-
1990
- 1990-05-08 JP JP11786090A patent/JPH0414144A/en active Pending
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| USRE40498E1 (en) | 1993-05-27 | 2008-09-09 | Matsushita Electric Industrial Co., Ltd. | Variable address length compiler and processor improved in address management |
| USRE41959E1 (en) | 1993-05-27 | 2010-11-23 | Panasonic Corporation | Variable address length compiler and processor improved in address management |
| US6305013B1 (en) | 1998-04-01 | 2001-10-16 | Nec Corporation | Compiling method for generating target program in accordance with target processor type, compiling device, recording medium with compiling program recorded therein and recording medium with conversion table used in compiling recorded therein |
| JP2006525572A (en) * | 2003-05-02 | 2006-11-09 | トランジティブ リミテッド | Improved architecture for generating intermediate representations for program code conversion |
| JP2007249991A (en) * | 2003-05-02 | 2007-09-27 | Transitive Ltd | Improved architecture for generating intermediate representations for program code conversion |
| US7921413B2 (en) | 2003-05-02 | 2011-04-05 | International Business Machines Corporation | Architecture for generating intermediate representations for program code conversion |
| US8104027B2 (en) | 2003-05-02 | 2012-01-24 | International Business Machines Corporation | Architecture for generating intermediate representations for program code conversion |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3246438B2 (en) | Variable target compilation processing method, its processing device, storage medium for its program, and storage medium for conversion table | |
| JPH0414144A (en) | Compilation processing method | |
| JPS6022373B2 (en) | Program conversion mechanism for programmable control equipment | |
| JP2585793B2 (en) | Compiler system | |
| KR0169909B1 (en) | Method for designing assembly code generator for target processor | |
| JP2533938B2 (en) | Vector arithmetic processing method | |
| JP2585790B2 (en) | Compile processing method for multiple code systems | |
| JPH07121379A (en) | Multilingual compiler | |
| JP3044953B2 (en) | Symbol processing method of language processing system | |
| JPH05100866A (en) | Compile/link system | |
| JPS61216085A (en) | Vector processing program producing system | |
| JPH05150960A (en) | Precompiler | |
| JPH01237832A (en) | Program linkage method | |
| JPH0377141A (en) | compilation processing unit | |
| JPH1124939A (en) | Program conversion method | |
| JPH05216683A (en) | Non-language dependent filing procedure automatic generation method | |
| JPH04120629A (en) | Code generating method | |
| JPS63317831A (en) | Program translation processing method | |
| JPH04323730A (en) | Optimizaltion processing system | |
| JPH0488531A (en) | Code optimizing system | |
| JPH05120025A (en) | Inline expansion method of source program | |
| JPS62212735A (en) | Compiling system | |
| JPH035827A (en) | How to compile | |
| JPH07110758A (en) | Compiling/linking system for program | |
| JPS62264333A (en) | Program optimization processing method |