JPS63262726A - Translation processing system for designated program - Google Patents

Translation processing system for designated program

Info

Publication number
JPS63262726A
JPS63262726A JP9789887A JP9789887A JPS63262726A JP S63262726 A JPS63262726 A JP S63262726A JP 9789887 A JP9789887 A JP 9789887A JP 9789887 A JP9789887 A JP 9789887A JP S63262726 A JPS63262726 A JP S63262726A
Authority
JP
Japan
Prior art keywords
program
translation
unit
name
option
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
JP9789887A
Other languages
Japanese (ja)
Inventor
Tomoko Komatsu
小松 智子
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 JP9789887A priority Critical patent/JPS63262726A/en
Publication of JPS63262726A publication Critical patent/JPS63262726A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To shorten the translation time by instructing a translation of a specific program unit in a source program, storing the name information of its unit in option information at the time of translation, and instructing the translation only when its name exists in the option information. CONSTITUTION:An inputted translation time option 1 is analyzed by an analyzing part 10, and in case of an option for instructing a translation of a designated program unit, the number of pieces of registration of a name of its unit, length of the name, and the name are stored in translation time option information 11. In this state, when a sentence which is fetched from a source program 3 is a sentence for defining the name of the program unit when the name of its unit exists in the information 11, the translation of the program unit is instructed in a program sentence structure analyzing part 20. Also, when the name does not exist in the information 11, the translation is not instructed, and by translating the program unit whose translation is instructed by a generating part 30, an object program is generated.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、コンパイラにおける原始プログラムの翻訳処
理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a method for translating a source program in a compiler.

(従来の技#t) 従来、原始プログラムを構成する複数のプログラム単位
の中の1つのプログラム単位を修正した場合に、修正後
の原始プログラムを再翻訳することにより、目的プログ
ラムの修正が行われていた。
(Conventional Technique #t) Conventionally, when one program unit among multiple program units that make up a source program is modified, the target program is modified by re-translating the modified source program. was.

(発明が解決しようとする問題点) このような従来の方式は、修正したプログラム単位はも
とより残りのプログラム単位を含めた原始プログラム内
の全てのプログラム単位を再翻訳しなければならない。
(Problems to be Solved by the Invention) In such a conventional method, all program units in the source program, including not only the modified program units but also the remaining program units, must be retranslated.

従って、再翻訳の必要のない修正されていないプロゲラ
14単位まで翻訳されるので、翻訳に時間がかかるとい
う問題点がある。
Therefore, since up to 14 units of uncorrected progera that do not require retranslation are translated, there is a problem that translation takes time.

(問題点を解決するための手段) 上述の問題点を解決するために本発明が提供する指定プ
ログラム翻訳処理方式は、高級プログラミング言語で記
述跡れた原始プログラムを翻訳して目的プログラムを生
成するコンパイラにおいて、前記原始プログラムを構成
する複数のプログラム単位の中の特定のプログラム単位
の翻訳を指示する翻訳時オプションを入力した場合に、
翻訳すべき前記プログラム単位の名前の情報を翻訳時オ
プション情報に格納する翻訳時オプション解析部と、前
記原始プログラムから取り出した文がプログラム単位の
名前を定義する文であるときは、このプログラム単位の
名前が前記翻訳時オプション情報の中にあるか否かを判
定して、ある場合にはそのプログラム単位を翻訳する指
示をし、ない場合には前記指示を行わないプログラム構
文解析部と、前記プログラム構文解析部により翻訳の指
示をされたプログラム単位を翻訳して目的プログラムを
生成する目的プログラム生成部とを含むことを特徴とす
る。
(Means for Solving the Problems) In order to solve the above-mentioned problems, the specified program translation processing method provided by the present invention generates a target program by translating a source program written in a high-level programming language. When a compiler inputs a compile-time option that instructs the translation of a specific program unit among the multiple program units that make up the source program,
A translation-time option analysis unit stores information on the name of the program unit to be translated in translation-time option information, and when a statement extracted from the source program is a statement that defines the name of a program unit, a program syntax analysis unit that determines whether or not the name is included in the translation option information, and if so, instructs to translate the program unit; if not, does not issue the instruction; and The present invention is characterized in that it includes a target program generation unit that generates a target program by translating a program unit instructed to be translated by the syntax analysis unit.

(実施例) 以下、本発明について図面を参照して説明する。(Example) Hereinafter, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例を適用してなるコンパイラの
処理の流れを示す図であり5.第2図は第1図の翻訳時
オプション情報11の構成図である。
FIG. 1 is a diagram showing the processing flow of a compiler to which an embodiment of the present invention is applied. FIG. 2 is a configuration diagram of the translation option information 11 shown in FIG. 1.

翻訳時オプション解析部10は、入力した翻訳時オプシ
ョン1を解析して、指定プログラム単位の翻訳を指示す
るオプションである場合には、前記プログラム単位の名
前の登録個数110及びプログラム単位の名前の長さ1
20及びプログラム単位の名前130を翻訳時オプショ
ン情報11に格納する。
The translation option analysis unit 10 analyzes the input translation option 1, and if it is an option that instructs translation of a specified program unit, the number of registered program unit names 110 and the length of the program unit name. Sa1
20 and the program unit name 130 are stored in the translation option information 11.

プログラム構文解析部20は、翻訳時オプション情報1
1を参照し、原始プログラム3の中の全プログラム単位
について翻訳すべきプログラム単位か否かを判定する。
The program syntax analysis unit 20 stores option information 1 at the time of translation.
1, it is determined whether all program units in the source program 3 are program units to be translated.

目的プログラム生成部30は、プログラム構文解析部2
0により翻訳すべきであると判定されたプログラム単位
のみを翻訳し、目的プログラム4を生成する。
The target program generation unit 30 includes the program syntax analysis unit 2
Only the program units determined to be translated based on 0 are translated, and the target program 4 is generated.

第3図は第1図のプログラム構文解析部20のブローチ
ヤードである。
FIG. 3 shows the brooch yard of the program syntax analysis unit 20 shown in FIG.

第3図のステップ200で原始プログラム3の文を入力
し、ステップ210でこの文がどのような種類の文かを
判別する。ステップ220は翻訳時オプション1が指定
プログラム単位の翻訳を指示するオプションか否かを調
べ、前記オプションの場合はステップ230へ進み、そ
うでない場合はステップ250へ進む。ステップ230
は、入力した文がプログラム単位の名前を定義している
文か否かを判定し、プログラム単位の名前を定義してい
る文の場合はステップ270へ進み、そうでない場合は
ステップ240へ進む、ステップ270は前記プログラ
ム単位の名前と翻訳時オプション情報11に格納きれた
プログラム単位の名前130とを比較して、等しい場合
はステップ280へ進み、等しくない場合はステップ2
90へ進む。ステップ280は翻訳すべきプログラム単
位であることを示すフラグをONにしてステップ250
へ進み、ステップ290はこのフラグをOFFにしてス
テップ200へ戻る。ステップ240では、入力した文
の属するプログラム単位につい−C1スゲ゛ツブ280
またはステップ290でセットきれたフラグを判定し、
ONである場合はステップ250へ進み、OFFである
場合はステップ200へ戻る。ステップ250は、入力
した文を解析して目的プログラム生成部30でマシン語
に展開するために必要な情報を整理する。ステップ26
0はこの文が最後の文であるか否かを判定する。最後の
文でなければステップ200へ戻り、最後の文であれば
プログラム構文解析処理を終了する。
In step 200 of FIG. 3, a sentence of the source program 3 is input, and in step 210 it is determined what type of sentence this sentence is. Step 220 checks whether option 1 at the time of translation is an option that instructs translation of the specified program unit. If the option is the option, the process proceeds to step 230; otherwise, the process proceeds to step 250. Step 230
determines whether the input statement defines the name of a program unit, and if the statement defines the name of a program unit, the process proceeds to step 270; otherwise, the process proceeds to step 240. Step 270 compares the name of the program unit with the name 130 of the program unit stored in the translation option information 11, and if they are equal, proceed to step 280; if not equal, proceed to step 2.
Proceed to 90. Step 280 turns on a flag indicating that it is a program unit to be translated, and step 250
Step 290 turns this flag off and returns to step 200. In step 240, the program unit to which the input statement belongs is
Or determine the flag that has been set in step 290,
If it is ON, the process advances to step 250; if it is OFF, the process returns to step 200. Step 250 organizes information necessary for analyzing the input sentence and developing it into machine language in the target program generation section 30. Step 26
0 determines whether this sentence is the last sentence. If it is not the last sentence, the process returns to step 200, and if it is the last sentence, the program syntax analysis process ends.

次に本実施例を具体的に説明する。Next, this example will be explained in detail.

第4図は(a)及び(b)はFORTRANi始プログ
ラムの修正前及び修正後のイメージをそれぞれ例示する
図である。この図は、修正前のFORTRAN原始プロ
グラム300のプログラム単位5UB330の中の文3
50を文360のように修正する場合を表している。修
正後のFORTRANfg、始プログラム310を本実
施例によりコンパイルする際には、翻訳時オプション情
報11の中のプログラム単位の名前の登録個数110に
“1”、プログラム単位の名前の長さ120に“3″、
プログラム単位の名前130に” SUB”がそれぞれ
格納される。プログラム構文解析部20は、この翻訳時
オプション情報11に基づいて、プログラム単位5UB
330を構成する文に対してフラグをONにする。目的
プログラム生成部30は前記フラグを判定して、プログ
ラム単位MAIN320及びプログラム単位FUN34
0を翻訳せずにプログラム単位5UB330のみを翻訳
する。
FIGS. 4(a) and 4(b) are diagrams illustrating images of the FORTRANi start program before and after modification, respectively. This figure shows statement 3 in program unit 5UB330 of FORTRAN source program 300 before modification.
50 is modified as in sentence 360. When compiling the modified FORTRAN fg and start program 310 according to this embodiment, the number of program unit name registrations 110 in the translation option information 11 is set to "1", and the length of program unit name 120 is set to "1". 3″,
“SUB” is stored in each program unit name 130. Based on this translation option information 11, the program syntax analysis unit 20 analyzes the program unit 5UB.
Turn on the flag for the sentences that make up 330. The target program generation unit 30 determines the flag and generates the program unit MAIN 320 and the program unit FUN 34.
Translate only program unit 5UB330 without translating 0.

(発明の効果) 以上説明したように本発明は、高級プログラミング言語
で記述された原始プログラムを構成する複数のプログラ
ム単位の中から、翻訳の必要があるプログラム単位を翻
訳時のオプションにより指定することにより、指定され
た前記プログラム単位のみを翻訳できる。そこで、原始
プログラムを修正して目的プログラムを作り直す場合に
は、修正したプログラム単位のみを翻訳して、これをユ
ーザがリンケージすれば良い、従って、前記プログラム
単位以外の残りのプログラム単位を再翻訳する必要がな
いので、翻訳時間が短縮きれるという効果がある。
(Effects of the Invention) As explained above, the present invention provides a method for specifying a program unit that needs to be translated from among a plurality of program units constituting a source program written in a high-level programming language using an option at the time of translation. This allows only the specified program unit to be translated. Therefore, when modifying the source program and re-creating the target program, it is sufficient to translate only the modified program unit and link it by the user.Therefore, the remaining program units other than the above-mentioned program unit need to be re-translated. Since this is not necessary, it has the effect of shortening the translation time.

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

第1図は本発明の一実施例を適用してなるフンバイラの
処理の流れを示す図、第2図は第1図の翻訳時オプショ
ン情報の構成図、第3図は第1図のプログラム構文解析
部のフローチャート、第4図(a)はFORTRAN原
始プログラムの修正前のイメージを例示する図、同図(
b)はFORTRAN原始プログラムの修正後のイメー
ジを例示する図である。 1・・・翻訳時オプション、2・・・コンパイラ、3・
・・原始プログラム、4・・・目的プログラム、10・
・・翻訳時オプション解析部、11・・・翻訳時オプシ
ョン情報、20・・・プログラム構文解析部、30・・
・目的プログラム生成部。
Figure 1 is a diagram showing the processing flow of Funbaira to which an embodiment of the present invention is applied, Figure 2 is a configuration diagram of the translation option information in Figure 1, and Figure 3 is the program syntax of Figure 1. The flowchart of the analysis section, Figure 4 (a) is a diagram illustrating the image of the FORTRAN source program before modification;
b) is a diagram illustrating an image of the FORTRAN source program after modification. 1... Compilation time options, 2... Compiler, 3.
...Original program, 4...Objective program, 10.
... Compilation-time option analysis section, 11... Compilation-time option information, 20... Program syntax analysis section, 30...
- Objective program generation section.

Claims (1)

【特許請求の範囲】 高級プログラミング言語で記述された原始プログラムを
翻訳して目的プログラムを生成するコンパイラにおいて
、 前記原始プログラムを構成する複数のプログラム単位の
中の特定のプログラム単位の翻訳を指示する翻訳時オプ
ションを入力した場合に、翻訳すべき前記プログラム単
位の名前の情報を翻訳時オプション情報に格納する翻訳
時オプション解析部と、 前記原始プログラムから取り出した文がプログラム単位
の名前を定義する文であるときは、このプログラム単位
の名前が前記翻訳時オプション情報の中にあるか否かを
判定して、ある場合にはそのプログラム単位を翻訳する
指示をし、ない場合には前記指示を行わないプログラム
構文解析部と、前記プログラム構文解析部により翻訳の
指示をされたプログラム単位を翻訳して目的プログラム
を生成する目的プログラム生成部とを含むことを特徴と
する指定プログラム翻訳処理方式。
[Claims] In a compiler that generates a target program by translating a source program written in a high-level programming language, a translation that instructs the translation of a specific program unit among a plurality of program units constituting the source program. a translation-time option analysis unit that stores information on the name of the program unit to be translated in the translation-time option information when a time option is input; If so, determine whether or not the name of this program unit is in the translation option information, and if so, instruct to translate that program unit, and if not, do not perform the above-mentioned instruction. A specified program translation processing method comprising: a program syntax analysis section; and a target program generation section that translates a program unit instructed to be translated by the program syntax analysis section and generates a target program.
JP9789887A 1987-04-20 1987-04-20 Translation processing system for designated program Pending JPS63262726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9789887A JPS63262726A (en) 1987-04-20 1987-04-20 Translation processing system for designated program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9789887A JPS63262726A (en) 1987-04-20 1987-04-20 Translation processing system for designated program

Publications (1)

Publication Number Publication Date
JPS63262726A true JPS63262726A (en) 1988-10-31

Family

ID=14204561

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9789887A Pending JPS63262726A (en) 1987-04-20 1987-04-20 Translation processing system for designated program

Country Status (1)

Country Link
JP (1) JPS63262726A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02191038A (en) * 1989-01-20 1990-07-26 Nec Corp Compiler input data editing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02191038A (en) * 1989-01-20 1990-07-26 Nec Corp Compiler input data editing system

Similar Documents

Publication Publication Date Title
JPH03129469A (en) Natural language processor
JPS63262726A (en) Translation processing system for designated program
JPH10187461A (en) Language processing system
JPS5922140A (en) Interactive compiling system
JP3031767B2 (en) Natural language processor
JP3596570B2 (en) Method of allocating classes to main storage
JPH03144832A (en) Symbolic debugging device for precompiler language program
JPH11195011A (en) Language translation processor, language translation processing method and record medium recording language translation processing program
JPH0385639A (en) Program language translator
JPH05224918A (en) Self-change code realizing system
JP2607975B2 (en) Debug method
JPH0612259A (en) Compiler processing system
JPH03150664A (en) Syntax analysis device
JPH0561687A (en) Processing system for compiler
JPS63201726A (en) Reference procedure name decision processing system
JPH09319591A (en) Parallelizing system for loop having conditional jump out of loop
JPH06242958A (en) Compilation system
JPH02245934A (en) Data processor
JP2004246924A (en) Application generator development support device and application generator development support method
JPS62166432A (en) Control system for program translation
JPH03144830A (en) Parallel processing system
JPH06119203A (en) Debugging line deleting device
JPH02253443A (en) Program generating method
JPH0251737A (en) Display system for symbol defining line of assembler program
JPH01211120A (en) Syntax analyzing processing method