JPH0359726A - Program unit batch translation system - Google Patents

Program unit batch translation system

Info

Publication number
JPH0359726A
JPH0359726A JP19716389A JP19716389A JPH0359726A JP H0359726 A JPH0359726 A JP H0359726A JP 19716389 A JP19716389 A JP 19716389A JP 19716389 A JP19716389 A JP 19716389A JP H0359726 A JPH0359726 A JP H0359726A
Authority
JP
Japan
Prior art keywords
program unit
program
name
unit
name storage
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
JP19716389A
Other languages
Japanese (ja)
Inventor
Haruhiro Yamamoto
晴弘 山本
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 JP19716389A priority Critical patent/JPH0359726A/en
Publication of JPH0359726A publication Critical patent/JPH0359726A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To obtain all necessary compile units by forming a load module to be executed at the time of translating a source program in the member concerned under a condition that the program units of the source program are the members of the same library as their program unit names. CONSTITUTION:A main program name storing means 12 stores a main program name specified by an option in a program unit name sting area. A program unit translating means 13 extracts a program unit name from a program unit name storing area 15, and if the program unit concerned is included in the members of the library concerned when the program unit concerned is not translated yet, the program unit is translated. A program unit name storing means 14 stores the program unit name of the program unit referred by the program unit to be translated in a program unit name storing means 15. Conse quently, the lack of the compile unit can be removed.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は1手続き呼出しを含む原始プログラム金コンパ
イルする方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for compiling a source program containing one procedure call.

(従来の技術) 原始プログラムのプログラム単位が、そのプログラム単
位名で同じライブラリのメンバとなっている条件のもと
で、そのメンバ中の原始プログラムを翻訳するには、当
該メンバをいちいち指定する必要があった。
(Prior art) Under the condition that program units of a source program are members of the same library by their program unit name, in order to translate the source program in the member, it is necessary to specify the member each time. was there.

(発明が解決しようとする課題) 上述した従来の方式では、コンパイル時にこれらのメン
バをすべて漏れなく指定しないと。
(Problem to be Solved by the Invention) In the conventional method described above, all of these members must be specified at the time of compilation.

コンパイラにより生成されたコンパイルユニット金リン
クして実行可能なロードモジュール全作成するとき、必
要なコンパイルユニットが欠落しているためにエラーが
発生するという欠点がある。
When creating all executable load modules by linking the compilation units generated by the compiler, there is a drawback that an error occurs because a necessary compilation unit is missing.

本発明の目的は、オプションで指定した主プログラム名
全プログラム単位名格納領域に格納してかき、プログラ
ム単位名格納領域からプログラム単位名を取出し、その
プログラム単位が未だ翻訳されていす、かつ、そのプロ
グラム単位名が当該ライブラリのメンバ中に存在するな
らば、プログラム単位を翻訳し、翻訳するプログラム単
位により参照されるプログラム単位のプログラム単位名
をプログラム単位名格納領域に格納することにより上記
欠点金除去し、コンパイルユニットの欠落がないように
構成したプログラム単位一括翻訳方式を提供することK
ある。
An object of the present invention is to store the main program name specified in an option in the entire program unit name storage area, retrieve the program unit name from the program unit name storage area, and check if the program unit has not been translated yet. If the program unit name exists in a member of the library, the above drawback is eliminated by translating the program unit and storing the program unit name of the program unit referenced by the translated program unit in the program unit name storage area. and provide a program unit batch translation method configured so that no compilation units are missing.
be.

(課題全解決するための手段) 本発明によるプログラム単位一括翻訳方式は、原始プロ
グラムのプログラム単位が当該プログラム単位名で同じ
ライブラリのメンバとなっている条件のもとで、そのメ
ンバ中の原始プログラムを翻訳するコンパイラにおける
ものであって、主プログラム名格納手段と、プログラム
単位翻訳手段と、プログラム単位名格納手段とを具備し
て構成したものである。
(Means for Solving All Problems) The program unit batch translation method according to the present invention is applicable to the program unit translation method of the present invention, under the condition that the program units of the source program are members of the same library with the program unit name, the source program in the member is This compiler is configured to include a main program name storage means, a program unit translation means, and a program unit name storage means.

主プログラム名格納手段は、オプションで指定した主プ
ログラム名をプログラム単位名格納領域に格納するため
のものである。
The main program name storage means is for storing the main program name specified as an option in the program unit name storage area.

プログラム単位翻訳手段は、プログラム単位名格納領域
からプログラム単位名分取出し、酒該プログラム単位が
未だ翻訳されていないときに、当該プログラム単位名が
当該ライブラリのメンバ中に存在するならば、プログラ
ム単位を翻訳するためのものである。
The program unit translation means extracts the program unit name from the program unit name storage area, and if the program unit name exists in the member of the library when the program unit has not been translated yet, the program unit translation means extracts the program unit name from the program unit name storage area. It is for translation.

プログラム単位名格納手段は、翻訳するプログラム単位
で参照されるプログラム単位のプログラム単位名金プロ
グラム単位名格納領域に格納するためのものである。
The program unit name storage means is for storing in the program unit name storage area the program unit name of the program unit referenced by the program unit to be translated.

(実 施例) 次に1本発明について図面を参照して説明する。(Example) Next, one embodiment of the present invention will be explained with reference to the drawings.

第1図は1本発明によるプログラム単位一括翻訳方式の
一実施例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a program unit batch translation method according to the present invention.

第1図にかいて、11はごンパイラ、12は主プログラ
ム名格納手段、13はプログラム単位翻訳手段、14は
プログラム単位名格納手段。
In FIG. 1, 11 is a compiler, 12 is a main program name storage means, 13 is a program unit translation means, and 14 is a program unit name storage means.

15はプログラム単位名格納領域である。15 is a program unit name storage area.

第2図は、本発明による処理例の流れ金示すフローチャ
ートである。第2図にかいて、21〜29はそれぞれ処
理ステップである。
FIG. 2 is a flowchart illustrating an example of processing according to the present invention. In FIG. 2, 21 to 29 are processing steps, respectively.

第3図は、本発明における主プログラム、手続き名格納
領域、ライブラリ、pよび手続きの実例を示す説明図で
ある。第3図にかいて、31は主プログラム、32は手
続き名格納領域、33は探索済みであることを示すフラ
グ、34はライブラリ、35は手続きである。
FIG. 3 is an explanatory diagram showing an example of the main program, procedure name storage area, library, p, and procedure in the present invention. In FIG. 3, 31 is a main program, 32 is a procedure name storage area, 33 is a flag indicating that the search has been completed, 34 is a library, and 35 is a procedure.

第1図にかいて、本発明はコンパイラ11の内部に主プ
ログラム名格納手段12と、プログラム単位翻訳手段1
3と、プログラム単位名格納手段工4と、プログラム単
位名格納領域15と會備えて構成されている。第3図に
かいて、本発8Aを説明するための一実施例として王プ
ロダラム(A) 31の中に手続きCB)、 (E)の
呼出しを含み1手続きCB)の中に手続きtc>−(D
)の呼出しを含む場合を考える。
In FIG. 1, the present invention includes a main program name storage means 12 and a program unit translation means 1 inside a compiler 11.
3, a program unit name storage means 4, and a program unit name storage area 15. In FIG. 3, as an example for explaining the present invention 8A, the king program (A) 31 includes calls to procedures CB) and (E), and one procedure CB) includes a procedure tc>-. (D
).

次に1本実施例の動作を第1図、第2図、)よび第3図
を参照して説明する。
Next, the operation of this embodiment will be explained with reference to FIGS. 1, 2, and 3.

利用者は主プログラムA31のプログラム単位名′に翻
訳時にオプションで指定スる。
The user specifies the program unit name of the main program A31 as an option at the time of translation.

王プログラム名格納手段12は、ステップ21にかいて
、指定されている主プログラム名をプログラム単位名格
納領域32に格納する。
The main program name storage means 12 stores the specified main program name in the program unit name storage area 32 in step 21 .

プログラム単位翻訳手段13は、ステップ22にかいて
、プログラム単位名格納領域12に未探索のプログラム
単位名が存在するか否かを判定する。この場合には、主
プログラム名人が存在するので、ステップ23によりプ
ログラム単位翻訳手段13はプログラム単位名人が探索
済みであることを示すフラグ33をセットし。
In step 22, the program unit translation means 13 determines whether or not an unsearched program unit name exists in the program unit name storage area 12. In this case, since the main program master exists, the program unit translation means 13 sets a flag 33 in step 23 indicating that the program unit master has been searched.

ステップ24によりプログラム単位名人′に取出す。さ
らに、ステップ25により、上記と同名のプログラム単
位名が主プログラムへの存在するライブラリ340メン
バ中に存在するか否か’t’lJ定する。Aはメンバ中
に存在するので酒該メンバを入力し、ステップ27によ
りプログラム単位から一文づつ取出して翻訳する。−文
を翻訳した後、ステップ28にかいて、その文の中で手
続き呼出しが存在するか否かを判定する。
In step 24, the program unit master' is extracted. Further, in step 25, it is determined whether a program unit name with the same name as above exists in the existing library 340 member to the main program. Since A exists in the members, the member A is input, and in step 27, each sentence is extracted from the program unit and translated. - After translating the sentence, step 28 determines whether there is a procedure call in the sentence.

手続き呼出しが存在するならば、プログラム単位名格納
手段14t−呼出す。
If a procedure call exists, the program unit name storage means 14t-calls.

プログラム単位名格納手段14ば、その手続き名がプロ
グラム単位名格納領域15に格納されていないならば、
ステップ29にpいて、こレヲプログラム単位名格納領
域12に格納する。
If the program unit name storage means 14 does not store the procedure name in the program unit name storage area 15,
At step 29, this file is stored in the program unit name storage area 12.

ステップ26からステップ29までの作業を最終の文の
翻訳が終了するまで繰返せば1手続き名格納領域32に
プログラム単位名A、B、Bが格納される。
If the operations from step 26 to step 29 are repeated until the translation of the final sentence is completed, program unit names A, B, and B are stored in the 1 procedure name storage area 32.

王プログラムAllの最終の文の翻訳が終了すると、ス
テップ22へ戻9.手続き名格納領域32の未探索のプ
ログラム単位名Bに対して。
When the translation of the last sentence of the king program All is completed, return to step 229. For the unsearched program unit name B in the procedure name storage area 32.

上述のステップ23からステップ29!でと同様の作業
を繰返す。手続き名格納領域32に対する上記作業は、
未探索のプログラム単位がなくなる!で繰返される。
Steps 23 to 29 above! Repeat the same steps. The above operations for the procedure name storage area 32 are as follows:
No more unexplored program units! is repeated.

その結果1手続き名格納領域32にはプログラム単位A
、B、B、O,I)が格納され、この順番で一括して翻
訳が行われる。
As a result, program unit A is stored in the 1 procedure name storage area 32.
, B, B, O, I) are stored, and translation is performed all at once in this order.

(発明の効果) 以上で説明してきたように本発明は、原始プログラムの
プログラム単位がそのプログラム単位名で同じライブラ
リのメンバとなっている条件のもとで、当該メンバ中の
原始プログラムを翻訳するときに実行9能なロードモジ
ュールを作成することにより、リンク時に必要となるコ
ンパイルユニットをすべて漏れなく得ることかり能とな
ると云う効果がある。
(Effects of the Invention) As explained above, the present invention is capable of translating the source program in the member under the condition that the program unit of the source program is a member of the same library with its program unit name. Sometimes, creating an executable load module has the effect of making it possible to obtain all the compile units required during linking without exception.

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

第1図は1本発明によるプログラム単位一括翻訳方式の
一実施例を示すブロック図である。 第2図は1本発明による処理例の流ftt”示すフロー
チャートである。 第3図は1本発明における主プログラム、手続き名格納
領域、ライブラリ、釦よび手続きの実例を示す説明図で
ある。 11・・・コンパイラ 12・・・王プログラム名格納手段 13・・・プログラム単位翻訳手段 14・・・プログラム単位名格納手段 15・・・プログラム単位名格納領域 21〜29・・・処理ステップ 31・・・王プログラム 32・・・手続き名格納領域 33・・・フラグ 34・・・ライブラリ 35・・・手続き
FIG. 1 is a block diagram showing an embodiment of a program unit batch translation method according to the present invention. FIG. 2 is a flowchart showing an example of processing according to the present invention. FIG. 3 is an explanatory diagram showing an example of the main program, procedure name storage area, library, button, and procedure according to the present invention. 11 ... Compiler 12 ... King program name storage means 13 ... Program unit translation means 14 ... Program unit name storage means 15 ... Program unit name storage areas 21 to 29 ... Processing step 31 ...・King program 32...Procedure name storage area 33...Flag 34...Library 35...Procedure

Claims (1)

【特許請求の範囲】[Claims] 原始プログラムのプログラム単位が当該プログラム単位
名で同じライブラリのメンバとなつている条件のもとで
、当該メンバ中の原始プログラムを翻訳するコンパイラ
におけるプログラム単位一括翻訳方式であつて、オプシ
ョンで指定した主プログラム名をプログラム単位名格納
領域に格納するための主プログラム名格納手段と、前記
プログラム単位名格納領域から前記プログラム単位名を
取出し、前記プログラム単位が未だ翻訳されていないと
きに当該プログラム単位名が当該ライブラリのメンバ中
に存在するならば、前記プログラム単位を翻訳するため
のプログラム単位翻訳手段と、前記翻訳するプログラム
単位により参照されるプログラム単位のプログラム単位
名を前記プログラム単位名格納領域に格納するためのプ
ログラム単位名格納手段とを具備して構成したことを特
徴とするプログラム単位一括翻訳方式。
A program unit batch translation method used by a compiler that translates the source program in the source program under the condition that the program unit of the source program is a member of the same library with the program unit name. a main program name storage means for storing a program name in a program unit name storage area; and a main program name storage means for retrieving the program unit name from the program unit name storage area; If it exists in the member of the library, a program unit translation means for translating the program unit and the program unit name of the program unit referenced by the program unit to be translated are stored in the program unit name storage area. 1. A program unit batch translation method comprising: program unit name storage means for storing program unit names.
JP19716389A 1989-07-28 1989-07-28 Program unit batch translation system Pending JPH0359726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19716389A JPH0359726A (en) 1989-07-28 1989-07-28 Program unit batch translation system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19716389A JPH0359726A (en) 1989-07-28 1989-07-28 Program unit batch translation system

Publications (1)

Publication Number Publication Date
JPH0359726A true JPH0359726A (en) 1991-03-14

Family

ID=16369827

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19716389A Pending JPH0359726A (en) 1989-07-28 1989-07-28 Program unit batch translation system

Country Status (1)

Country Link
JP (1) JPH0359726A (en)

Similar Documents

Publication Publication Date Title
US5404531A (en) Method and apparatus for compiler processing on program related to data transfer and calculation, and method of managing memory
JPH0359726A (en) Program unit batch translation system
GB2420638A (en) Method of substituting code fragments in Internal Representation
JPH11154093A (en) Program compiler and storage medium recording compiler program
JP2811804B2 (en) Variable output range specification method
JPH0695890A (en) Name replacement system in compiler
JPH10214194A (en) Class definition fetching system
JPH07244601A (en) Method and device for accessing relational data base
JPS6326730A (en) Program correction system
JPS63138426A (en) Program production system
JPH04373020A (en) Function correspondence table preparing device
JPH103390A (en) Table managing system and preparing method for the same
JPH0690669B2 (en) Character string manipulation instruction compilation processing method
JPH0250731A (en) Compiling device
JPS63178345A (en) Data base access processing system
JPS62200426A (en) Macro expansion method for high level language
JPH01239648A (en) Dynamic subroutine call system
JPH02271430A (en) Program executing device
JPH04364537A (en) Method, device, and compiler for optimizing program for parallel process
JPH0468436A (en) Automatic compile and link device
JPH05274126A (en) Program synthesization system
JPH0328931A (en) User language controller
JPS63317826A (en) Symbolic debugging system
JPH0651995A (en) Recognizing method for execution subroutine name
JPH0228839A (en) Load module generating system for routine single test processing system