JPH03144829A - Variable target compiler system - Google Patents

Variable target compiler system

Info

Publication number
JPH03144829A
JPH03144829A JP28396389A JP28396389A JPH03144829A JP H03144829 A JPH03144829 A JP H03144829A JP 28396389 A JP28396389 A JP 28396389A JP 28396389 A JP28396389 A JP 28396389A JP H03144829 A JPH03144829 A JP H03144829A
Authority
JP
Japan
Prior art keywords
target
computer architecture
compiler
computer
source program
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
JP28396389A
Other languages
Japanese (ja)
Inventor
Hiroshi Oyama
大山 博
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 JP28396389A priority Critical patent/JPH03144829A/en
Publication of JPH03144829A publication Critical patent/JPH03144829A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To obtain various object programs which use the computer architecture designated by a single type of compiler as a target by designating via a user the type of the target computer architecture at the translation of a source program. CONSTITUTION:A user of a compiler 11 designates the type of a target computer architecture, and the compiler 11 recognizes the target designated by the user via a target designation recognizing means 14. Then a syntactic analyzing means 12 translates a source program 17 into an intermediate language 16 dependent on no computer architecture. A code generating means 13 refers to the detailed information on the target computer architecture recognized by the means 14 via a target dependent information holding means 15 and converts a machine instruction into an object program 18. Thus it is possible to obtain plural types of object programs which define the plural types of computer architectures as targets via a single type of compiler.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、高級プログラム言語で記述されたソースプロ
グラムを、複数の種類の計算機アーキテクチャをターゲ
ットとした複数の種類のオブジェクトプログラムに変換
する可変ターゲットコンパイラ方式に関する。
Detailed Description of the Invention (Field of Industrial Application) The present invention is a variable target program that converts a source program written in a high-level programming language into multiple types of object programs targeting multiple types of computer architectures. Regarding compiler methods.

(従来の技術) 従来、第3図に示すようにディジタル計算機用のコンパ
イラ31としては、高級プログラミング言語で記述され
たソースプログラム35を翻訳し中間言語34を生成す
る構文解析手段32と、中間言語34が入力され特定の
計算機アーキテクチャ37をターゲットとして固定した
機械命令をオブジェクトプログラム36に変換するコー
ド生成手段″33とを有したものがある。そして、この
コンパイラ31を使用して、高級プログラミング言語で
記述したソースプログラム35を、構文解析手段32に
より翻訳して中間言語34を生成した後に、コード生成
手段33により特定の一種類の計算機アーキテクチャ3
7をターゲットとしたオブジェクトプログラム36を出
力する。
(Prior Art) Conventionally, as shown in FIG. 3, a compiler 31 for a digital computer includes a syntax analysis means 32 that translates a source program 35 written in a high-level programming language and generates an intermediate language 34, and a syntax analysis means 32 that generates an intermediate language 34. 34 is input and fixed machine instructions targeted at a specific computer architecture 37 are converted into an object program 36.The compiler 31 is used to generate code in a high-level programming language. After the written source program 35 is translated by the syntax analysis means 32 to generate an intermediate language 34, the code generation means 33 converts it into a specific type of computer architecture 3.
An object program 36 targeting 7 is output.

(発明が解決しようとする課題) しかしながら、上述した従来のコンパイラ31では、タ
ーゲットとする計算機アーキテクチャ37を特定した一
種類に固定し、コード生成手段33において特定の一種
類の計算機アーキテクチャの機械命令のみを生成するよ
うに設計されており、一種類の単体のコンパイラだけで
は種類のことなる計算機アーキテクチャをターゲットと
したオブジェクトプログラムを出力することはできなか
った。したがって、利用者は、同一のソースプログラム
からターゲットの異なる複数の種類のオブジェクトプロ
グラムを得たい場合には、それぞれ異なるターゲットに
対応して別個に設計した複数あ種類のコンパイラを用意
する必要があった。
(Problem to be Solved by the Invention) However, in the conventional compiler 31 described above, the target computer architecture 37 is fixed to one specific type, and the code generation means 33 only generates machine instructions for one specific type of computer architecture. It was designed to generate object programs targeted at different types of computer architectures, and it was not possible to output object programs targeting different types of computer architectures using just one type of standalone compiler. Therefore, if a user wanted to obtain multiple types of object programs with different targets from the same source program, it was necessary to prepare multiple types of compilers that were designed separately for each different target. .

従来においては上述のように、解決すべき課題があった
Conventionally, as mentioned above, there have been problems to be solved.

本発明は、一種類のコンパイラにより複数の種類の計算
機アーキテクチャをターゲットとした複数の種類のオブ
ジェクトプログラムを得ることができる可変ターゲット
コンパイラ方式を提供することを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide a variable target compiler system that can obtain a plurality of types of object programs targeting a plurality of types of computer architectures using a single type of compiler.

(課題を解決するための手段) 上記課題は、高級プログラム言語で記述されたソースプ
ログラムを、複数の種類の計算機アーキテクチャをター
ゲットとした複数の種類のオブジェクトプログラムに変
換する可変ターゲットコンパイラ方式において、前記複
数の種類の計算機アーキテクチャに関する詳細情報を保
持するターゲット依存情報保持手段と、利用者がターゲ
ットとして指定した計算機アーキテクチャの種類を認識
するターゲット指定認識手段と、前記ソースプログラム
を前記複数の計1.機アーキテクチャのいずれにも依存
しない中間言語に翻訳する横文解析手段と、前記中間言
語が入力され前記ターゲット指定認識手段により認識さ
れた特定の計3EIlアーキテクチャをターゲットとし
てかつ前記ターゲット依存情報保持手段の詳細情報を参
照して入力された前記中間言語を前記オブジェクトプロ
グラムに変換するコード生成手段とを備えることにより
解決できる。
(Means for Solving the Problem) The above problem is achieved by using the variable target compiler method that converts a source program written in a high-level programming language into multiple types of object programs targeting multiple types of computer architectures. a target dependent information holding means for holding detailed information regarding a plurality of types of computer architecture; a target specification recognition means for recognizing the type of computer architecture specified as a target by a user; a transverse sentence analysis means for translating into an intermediate language that does not depend on any of the machine architectures; and a target dependence information holding means that targets a total of three specific architectures into which the intermediate language is input and recognized by the target designation recognition means. This problem can be solved by providing a code generation means for converting the input intermediate language into the object program by referring to detailed information.

(作用) 本発明では、利用者がターゲットとすべき計算機アーキ
テクチャの種類を入力し、ターゲット指定認識手段によ
り当該計算機アーキテクチャの種類が認識される。また
、ターゲット依存情報保持手段には、予め複数の種類の
計算機アーキテクチャに関する詳細情報が保持されてい
る。そして、横文解析手段によりソースプログラムを複
数の計算機アーキテクチャのいずれにも依存しない中間
言語に翻訳し、当該中間言市はコード生成手段に入力さ
れ、コード生成手段によりターゲット指定認識された特
定の計算機アーキテクチャをターゲットとしてかつター
ゲット依存情報保持手段の詳=−m報を参照して前記中
間言語をオブジェクトプログラムに変換する。
(Operation) In the present invention, the user inputs the type of computer architecture to be targeted, and the target designation recognition means recognizes the type of computer architecture. Further, detailed information regarding a plurality of types of computer architectures is held in advance in the target dependent information holding means. Then, the source program is translated into an intermediate language that does not depend on any of the plurality of computer architectures by the transverse text analysis means, and the intermediate language is input to the code generation means, and the code generation means specifies the target computer. The intermediate language is converted into an object program using the architecture as a target and referring to the detailed information of the target dependent information holding means.

このように本発明によれば、利用者がターゲットする計
算機アーキテクチャの種類を指定すれば、コンパイラか
ら指定した計算機アーキテクチャに適合した種々のオブ
ジェクトプログラムを、1つのコンパイラから得ること
ができる。したがって種類の異なる計算機アーキテクチ
ャに対応してそれぞれ別個のコンパイラを設計する必要
がなくなるという利点がある。
As described above, according to the present invention, if the user specifies the type of computer architecture to be targeted, various object programs suitable for the specified computer architecture can be obtained from a single compiler. Therefore, there is an advantage that there is no need to design separate compilers for different types of computer architectures.

(実施例) 以下に図面を参照して本発明の一実施例について説明す
る。
(Example) An example of the present invention will be described below with reference to the drawings.

第1図に示すように、本実施例の可変ターゲットコンパ
イラ方式は、コンパイラ11と、ソースプログラム17
と、オブジェクトプログラム18とからなる。
As shown in FIG. 1, the variable target compiler system of this embodiment includes a compiler 11 and a source program 17.
and an object program 18.

コンパイラ11は、構文解析手段12と、コード生成手
段13と、ターゲット指定認識手段14と、ターゲット
依存情報保持手段15と、中間言話16とを含んで構成
される。
The compiler 11 includes a syntax analysis means 12 , a code generation means 13 , a target specification recognition means 14 , a target dependence information holding means 15 , and an intermediate language 16 .

ソースプログラム17は、高級プログラミング言語で記
述されたプログラムである。
The source program 17 is a program written in a high-level programming language.

構文解析手V112は、ソースプログラム17を翻訳し
、任意の計算機アーキテクチャのいずれにも依存しない
独立した中間言語16を生成する2タ一ゲツト指定認識
手段14は、コンパイラ11の利用者がターゲットとし
て指定した計3!機アーキテクチャの種類を認識する。
The syntax analyzer V112 translates the source program 17 and generates an independent intermediate language 16 that does not depend on any computer architecture.The target designation recognition means 14 translates the source program 17 and generates an independent intermediate language 16 that does not depend on any computer architecture. A total of 3! Recognize machine architecture types.

ターゲット依存情報保持手段15は、複数の計算機アー
キテクチャに・関する詳4Iil情報を保持する。
The target dependent information holding means 15 holds detailed information regarding a plurality of computer architectures.

ここで詳細情報の具体的内容としては、計算機の機械命
令セット、レジスタの種類や個数、データ形式、アドレ
ッシング体系などのハードウェア構成や実行特性等を含
む。
Here, the specific contents of the detailed information include the machine instruction set of the computer, the type and number of registers, the data format, the hardware configuration such as the addressing system, and the execution characteristics.

コード生成手段13には、中間言語16が入力され、コ
ード生成手Pi13はターゲット指定認識手段14によ
り認識された計算機アーキテクチャをターゲットとして
、機械命令をターゲット依存情報保持手段15の詳細情
報を参照しながらオブジェクト10グラム18に変換す
る。
The intermediate language 16 is input to the code generation means 13, and the code generation means Pi13 generates machine instructions with the computer architecture recognized by the target designation recognition means 14 as a target while referring to the detailed information in the target dependence information holding means 15. Convert to object 10 grams 18.

次に本実施例の全体的な動作を説明する。ソースプログ
ラム17をコンパイルする時には、コンパイラ11の利
用者はターゲットとする計算機アーキテクチャの種類を
指定する。コンパイラ11はターゲラ1へ指定認識手段
14により、利用者が指定したターゲットを認識する。
Next, the overall operation of this embodiment will be explained. When compiling the source program 17, the user of the compiler 11 specifies the type of target computer architecture. The compiler 11 uses the targeter 1 specification recognition means 14 to recognize the target specified by the user.

そして構文解析手段12により、ソースプログラムをい
かなる計算機アーキテクチャにも依存しない中間言語1
6に翻訳する。コード生成手段13は、ターゲット指定
認識手段′14が認識したターゲットの計算機アーキテ
クチャに関する詳細情報をターゲラI・依存情報保持生
膜15より参照して、機械命令をオブジェクトプログラ
ム18に変換する。
Then, the syntax analysis means 12 converts the source program into an intermediate language 1 that does not depend on any computer architecture.
Translate to 6. The code generation means 13 converts the machine instructions into the object program 18 by referring to the detailed information regarding the computer architecture of the target recognized by the target designation recognition means '14 from the targeter I/dependence information holding membrane 15.

第2図に本発明の具体的な使用例を示す、第2図におい
て、計算機アーキテクチャAB、Cは、たとえば日本電
気(株)のV70プロセッサや、モトローラ社のMC6
8020や、インテル社の80386等を示す、オブジ
ェクトプログラム18a、18b、18cは計算機アー
キテクチャA、B、Cをそれぞれターゲットとしたもの
である。本実施例によれば、1つのコンパイラ11によ
ってソースプログラム17から、計算アーキテクチャA
、B、Cをオブジェクトとしたオブジェクト10グラム
18a、18b、18cを得ることができる。
FIG. 2 shows a specific usage example of the present invention. In FIG. 2, computer architectures AB and C are, for example, NEC's V70 processor, Motorola's MC6
Object programs 18a, 18b, and 18c, such as 8020 and Intel 80386, are targeted at computer architectures A, B, and C, respectively. According to this embodiment, one compiler 11 converts the calculation architecture A from the source program 17.
, B, and C can be obtained as object 10-grams 18a, 18b, and 18c.

(発明の効果) 以上に説明したように、本発明の可変ターゲットコンパ
イラ方式によれば、ソースプログラムの翻訳時にターゲ
ットとする計算機アーキテクチャの種類を、利用者が指
定することにより、一種類のコンパイラによって指定し
た計算機アーキテクチャをターゲットとする種々のオブ
ジェクトプログラムを得ることができる。したがって、
本発明によれば、利用者が種類の異なる計算機アーキテ
クチャに対応してそれぞれ別個に設計した複数のコンパ
イラを用意しなくても済むという利点がある。
(Effects of the Invention) As explained above, according to the variable target compiler system of the present invention, the user can specify the type of computer architecture targeted at the time of compiling a source program, and the compiler Various object programs targeting a specified computer architecture can be obtained. therefore,
According to the present invention, there is an advantage that the user does not have to prepare a plurality of compilers designed separately for different types of computer architectures.

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

第1図は本発明の一実施例の可変ターゲットコンパイラ
方式の全体構成を示すブロック図、第2図は本発明の具
体的な使用例を示すブロック図、第3図は従来のコンパ
イラ方式を示すブロック図である。 11・・・コンパイラ、12・・・構文解析手段、13
・・・コード生成手段、14・・・ターゲット指定認識
手段、15・・・ターゲット依存情報保持手段、16・
・・中間言語、17・・・ソースプログラム、18・・
・オブジェクトプログラム、A・・・計算機アーキテク
チャ、B・・・計算機アーキテクチャ、C・・・計算機
アーキテクチャ、18a・・・計算アーキテクチャAを
ターゲットとするオブジェクトプログラム、18b・・
・計算機アーキテクチャBをターゲットとするオブジェ
ク1−プログラム、18c・・・計算機アーキテクチャ
Cをターゲットとするオブジェクトプログラム。
Fig. 1 is a block diagram showing the overall configuration of a variable target compiler system according to an embodiment of the present invention, Fig. 2 is a block diagram showing a specific usage example of the present invention, and Fig. 3 shows a conventional compiler system. It is a block diagram. 11...Compiler, 12...Syntax analysis means, 13
... code generation means, 14 ... target specification recognition means, 15 ... target dependence information holding means, 16.
...Intermediate language, 17...Source program, 18...
- Object program, A... Computer architecture, B... Computer architecture, C... Computer architecture, 18a... Object program targeting computing architecture A, 18b...
- Object 1-program targeting computer architecture B, 18c...Object program targeting computer architecture C.

Claims (1)

【特許請求の範囲】[Claims] 高級プログラム言語で記述されたソースプログラムを、
複数の種類の計算機アーキテクチャをターゲットとした
複数の種類のオブジェクトプログラムに変換する可変タ
ーゲットコンパイラ方式において、前記複数の種類の計
算機アーキテクチャに関する詳細情報を保持するターゲ
ット依存情報保持手段と、利用者がターゲットとして指
定した計算機アーキテクチャの種類を認識するターゲッ
ト指定認識手段と、前記ソースプログラムを前記複数の
計算機アーキテクチャのいずれにも依存しない中間言語
に翻訳する構文解析手段と、前記中間言語が入力され前
記ターゲット指定認識手段により認識された特定の計算
機アーキテクチャをターゲットとしてかつ前記ターゲッ
ト依存情報保持手段の詳細情報を参照して入力された前
記中間言語を前記オブジェクトプログラムに変換するコ
ード生成手段とを備えることを特徴とする可変ターゲッ
トコンパイラ方式。
A source program written in a high-level programming language,
In a variable target compiler method for converting multiple types of object programs targeting multiple types of computer architectures, a target dependence information holding means that holds detailed information regarding the multiple types of computer architectures; target specification recognition means for recognizing the type of specified computer architecture; syntax analysis means for translating the source program into an intermediate language that does not depend on any of the plurality of computer architectures; and code generation means for converting the input intermediate language into the object program with a specific computer architecture recognized by the means as a target and with reference to detailed information of the target dependent information holding means. Variable target compiler method.
JP28396389A 1989-10-31 1989-10-31 Variable target compiler system Pending JPH03144829A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28396389A JPH03144829A (en) 1989-10-31 1989-10-31 Variable target compiler system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28396389A JPH03144829A (en) 1989-10-31 1989-10-31 Variable target compiler system

Publications (1)

Publication Number Publication Date
JPH03144829A true JPH03144829A (en) 1991-06-20

Family

ID=17672494

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28396389A Pending JPH03144829A (en) 1989-10-31 1989-10-31 Variable target compiler system

Country Status (1)

Country Link
JP (1) JPH03144829A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0778085A (en) * 1993-06-21 1995-03-20 Nec Corp Program translating process system
US5896521A (en) * 1996-03-15 1999-04-20 Mitsubishi Denki Kabushiki Kaisha Processor synthesis system and processor synthesis method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0778085A (en) * 1993-06-21 1995-03-20 Nec Corp Program translating process system
US5896521A (en) * 1996-03-15 1999-04-20 Mitsubishi Denki Kabushiki Kaisha Processor synthesis system and processor synthesis method

Similar Documents

Publication Publication Date Title
US6253371B1 (en) Method for supporting parallelization of source program
US7823139B2 (en) Method and system for translating programming languages
JPH08202545A (en) Object-oriented system and method for generation of target language code
JP2006243839A (en) Instruction generation device and instruction generation method
JPH03144829A (en) Variable target compiler system
KR0169909B1 (en) Method for designing assembly code generator for target processor
JP2638278B2 (en) Compile processing method
JPH0573332A (en) Parallel translation system for source program
JPH0795275B2 (en) Compile processor
JP2865694B2 (en) Compilation method
KR0169908B1 (en) Back-end of compiler using intermediate codes and tis method for generating assembly codes
JPH06282443A (en) Method and device for editing program
JPH03144832A (en) Symbolic debugging device for precompiler language program
JPS63187364A (en) Index variable vectorized compiling system
KR20180098213A (en) Apparatus and method for intermediate language transformation of binary data
JPH03144830A (en) Parallel processing system
JPH06242958A (en) Compilation system
JPH0950429A (en) Pointer vectorization system in compiler
JPH035827A (en) Compiling method
JP2001154854A (en) C++ compile device
JPH0373026A (en) Compile system
JPH0561687A (en) Processing system for compiler
JP2006048236A (en) Idl compilation system, idl compilation method and idl compiler
KR20180057317A (en) Apparatus and method for intermediate language transformation of binary data
JPH01166133A (en) Compile processing system