JPS62235643A - Program language translator - Google Patents

Program language translator

Info

Publication number
JPS62235643A
JPS62235643A JP7667186A JP7667186A JPS62235643A JP S62235643 A JPS62235643 A JP S62235643A JP 7667186 A JP7667186 A JP 7667186A JP 7667186 A JP7667186 A JP 7667186A JP S62235643 A JPS62235643 A JP S62235643A
Authority
JP
Japan
Prior art keywords
conversion
output device
input
auxiliary
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
JP7667186A
Other languages
Japanese (ja)
Inventor
Muneko Hashimoto
橋本 宗子
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP7667186A priority Critical patent/JPS62235643A/en
Publication of JPS62235643A publication Critical patent/JPS62235643A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To convert a program of a large scale by a small memory capacity, by constituting the titled translator so that an unnecessary conversion data is stored in an auxiliary input/output device, after executing every one statement. CONSTITUTION:At the time of translating a source program which has been inputted from an input device 1, whether it is necessary as information until the end of a program unit or not is decided by an auxiliary output converting means 21, and unless it is necessary, a result of translation is saved in an auxiliary input/output device 7. In an auxiliary conversion input means 22, the translation is performed until the end and at the time of outputting a result of conversion to an output device 8, the contents of the auxiliary input/output device 7 are inputted to a conversion processing part 4. In this way, an unnecessary result of conversion is stored in the auxiliary input/output device, therefore, a large source program can be translated as it is, and a person's help for dividing the source program can be omitted.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、言語トランスレータ、特に高級言語から他
の高級言語に変換するプログラム言語トランスレータに
関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a language translator, and particularly to a programming language translator for converting from a high-level language to another high-level language.

〔従来の技術〕[Conventional technology]

第3図は従来のプログラム言語トランスレータを示した
もので、1はトランスレート前のソースプログラムを入
力する為のフロッピーディスク。
Figure 3 shows a conventional programming language translator, where 1 is a floppy disk for inputting the source program before translation.

キーボード等の入力装置、2はソースプログラム全部を
符の列に変換する字句解析処理部、3は字句解析処理部
2での処理結果を入力として全部の構文を解析する構文
解析処理部、4は構文解析処理部3での処理結果を入力
として実質上の変換を実行する変換処理部、5は以上の
3パス変換の各バス時に、前のパスの情報をメモリに残
しておく為の情報テーブル用メモリ、6は上記各処理部
2〜4と上記メモリ5を備え、他に変換の為のワークメ
モリ等を有する中央処理装置、7は各処理部2〜4の各
パスで作成される変換結果を中間語ファイルとして残し
ておく為のウィンチェスタディスク等の補助入出力装置
、8は変換結果を出力する為のフロッピーディスク等の
出力装置である。
An input device such as a keyboard, 2 a lexical analysis processing unit that converts the entire source program into a string of marks, 3 a syntactic analysis processing unit that uses the processing results of the lexical analysis processing unit 2 as input and analyzes all the syntax, 4 a A conversion processing unit that executes actual conversion by inputting the processing result of the syntax analysis processing unit 3, and 5 is an information table for retaining information of the previous pass in memory at each bus of the above three-pass conversion. 6 is a central processing unit equipped with each of the processing units 2 to 4 and the memory 5, and also has a work memory for conversion, and 7 is a conversion unit created in each pass of each of the processing units 2 to 4. An auxiliary input/output device such as a Winchester disk is used to store the results as an intermediate language file, and 8 is an output device such as a floppy disk for outputting the conversion results.

次に動作について、第4図のプログラム変換の流れ図に
従って説明する。
Next, the operation will be explained according to the flowchart of program conversion shown in FIG.

まず、字句解析処理部2が入力装置1からソースプログ
ラムを1行読出して、その字句解析を行う(ステップ■
)。次に、この解析結果をメモリに残すか否かを判断し
くステップ■)、残す場合は、その解析結果を情報テー
ブル用メモリ5に格納する(ステップ■)。さらに、補
助入出力装置7にその結果を格納する(ステップ■)。
First, the lexical analysis processing unit 2 reads one line of the source program from the input device 1 and performs lexical analysis on it (step
). Next, it is determined whether or not to leave this analysis result in the memory (step (2)), and if so, the analysis result is stored in the information table memory 5 (step (2)). Furthermore, the result is stored in the auxiliary input/output device 7 (step 2).

これを全プログラム終了まで続ける。以上が1番目のパ
スである。次に、構文解析処理部3が補助入出力装置7
から1行分の情報を読出し、構文解析を行う(ステップ
■)。この結果をメモリに残すか否かを判断しくステッ
プ■)、残す場合はその解析結果を情報テーブル用メモ
リ5に格納する(ステップの)。さらに、補助入出力装
置7に結果を格納する(ステップ■)。これを全プログ
ラム終了まで続ける。以上が2番目のパスでおる。次に
、変換処理部4が補助入出力装置7から1行分の情報を
読出し、これを変換処理しくステップ■)、その結果を
メモリに残すか否かを判断しくステップ@)、残す場合
は、情棹テーブル用メモリ5に格納する(ステップ■)
。そして出力装置8に変換結果を格納する(ステップ0
)。これを全プログラム終了まで続ける。これが最後の
3番目のパスである。
Continue this until the end of the entire program. The above is the first pass. Next, the syntax analysis processing unit 3 uses the auxiliary input/output device 7
One line of information is read from and parsed (step ■). It is determined whether or not to leave this result in the memory (step 2), and if so, the analysis result is stored in the information table memory 5 (step 2). Furthermore, the results are stored in the auxiliary input/output device 7 (step ①). Continue this until the end of the entire program. This is the second pass. Next, the conversion processing unit 4 reads out one line of information from the auxiliary input/output device 7, converts it (step ■), judges whether to leave the result in memory or not (step @), and if so, , stored in the information table memory 5 (step ■)
. Then, the conversion result is stored in the output device 8 (step 0
). Continue this until the end of the entire program. This is the third and final pass.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来のプログラム言語トランスレータは以上のように構
成されているので、メモリ節約の為には3パス方式で変
換したり、変換処理部4を更にいくつかのパスに分ける
必要がア夛、パスを分ける程変換に時間がかかつてしま
うほか、1パス方式で変換しようとすると、メモリが多
く必要になるという問題点があった。また、大きなプロ
グラムを変換する場合は、オペレータがこの大きなプロ
グラムを小さく分割する必要があるなどの問題点があっ
た〇 この発明は上記のような問題点を解消する為になされた
もので、1パス方式によシ変換に時間がかからないよう
にするとともに、大きなプログラムでも人の介入なしに
変換が可能な1パス方式のプログラム言語トランスレー
タを得ることを目的とする。
Conventional programming language translators are configured as described above, so in order to save memory, it is necessary to convert in a three-pass method or to divide the conversion processing unit 4 into several more passes. In addition to the fact that conversion takes a long time, converting using a one-pass method requires a large amount of memory. In addition, when converting a large program, there were problems such as the operator having to divide the large program into smaller pieces. This invention was made to solve the above problems. To provide a one-pass method programming language translator which can reduce the time required for language conversion by using a pass method and can convert even large programs without human intervention.

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係るプログラム言語トランスレータは、トラ
ンスレートの中間で、中間結果を補助入出力装置に出力
する補助変換出力手段および上記補助入出力装置に格納
した中間結果を補助入出力装置から入力する補助変換入
力手段を用いて、トランスレートの中間結果を逐次補助
入出力装置に逐次入出力するような構成としたものであ
る。
The programming language translator according to the present invention includes an auxiliary conversion output means that outputs an intermediate result to an auxiliary input/output device during translation, and an auxiliary conversion that inputs the intermediate result stored in the auxiliary input/output device from the auxiliary input/output device. The configuration is such that intermediate results of translation are sequentially input/output to an auxiliary input/output device using an input means.

〔作 用〕[For production]

この発明におけるプログラム言語トランスレータは、字
句解析、構文解析、変換を終えた1ステートメントの変
換結果が、その後の変換情報としランスレートシ九結果
を情報テーブル用メモリ中に残しておき、そうでなけれ
ば補助入出力装置に出力し、プログラム単位の最後まで
補助入出力装置に変換結果を保存する。プログラム単位
の最後に来た時、補助入出力装置からの入力を・判断す
る手段が変換結果がメモリと補助入出力装置のいずれに
あるかを判断し、補助入出力装置にあれば補助入出力装
置から出力装置に入力するように作用する。
The programming language translator in this invention uses the conversion result of one statement after lexical analysis, syntactic analysis, and conversion as the subsequent conversion information, and leaves the result of the translation in the information table memory. Output to the auxiliary input/output device and save the conversion result in the auxiliary input/output device until the end of the program unit. When the end of the program unit is reached, the means for determining the input from the auxiliary input/output device determines whether the conversion result is in the memory or the auxiliary input/output device, and if it is in the auxiliary input/output device, the auxiliary input/output Acts as input from the device to the output device.

〔実施例〕〔Example〕

次に、この発明の一実施例を図について説明する。 Next, an embodiment of the present invention will be described with reference to the drawings.

第1図において、21は補助変換出力手段で、これが入
力装置1から入力されたソースプログラムのトランスレ
ート時に、プログラム単位の最後まで情報として必要か
否かを判定し、必要でなければトランスレートした結果
を補助入出内装[7に出力して保存する。22は補助変
換入力手段で、これがソースプログラムの各プログラム
・ユニツに−AFJ甚メ3−+rマトランスレートゴh
を曲占〒−出力装置8に全変換結果を出力する時に、各
変換結果がメモリ内に保存されているのか、補助入出力
装置7に保存されているのかを判断し、必要があれば補
助入出力装置7から変換結果を変換処理部4に入力する
。23は変換にかかわる処理部2.3.4 。
In FIG. 1, reference numeral 21 denotes an auxiliary conversion output means, which, when translating the source program input from the input device 1, determines whether or not the information is necessary up to the end of the program unit, and if it is not necessary, translates the source program. Output and save the results to the auxiliary entry/exit interior [7]. Reference numeral 22 denotes an auxiliary conversion input means, which inputs -AFJ电目3-+rmatranslategoh to each program unit of the source program.
- When outputting all conversion results to the output device 8, it is determined whether each conversion result is stored in the memory or in the auxiliary input/output device 7, and if necessary, the auxiliary input/output device 7 is used. The conversion result is input from the input/output device 7 to the conversion processing section 4 . 23 is a processing unit 2.3.4 involved in conversion.

補助変換出力手段21.補助変換入力手段22および各
処理を実行する為のプログラム等を格納しているメモリ
を備えたプログラム言語トランスレータである。
Auxiliary conversion output means 21. This is a program language translator equipped with an auxiliary conversion input means 22 and a memory storing programs and the like for executing each process.

なお、このほかの第3図に示したものと同一のブロック
には同一符号を付して、その重複する説明を省く。
Note that other blocks that are the same as those shown in FIG. 3 are given the same reference numerals, and redundant explanation thereof will be omitted.

次に、この発明の実施例の動作を、第2図に示すプログ
ラム言語のトランスレートの流れ図に従って説明する。
Next, the operation of the embodiment of the present invention will be explained according to the flow chart of programming language translation shown in FIG.

なお、第4図と同符号の処理ステップは従来例と同じ動
作をするものとして、その動作説明を省略する。まず、
字句解析、構文解析、変換の各処理を続けて実施した後
(ステップ■、■、■)、補助装置出力部21が変換結
果がその後の変換に必要か否かを判断しくステップ0)
、必要であればメモリに格納しくステップ0)、必要の
ない場合は補助変換出力手段21が変換結果の補助入出
力装置7への出力を行って格納する(ステップ@)。
It should be noted that processing steps having the same reference numerals as those in FIG. 4 operate in the same manner as in the conventional example, and a description of the operations will be omitted. first,
After successively performing the lexical analysis, syntactic analysis, and conversion processes (steps ■, ■, ■), the auxiliary device output unit 21 determines whether the conversion results are necessary for subsequent conversion (step 0).
If necessary, the conversion result is stored in the memory (step 0), and if not necessary, the auxiliary conversion output means 21 outputs the conversion result to the auxiliary input/output device 7 and stores it (step @).

このようにして、従来例と同様にプログラムの最後まで
トランスレートを続ける。そして、プログラムの最後に
なると、出力装置8への出力を行なう。このときは、ま
ず、変換結果の1ステートメントが情報テーブル用メそ
り5にあるか否かを補助変換入力手段22が判断する(
ステップO)。
In this way, translation continues until the end of the program as in the conventional example. Then, at the end of the program, output is performed to the output device 8. At this time, the auxiliary conversion input means 22 first determines whether one statement of the conversion result is in the information table memory 5 (
Step O).

ない場合は、変換装置入力部22が変換結果を補助入出
力装置7から変換処理部4へ入力しくステップ@)、あ
る場合は、情報テーブル用メモリ5にある変換結果を出
力装置8に出力する(ステップ0)。この変換結果の出
力を変換結果の最後まで行なうことも、従来例と同様の
動作で行なう。
If not, the conversion device input unit 22 inputs the conversion result from the auxiliary input/output device 7 to the conversion processing unit 4 (step @), and if it exists, outputs the conversion result in the information table memory 5 to the output device 8. (Step 0). The output of the conversion result up to the end of the conversion result is performed in the same manner as in the conventional example.

なお、上記実施例では、入力装置1と補助入出力装置7
及び出力装置8を別のものとして取扱っているが、これ
が同一のものであっても、これらの中の2つが同一のも
のであってもよい。
Note that in the above embodiment, the input device 1 and the auxiliary input/output device 7
Although the output device 8 and output device 8 are treated as different devices, they may be the same or two of them may be the same.

〔発明の効果〕〔Effect of the invention〕

以上のように、この発明によれば、トランスレートを1
ステートメントずつ実行し、その後の変換データとして
不必要な変換結果を補助入出力装置に格納するように構
成したので、大きなプログラム単位をもつソースプログ
ラムをそのit)ランスレートでき、かかるソースプロ
グラムラ人間が分割してトランスレータにかけるという
従来におけるような手間が省け、小さなメモリで自動的
に大きなプログラム変換ができる効果がある。また、必
要な箇所はメモリ上に残しておく為、トランスレートに
かかる時間も、従来の複数パス方式で全てを補助入出力
装置に格納する場合よりも短かくてすむなどの効果があ
る。
As described above, according to the present invention, the translation is 1
Since the structure is configured to execute one statement at a time and store unnecessary conversion results in the auxiliary input/output device as subsequent conversion data, it is possible to run a source program with a large program unit, and it is easy for a human to run such a source program. This eliminates the conventional effort of dividing the program and applying it to a translator, and has the effect of automatically converting a large program using a small memory. Furthermore, since the necessary parts are left in the memory, the time required for translation is also shorter than when storing everything in the auxiliary input/output device using the conventional multi-pass method.

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

第1図はこの発明の一実施例を示すプログラム言語トラ
ンスレータのブロック図、第2図はこの発明によるトラ
ンスレートの実施例を示す流れ図、第3図は従来のプロ
グラム言語トランスレータの−−1,J  A  T7
+    &tr  J  rX71  ++J−停→
t 七k 4q Ir )  I   L  +  +
/  −11/−トの実施例を示す流れ図である。 図において、1は入力装置、8は出力装置、23はトラ
ンスレートの処理をする中央処理装置、21は補助変換
出力手段、22は補助変換入力手段、7は補助入出力装
置である。 なお、図中、同一符号は、同一または相当部分を示す。 特許出願人  三菱電機株式会社 代理人 弁理士  1) 澤  博  昭 ”°1(外
2名)  ゛
FIG. 1 is a block diagram of a programming language translator showing an embodiment of the present invention, FIG. 2 is a flowchart showing an embodiment of translation according to the invention, and FIG. 3 is a block diagram of a conventional programming language translator. A T7
+ &tr J rX71 ++J-stop→
t 7k 4q Ir) I L + +
It is a flowchart which shows the Example of /-11/-. In the figure, 1 is an input device, 8 is an output device, 23 is a central processing unit that performs translation processing, 21 is an auxiliary conversion output means, 22 is an auxiliary conversion input means, and 7 is an auxiliary input/output device. In addition, in the figures, the same reference numerals indicate the same or corresponding parts. Patent Applicant Mitsubishi Electric Corporation Agent Patent Attorney 1) Hiroshi Sawa ”°1 (2 others) ゛

Claims (1)

【特許請求の範囲】[Claims] ソースプログラムを入力するための入力装置、トランス
レートを実行するための処理を実行する中央処理装置、
上記トランスレート後のプログラムを出力するための出
力装置および上記トランスレートの実行結果を格納する
補助入出力装置を備えたプログラム言語トランスレータ
において、上記中央処理装置における処理結果がその後
の変換処理に必要であるか否かを補助変換出力手段によ
り判断し、必要でなければ上記補助入出力装置にその処
理結果を格納し、上記プログラムの最後に全ての変換処
理結果を出力する段階で、この変換処理結果が上記中央
処理装置内の情報テーブル用メモリに存在するか否かを
判断し、存在しない場合には、補助変換入力手段によつ
て上記補助入出力装置から上記出力装置に上記処理結果
を入力するようにしたことを特徴とするプログラム言語
トランスレータ。
An input device for inputting a source program, a central processing unit for executing processing for executing translation,
In a programming language translator equipped with an output device for outputting the translated program and an auxiliary input/output device for storing the execution results of the translation, the processing results in the central processing unit are necessary for subsequent conversion processing. The auxiliary conversion output means determines whether or not the conversion process exists, and if it is not necessary, stores the processing result in the auxiliary input/output device, and outputs all the conversion process results at the end of the program. determines whether or not exists in the information table memory in the central processing unit, and if it does not exist, inputs the processing result from the auxiliary input/output device to the output device by the auxiliary conversion input means. A programming language translator that is characterized by:
JP7667186A 1986-04-04 1986-04-04 Program language translator Pending JPS62235643A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7667186A JPS62235643A (en) 1986-04-04 1986-04-04 Program language translator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7667186A JPS62235643A (en) 1986-04-04 1986-04-04 Program language translator

Publications (1)

Publication Number Publication Date
JPS62235643A true JPS62235643A (en) 1987-10-15

Family

ID=13611886

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7667186A Pending JPS62235643A (en) 1986-04-04 1986-04-04 Program language translator

Country Status (1)

Country Link
JP (1) JPS62235643A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03105626A (en) * 1989-09-20 1991-05-02 Fujitsu Ltd Procedure in-line developing system
JPH03105625A (en) * 1989-09-20 1991-05-02 Fujitsu Ltd Reserving/restoring system for intermediate language

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03105626A (en) * 1989-09-20 1991-05-02 Fujitsu Ltd Procedure in-line developing system
JPH03105625A (en) * 1989-09-20 1991-05-02 Fujitsu Ltd Reserving/restoring system for intermediate language

Similar Documents

Publication Publication Date Title
JPS62235643A (en) Program language translator
JPS5922140A (en) Interactive compiling system
JPH0689166A (en) Parts processing description expanding system
JP2590288B2 (en) Program conversion device
JPS58112127A (en) Forming system of data input means
JPH0210429A (en) Program structure processing system
JPH0475550B2 (en)
JP2539070B2 (en) Compiler processor
JP2501394B2 (en) Procedure call translation device
JPH0795275B2 (en) Compile processor
JPH05165650A (en) Machine language translation device
JPH0254368A (en) Translation control system for mechanical translation
JPH01209542A (en) Logical verification device
JP2935928B2 (en) Natural language translator
JPH0250730A (en) Language converting system based upon common machine word
JPH05158706A (en) Optimization processing system for intermediate language
JPH0385639A (en) Program language translator
JPH0358136A (en) Compiler operation system in machine different in character code system
JPH05127919A (en) Device and method for speeding up translation
JPS62166432A (en) Control system for program translation
JPH021027A (en) Compiling system for compressed source program
JPH02224133A (en) Divided code forming system
JPS63187364A (en) Index variable vectorized compiling system
JPS61161514A (en) Numerical control system
JPH02199534A (en) Flow chart forming processor