JPH01196630A - Program translating system - Google Patents
Program translating systemInfo
- Publication number
- JPH01196630A JPH01196630A JP2107388A JP2107388A JPH01196630A JP H01196630 A JPH01196630 A JP H01196630A JP 2107388 A JP2107388 A JP 2107388A JP 2107388 A JP2107388 A JP 2107388A JP H01196630 A JPH01196630 A JP H01196630A
- Authority
- JP
- Japan
- Prior art keywords
- translation
- information
- translation information
- library file
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は原始プログラムを翻訳して目的プログラムを生
成するプログラム翻訳方式に関し、特にコンピュータシ
ステムで用いられるコンパイラの動作環境を、翻訳する
原始プログラムに応じて最適なものとすることができる
プログラム翻訳方式〔従来の技術〕
原始プログラムをコンパイラに入力して翻訳処理を行な
わせる場合、コンパイラの動作環境を設定することが必
要となるが、従来は利用者が指定した値、コンピュータ
システム内で一意に決められている省略値等に基づいて
コンパイラの動作環境を設定するようにしている。[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a program translation method for generating a target program by translating a source program, and in particular, it relates to a program translation method for generating a target program by translating a source program. A program translation method that can be optimized according to the requirements [Conventional technology] When inputting a source program to a compiler and having it perform translation processing, it is necessary to set the operating environment of the compiler. The operating environment of the compiler is set based on values specified by the administrator, default values uniquely determined within the computer system, etc.
従来は上述したように、翻訳する原始プログラムの規模
、性質等に依らず、利用者が指定した値。Conventionally, as mentioned above, the value was specified by the user, regardless of the scale, nature, etc. of the source program to be translated.
コンピュータシステム内で一意に決められている省略値
等に基づいてコンパイラの動作環境を設定し、この設定
された動作環境でコンパイラを動作させるようにしてい
るため、翻訳時に無駄なコンピュータ資源が確保された
り、必要なコンビエータ資源が翻訳途中で不足してしま
う場合があるという問題点があった。The operating environment of the compiler is set based on default values that are uniquely determined within the computer system, and the compiler is run in this set operating environment, so that wasted computer resources are not secured during translation. There are also problems in that necessary combiator resources may run out during translation.
本発明はこのような問題点を解決したものであり、その
目的は、翻訳する原始プログラムに応じてコンパイラの
動作環境を最適なものにできるようにすることにある。The present invention solves these problems, and its purpose is to optimize the operating environment of a compiler depending on the source program to be translated.
本発明はこのような問題点を解決するため、ライブラリ
ファイルからそのメンバである原始プログラムを入力し
て翻訳処理を行ない、目的プログラムを生成するコンパ
イラシステムに於いて、翻訳指示によって指定された原
始プログラム対応の翻訳情報が前記ライブラリファイル
に登録されているか否かを判断する翻訳情報検査手段と
、前記翻訳指示によって指定された原始プログラムを翻
訳し、目的プログラムを生成する翻訳処理手段と、
前記ライブラリファイルに翻訳情報格納領域を確保する
翻訳情98 w4域確保手段と、該翻訳情報領域確保手
段によって確保された翻訳情報格納領域に、前記翻訳処
理手段が翻訳処理時に必要とした資源を示す情報を翻訳
情報として登録する翻訳情報出力手段と、
前記翻訳指示によって指定された原始プログラム対応の
翻訳情報を前記ライブラリファイルから読込む翻訳情報
入力手段と、
該翻訳情報入力手段が読込んだ翻訳情報に従って前記翻
訳処理手段の動作環境を設定する翻訳環境設定手段と、
前記翻訳処理手段の動作環境を予め定められているもの
にする固定1訳環境設定手段と、前記翻訳処理手段で翻
訳を行なう際に必要となった資源を示す情報を前記ライ
ブラリファイルに登録されている翻訳情報に反映させる
翻訳情報置換手段とを設け、
前記翻訳情報検査手段で前記翻訳指示によって指定され
た原始プログラム対応の翻訳情報が前記ライブラリファ
イルに登録されていないと判断された場合は、
前記固定翻訳環境設定手段によって前記翻訳処理手段の
動作環境を設定し、前記翻訳処理手段で前記翻訳指示に
よって指定された前記ライブラリファイルに格納されて
いる原始プログラムの翻訳を行ない、前記翻訳情報領域
確保手段で前記ライブラリファイルに翻訳情報格納領域
を確保し、前記翻訳情報出力手段で前記翻訳情報領域確
保手段によって確保された翻訳情報格納領域に翻訳情報
を登録し、
前記翻訳情報検査手段で前記翻訳指示によって指定され
た原始プログラム対応の翻訳情報が前記ライブラリファ
イルに登録されていると判断された場合は、
前記翻訳情報入力手段で前記ライブラリファイルに登録
されている前記翻訳指示によって指定された原始プログ
ラム対応の翻訳情報を読込み、前記翻訳環境設定手段で
前記翻訳情報入力手段が読込んだ翻訳情報に従って前記
翻訳処理手段の動作環境を設定し、前記翻訳処理手段で
前記翻訳指示によって指定された原始プログラムの翻訳
を行ない、前記翻訳情報置換手段で前記翻訳処理手段が
前記翻訳指示によって指定された原始プログラムを翻訳
する際に必要となった資源を示す情報を前記ライブラリ
ファイルに登録されている翻訳情報に反映させる。In order to solve such problems, the present invention inputs a source program that is a member from a library file, performs translation processing, and generates a target program. translation information checking means for determining whether corresponding translation information is registered in the library file; translation processing means for translating a source program specified by the translation instruction and generating a target program; and the library file. A translation information 98 w4 area securing means secures a translation information storage area in the translation information storage area, and the translation processing means translates information indicating resources required during translation processing into the translation information storage area secured by the translation information area securing means. translation information output means for registering as information; translation information input means for reading translation information corresponding to the source program specified by the translation instruction from the library file; and translation according to the translation information read by the translation information input means. Translation environment setting means for setting the operating environment of the processing means; fixed translation environment setting means for setting the operating environment of the translation processing means to a predetermined one; translation information replacement means for reflecting information indicating a resource that has become a source in the translation information registered in the library file; If it is determined that it is not registered in the file, the fixed translation environment setting means sets the operating environment of the translation processing means, and the translation processing means stores the translation in the library file specified by the translation instruction. The translation information area securing means secures a translation information storage area in the library file, and the translation information outputting means translates the translation information in the translation information storage area secured by the translation information area securing means. and if the translation information checking means determines that the translation information corresponding to the source program specified by the translation instruction is registered in the library file, the translation information input means registers it in the library file. reads the translation information corresponding to the source program specified by the translation instruction, sets the operating environment of the translation processing means in accordance with the translation information read by the translation information input means in the translation environment setting means, and performs the translation Information indicating resources required when the processing means translates the source program specified by the translation instruction, and the translation information replacement means translates the source program specified by the translation instruction. is reflected in the translation information registered in the library file.
翻訳指示によって指定された原始プログラム対応の翻訳
情報がライブラリファイルに格納されていないと翻訳情
報検査手段によって判断されることにより、翻訳処理手
段は翻訳指示によって指定された原始プログラムの翻訳
を行ない、翻訳情報領域確保手段はライブラリファイル
に翻訳情報格納領域を確保し、翻訳情報出力手段は翻訳
処理手段が翻訳を行なう際に必要となった資源を示す情
報を翻訳情報領域確保手段によって確保された翻訳情報
領域に翻訳情報として登録する。翻訳指示によって指定
された原始プログラム対応の翻訳情報がライブラリファ
イルに登録されていると翻訳情報検査手段によって判断
されることにより、翻訳情報入力手段は翻訳指示によっ
て指定された原始プログラム対応の翻訳情報をライブラ
リファイルから読込み、翻訳環境設定手段は翻訳情報入
力手段が読込んだ翻訳情報に従って翻訳処理手段の動作
環境を設定し、翻訳情報置換手段は翻訳処理手段で翻訳
処理を行なうことにより得られた新たな翻訳情報をライ
ブラリファイルに登録されている翻訳情報に反映させる
。When the translation information inspection means determines that the translation information corresponding to the source program specified by the translation instruction is not stored in the library file, the translation processing means translates the source program specified by the translation instruction, and performs the translation. The information area securing means secures a translation information storage area in the library file, and the translation information output means outputs information indicating the resources required when the translation processing means performs translation to the translation information secured by the translation information area securing means. Register as translation information in the area. When the translation information checking means determines that the translation information corresponding to the source program specified by the translation instruction is registered in the library file, the translation information input means inputs the translation information corresponding to the source program specified by the translation instruction. Reading from the library file, the translation environment setting means sets the operating environment of the translation processing means according to the translation information read by the translation information input means, and the translation information replacement means sets the operating environment of the translation processing means according to the translation information read by the translation information input means. Reflect the translation information registered in the library file.
次に本発明の実施例について図面を参照して詳細に説明
する。Next, embodiments of the present invention will be described in detail with reference to the drawings.
第1図は本発明の実施例のブロック図であり、コンパイ
ラ1と、ライブラリファイル2とを含んでいる。コンパ
イラ1は翻訳情報検査手段11と、翻訳情報領域確保手
段12と、翻訳情報出力手段13と、翻訳情報入力手段
14と、翻訳環境設定手段15と、翻訳情報置換手段1
6と、翻訳処理手段17と、固定翻訳環境設定手段18
とを含んでいる。ライブラリファイル2には原始プログ
ラム21−1’ 〜21、l がメンバとして格納され
ている原始プログラム格納領域21−1〜21−nと、
翻訳情報22−1’〜22−m’ が格納されている翻
訳情報格納領域22−1〜22−mと、翻訳情報22−
1’ 〜22−m’ が原始プログラム21−1°〜2
1−n’ の何れと対応するのかを示す情報等が格納さ
れるディレクトリ領域23とが設けられている。各翻訳
前622−1’〜22−m’ は対応する原始プログラ
ムを翻訳する際に必要となるコンパイラの内部資源(メ
モリサイズ、作業用ファイルの容量等)を示す情報であ
り、原始プログラム21−1“〜21−n’ の内の1
つと1対1に対応している。FIG. 1 is a block diagram of an embodiment of the present invention, which includes a compiler 1 and a library file 2. As shown in FIG. The compiler 1 includes a translation information checking means 11, a translation information area securing means 12, a translation information output means 13, a translation information input means 14, a translation environment setting means 15, and a translation information replacement means 1.
6, translation processing means 17, and fixed translation environment setting means 18
Contains. The library file 2 includes source program storage areas 21-1 to 21-n in which source programs 21-1' to 21,l are stored as members;
Translation information storage areas 22-1 to 22-m in which translation information 22-1' to 22-m' are stored, and translation information 22-
1' ~ 22-m' is the original program 21-1° ~ 2
A directory area 23 is provided in which information indicating which one of 1-n' corresponds to is stored. Each pre-translation 622-1' to 22-m' is information indicating the compiler's internal resources (memory size, work file capacity, etc.) required when translating the corresponding source program, and the source program 21- 1 from 1" to 21-n'
There is a one-to-one correspondence.
第2図を参照すると、翻訳情報検査手段11ばステップ
321で翻訳指示によって指定された原始プログラム対
応の翻訳情報がライブラリファイル2中に存在するか否
かを調べるために、ディレクトリ領域23を参照し、次
のステップS22で翻訳指示によって指定された原始プ
ログラム対応の1訳情報がライブラリファイル2中に存
在するか否かを判断する。Referring to FIG. 2, the translation information checking means 11 refers to the directory area 23 in step 321 to check whether translation information corresponding to the source program specified by the translation instruction exists in the library file 2. In the next step S22, it is determined whether translation information corresponding to the source program specified by the translation instruction exists in the library file 2.
第3図を参照すると、翻訳情報領域確保手段12はステ
ップ331でライブラリファイル2中に翻訳情報格納領
域を確保する処理を行ない、次のステップ332でディ
レクトリ領域23に新たに確保した翻訳情報格納領域に
格納する翻訳情報と原始プログラムとの対応を示す情報
等を格納する。Referring to FIG. 3, the translation information area securing means 12 performs processing to secure a translation information storage area in the library file 2 in step 331, and in the next step 332, the translation information storage area is newly secured in the directory area 23. Stores information indicating the correspondence between the translation information stored in the source program and the source program.
第4図を参照すると、翻訳情報出力手段13はステップ
S41で、ライブラリファイル2のオープン(出力モー
ド)処理を行ない、ステップS42で翻訳情報をライブ
ラリファイル2に出力し、ステップ343で出力すべき
翻訳情報を全て出力したか否かを判定し、ステップ34
4でライブラリファイル2のクローズ処理を行なう。Referring to FIG. 4, the translation information output means 13 performs an open (output mode) process on the library file 2 in step S41, outputs the translation information to the library file 2 in step S42, and translates the translation to be output in step S42. Determine whether all information has been output, and proceed to step 34
4, the library file 2 is closed.
第5図を参照すると、翻訳情報入力手段14はステップ
S51で、ライブラリファイル2のオープン(入力モー
ド)処理を行ない、ステップS52でライブラリファイ
ル2から翻訳情報を入力し、ステップS53で入力すべ
き翻訳情報を全て入力したか否かを判定し、ステップ3
54でライブラリファイル2のクローズ処理を行なう。Referring to FIG. 5, the translation information input means 14 performs an open (input mode) process for the library file 2 in step S51, inputs translation information from the library file 2 in step S52, and translates the translation to be input in step S53. Determine whether all information has been entered and proceed to step 3.
In step 54, the library file 2 is closed.
第6図を参照すると、翻訳環境設定手段15はステップ
361で翻訳に必要なメモリサイズを確保し、ステップ
362で翻訳に必要な作業用ファイルの容量を確保し、
翻訳に更に他の資源が必要となる場合は、ステップ36
2以降のステップで必要となる資源を確保する。Referring to FIG. 6, the translation environment setting means 15 secures the memory size necessary for translation in step 361, secures the capacity of the work file necessary for translation in step 362,
If further resources are required for translation, step 36
Secure the resources needed for steps 2 and subsequent steps.
第7図を参照すると、翻訳情報置換手段16はステップ
371に於いて、今回の翻訳処理時に必要となったメモ
リサイズが前回の翻訳処理時と同じか否かを判定し、同
じと判定した場合は今回の翻訳処理時に必要となった作
業用ファイルの容量が前回の翻訳処理時と同じか否かを
判定するステップS73の処理を行ない、異なると判定
した場合はステップ372で翻訳に必要なメモリサイズ
を示す情報を今回の翻訳処理に於いて必要となったメモ
リサイズに変更した後、ステップ373の処理を行なう
。ステップ373で異なると判定した場合はステップ3
74で翻訳に必要な作業用ファイルの容量値を示す情報
を今回の翻訳処理に於いて必要となった作業用ファイル
の容量値に変更する。翻訳環境設定手段15で他の資源
が確保されている場合は、ステップS74以後のステッ
プに於いて、上記他の資源についての情報に対して前述
したと同様の処理を行なう。Referring to FIG. 7, in step 371, the translation information replacement means 16 determines whether the memory size required for the current translation process is the same as that for the previous translation process, and if it is determined to be the same. In step S73, it is determined whether the capacity of the work file required for the current translation process is the same as that for the previous translation process, and if it is determined that it is different, the memory required for the translation is stored in step S72. After changing the information indicating the size to the memory size required for the current translation process, the process of step 373 is performed. If it is determined in step 373 that they are different, step 3
In step 74, the information indicating the capacity value of the work file necessary for translation is changed to the capacity value of the work file required in the current translation process. If other resources are secured by the translation environment setting means 15, the same processing as described above is performed on the information regarding the other resources in steps after step S74.
次に、各図を参照して本実施例の動作を説明する。Next, the operation of this embodiment will be explained with reference to each figure.
コンパイラ1はライブラリファイル2中の原始プログラ
ムを指定した翻訳指示が加えられると、翻訳情報検査手
段11に制御を渡す。翻訳情報検査手段11は制御が渡
されると、ライブラリファイル2中のディレクトリ領域
23を参照しくステップ521)、翻訳指示によって指
定された原始プログラムに対応する翻訳情報がライブラ
リファイル2中に存在するか否かを判断する(ステップ
522)。When a translation instruction specifying the source program in the library file 2 is added, the compiler 1 passes control to the translation information checking means 11. When the translation information checking means 11 is given control, it refers to the directory area 23 in the library file 2 (step 521) and checks whether translation information corresponding to the source program specified by the translation instruction exists in the library file 2. (Step 522).
そして、翻訳情報がライブラリファイル2中に存在しな
いと判断した場合(ステップ322の判断結果がNoの
場合)は固定翻訳環境設定手段18に制御を渡し、存在
すると判断した場合(ステップ322の判断結果がYE
Sの場合)は翻訳情報入力手段14に制御を渡す。If it is determined that the translation information does not exist in the library file 2 (the determination result in step 322 is No), control is passed to the fixed translation environment setting means 18, and if it is determined that the translation information exists (the determination result in step 322 is is YE
In the case of S), control is passed to the translation information input means 14.
固定翻訳環境設定手段18は翻訳情報検査手段11から
制御が渡されると、予め設定されている省略値或いは利
用者から与えられた値に基づいて翻訳処理手段17の動
作環境を設定し、翻訳処理手段17に制御を渡す。When the fixed translation environment setting means 18 receives control from the translation information checking means 11, it sets the operating environment of the translation processing means 17 based on preset default values or values given by the user, and performs translation processing. Control is passed to means 17.
また、翻訳情報入力手段14は翻訳情報検査手段11か
ら制御が渡されると、ライブラリファイル2のオープン
(入力モード)処理を行ない(ステップ351) 、次
いで、翻訳指示によって指定された原始プログラム対応
の翻訳情報をライブラリファイル2から入力しくステッ
プ352. 353)、次いでライブラリファイル2の
クローズ処理を行ない(ステップ554)、その後翻訳
環境設定手段15へ制御を渡す。翻訳環境設定手段15
は翻訳情報入力手段14から制御が渡されると、翻訳情
報入力手段14が入力した翻訳情報に基づいて、翻訳に
必要なメモリサイズ及び作業用ファイルの容量を確保し
くステップ361. 362) 、更に他の資源が必要
である場合は、他の必要な資源を確保することによリ、
翻訳処理手段17の動作環境を整え、その後翻訳処理手
段17へ制御を渡す。Furthermore, when the translation information input means 14 receives control from the translation information inspection means 11, it performs an open (input mode) process for the library file 2 (step 351), and then translates the source program specified by the translation instruction. Step 352: Enter information from library file 2. 353), then closes the library file 2 (step 554), and then passes control to the translation environment setting means 15. Translation environment setting means 15
When control is passed from the translation information input means 14, step 361. secures the memory size and work file capacity necessary for translation based on the translation information input by the translation information input means 14. 362), if other resources are required, by securing other necessary resources,
The operating environment of the translation processing means 17 is prepared, and then control is passed to the translation processing means 17.
翻訳処理手段17は翻訳環境設定手段15或いは固定翻
訳環境設定手段18から制御が渡されると、翻訳指示に
よって指定された原始プログラムをライブラリファイル
2から入力して翻訳処理を行ない、目的プログラムを生
成する。翻訳処理手段17は固定翻訳環境設定手段18
から制御が渡された場合、即ち翻訳指示によって指定さ
れた原始プログラム対応の翻訳情報がライブラリファイ
ル2に存在していなかった場合は、目的プログラムを生
成した後、翻訳情報領域確保手段12に制御を渡し、翻
訳環境設定手段15から起動がかけられた場合、即ち翻
訳指示によって指定された原始プログラム対応の翻訳情
報がライブラリファイル2に存在していた場合は、目的
プログラムを生成した後、翻訳情報置換手段16に制御
を渡す。When the translation processing means 17 receives control from the translation environment setting means 15 or the fixed translation environment setting means 18, it inputs the source program specified by the translation instruction from the library file 2, performs translation processing, and generates the target program. . The translation processing means 17 is a fixed translation environment setting means 18
If control is passed from , that is, if translation information corresponding to the source program specified by the translation instruction does not exist in the library file 2, control is passed to the translation information area securing means 12 after generating the target program. If the translation environment setting means 15 issues translation information, that is, if translation information corresponding to the source program specified by the translation instruction exists in the library file 2, the translation information replacement is performed after generating the target program. Control is passed to means 16.
翻訳情報領域確保手段12は翻訳処理手段17から制御
が渡されると、今回翻訳対象となった原始プログラムの
翻訳情報を格納する翻訳情報格納領域をライブラリファ
イル2中に確保しくステップ531)、次いで、今回翻
訳対象となった原始プログラムとその翻訳情報との対応
を示す情報をディレクトリ領域23に格納しくステップ
532)、その後翻訳情報出力手段13に制御を渡す。When the translation information area securing means 12 receives control from the translation processing means 17, it secures a translation information storage area in the library file 2 for storing the translation information of the source program to be translated this time (Step 531), and then Information indicating the correspondence between the source program to be translated this time and its translation information is stored in the directory area 23 (step 532), and then control is passed to the translation information output means 13.
翻訳情報出力手段13は制御が渡されると、ライブラリ
ファイル2のオーブン(出力モード)処理を行ない(ス
テップ541) 、翻訳情報領域確保手段12によって
ライブラリファイル2内に確保された翻訳情報格納領域
に今回の翻訳処理に於いて翻訳処理手段17が必要とし
たメモリサイズ、作業用ファイルの容量を示す翻訳情報
を全て出力しくステップS42. 543)、その後ラ
イブラリファイル2のクローズ処理を行なう (ステッ
プ544)。When the translation information output means 13 is given control, it performs oven (output mode) processing on the library file 2 (step 541), and stores the current translation information in the translation information storage area secured in the library file 2 by the translation information area securing means 12. In step S42. 543), and then close processing of library file 2 is performed (step 544).
また、翻訳情報置換手段16は翻訳処理手段17から制
御が渡されると、今回の翻訳処理に於いて必要となった
メモリサイズが今回翻訳処理を行なった原始プログラム
と同一の原始プログラムに対する前回の翻訳処理に於い
て必要となったメモリサイズ(上記原始プログラム対応
の此訳情報によって示されるメモリサイズ)と同じであ
るか否かを判定しくステップ571) 、同じであると
判定した場合(ステップS71の判定結果がYESの場
合)はステップ373の処理を行ない、異なると判定し
た場合(ステップ371の判断結果がNoの場合)は上
記翻訳情報の内、メモリサイズを示す部分を今回の翻訳
処理に於いて必要となったメモリサイズに変更しくステ
ップ372) 、その後ステップS73の処理を行なう
。ステップ373では今回の翻訳処理に於いて必要とな
った作業用ファイルの容量が今回翻訳処理を行なった原
始プログラムと同一の原始プログラムに対する前回の翻
訳処理に於いて必要となった作業用ファイルの容量(上
記原始プログラム対応の翻訳情報によって示される作業
用ファイルの容量)と同じか否かを判定する。そして、
ステップS73で同じであると判定した場合(ステップ
S73の判定結果がYESの場合)はその処理を終了し
、異なると判定した場合(ステップS73の判定結果が
NOの場合)は上記翻訳情報の内、作業用ファイルの容
量を示す部分を今回の翻訳処理に於いて必要となった作
業用ファイルの容量値に変更する (ステップ574)
。翻訳情報に他の資源についての情報が含まれている場
合は、ステップS74以後のステップに於いて、各情報
に対して前述したと同様の処理を行なう。ここで、ステ
ップS71、 S73の判断結果がNOとなるのは、
今回翻訳対象としている原始プログラムが前回翻訳した
時に比べて(じ正されている場合であるので、上述した
処理を行なうことにより、ライブラリファイル2内の原
始プログラムが修正された場合に於いても、ライブラリ
ファイル2内の翻訳情報を最新の原始プログラムに対応
したものにすることができる。Further, when the translation information replacement means 16 is given control from the translation processing means 17, the memory size required for the current translation processing is the same as that of the previous translation of the source program for which the translation processing was performed this time. It is determined whether the memory size is the same as the memory size required for the process (the memory size indicated by the translation information corresponding to the source program) (step 571), and if it is determined that they are the same (step S71). If the judgment result is YES), perform the process of step 373, and if it is judged that they are different (if the judgment result of step 371 is No), the part indicating the memory size of the above translation information is included in the current translation process. Then, the memory size is changed to the required memory size (step 372), and then the process of step S73 is performed. In step 373, the capacity of the work file required for the current translation process is equal to the capacity of the work file required for the previous translation process for the same source program as the source program for which the current translation process was performed. (The capacity of the work file indicated by the translation information corresponding to the source program) is determined. and,
If it is determined in step S73 that they are the same (if the determination result in step S73 is YES), the process ends; if it is determined that they are different (if the determination result in step S73 is NO), the above translation information is , change the part indicating the capacity of the work file to the capacity value of the work file required in the current translation process (step 574).
. If the translation information includes information about other resources, the same processing as described above is performed on each piece of information in steps after step S74. Here, the judgment results in steps S71 and S73 are NO because:
This is a case where the source program to be translated this time has been corrected compared to when it was translated last time, so even if the source program in library file 2 is corrected by performing the above processing, The translation information in the library file 2 can be made compatible with the latest source program.
以上説明したように、本発明は、翻訳指示によって指定
された原始プログラムを翻訳する際、翻訳指示によって
指定された原始プログラム対応の翻訳情報がライブラリ
ファイルに登録されていない場合は、翻訳処理手段で翻
訳を行なう際に必要となった資源を示す情報を上記原始
プログラム対応の翻訳情報としてライブラリファイルに
登録し、翻訳対象としている原始プログラム対応の翻訳
情報がライブラリファイルに登録されている場合は、そ
の翻訳情報に従って翻訳処理手段の動作環境を設定し、
更に翻訳処理手段で翻訳を行なう際に必要となった資源
を示す情報をライブラリファイルに登録されている翻訳
情報に反映させるようにしたものであるので、以前に翻
訳された原始プログラムの再翻訳時等に於いては、翻訳
するプログラムに応じた最適な動作環境を得ることがで
き、無駄なコンビエータ資源を確保したり、翻訳途中で
コンビエータ資源が不足するといったことがなくなる効
果がある。As explained above, in the present invention, when translating a source program specified by a translation instruction, if translation information corresponding to the source program specified by the translation instruction is not registered in the library file, the translation processing means Information indicating the resources required for translation is registered in the library file as translation information for the source program mentioned above, and if translation information for the source program to be translated is registered in the library file, Set the operating environment of the translation processing means according to the translation information,
Furthermore, information indicating the resources required when performing translation by the translation processing means is reflected in the translation information registered in the library file, so when retranslating a previously translated source program. etc., it is possible to obtain an optimal operating environment according to the program to be translated, and there is an effect that there is no need to secure wasted combiator resources or shortage of combiator resources during translation.
第1図は本発明の実施例のブロフク図、第2図は翻訳情
報検査手段11の処理例を示す流れ図、
第3図は翻訳情報領域確保手段12の処理例を示す流れ
図、
第4図は翻訳情報出力手段13の処理例を示す流れ図、
第5図は翻訳情報入力手段14の処理例を示す流れ図、
第゛6図は翻訳環境設定手段15の処理例を示す流れ図
及び、
第7図は翻訳情報置換手段16の処理例を示す流れ図で
ある。
図に於いて、l・・・コンパイラ、2・・・ライブラリ
ファイル、11・・・翻訳情報検査手段、12・・・翻
訳情報領域確保手段、13・・・翻訳情報出力手段、1
4・・・翻訳情報入力手段、15・・・翻訳環境設定手
段、16・・・翻訳情報置換手段、17・・・翻訳処理
手段、211〜21−n・・・原始プログラム格納領域
、21−1’ 〜21−n’・・・原始プログラム、2
2−1〜22−m・・・翻訳情報格納領域、22−1’
〜22−m’ ・・・翻訳情報。FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flow chart showing an example of processing by the translation information checking means 11, FIG. 3 is a flow chart showing an example of processing by the translation information area securing means 12, and FIG. 4 is a flow chart showing an example of processing by the translation information area securing means 12. 5 is a flowchart showing an example of processing by the translation information output means 13, FIG. 6 is a flowchart showing an example of processing by the translation environment setting means 15, and FIG. 3 is a flowchart showing an example of processing by translation information replacement means 16; In the figure, l... Compiler, 2... Library file, 11... Translation information inspection means, 12... Translation information area securing means, 13... Translation information output means, 1
4... Translation information input means, 15... Translation environment setting means, 16... Translation information replacement means, 17... Translation processing means, 211-21-n... Source program storage area, 21- 1' to 21-n'... Original program, 2
2-1 to 22-m...translation information storage area, 22-1'
~22-m'...Translation information.
Claims (1)
ムを入力して翻訳処理を行ない、目的プログラムを生成
するコンパイラシステムに於いて、翻訳指示によって指
定された原始プログラム対応の翻訳情報が前記ライブラ
リファイルに登録されているか否かを判断する翻訳情報
検査手段と、前記翻訳指示によって指定された原始プロ
グラムを翻訳し、目的プログラムを生成する翻訳処理手
段と、 前記ライブラリファイルに翻訳情報格納領域を確保する
翻訳情報領域確保手段と、 該翻訳情報領域確保手段によって確保された翻訳情報格
納領域に、前記翻訳処理手段が翻訳処理時に必要とした
資源を示す情報を翻訳情報として登録する翻訳情報出力
手段と、 前記翻訳指示によって指定された原始プログラム対応の
翻訳情報を前記ライブラリファイルから読込む翻訳情報
入力手段と、 該翻訳情報入力手段が読込んだ翻訳情報に従って前記翻
訳処理手段の動作環境を設定する翻訳環境設定手段と、 前記翻訳処理手段の動作環境を予め定められているもの
にする固定翻訳環境設定手段と、 前記翻訳処理手段で翻訳を行なう際に必要となった資源
を示す情報を前記ライブラリファイルに登録されている
翻訳情報に反映させる翻訳情報置換手段とを設け、 前記翻訳情報検査手段で前記翻訳指示によって指定され
た原始プログラム対応の翻訳情報が前記ライブラリファ
イルに登録されていないと判断された場合は、 前記固定翻訳環境設定手段によって前記翻訳処理手段の
動作環境を設定し、前記翻訳処理手段で前記翻訳指示に
よって指定された前記ライブラリファイルに格納されて
いる原始プログラムの翻訳を行ない、前記翻訳情報領域
確保手段で前記ライブラリファイルに翻訳情報格納領域
を確保し、前記翻訳情報出力手段で前記翻訳情報領域確
保手段によって確保された翻訳情報格納領域に翻訳情報
を登録し、 前記翻訳情報検査手段で前記翻訳指示によって指定され
た原始プログラム対応の翻訳情報が前記ライブラリファ
イルに登録されていると判断された場合は、 前記翻訳情報入力手段で前記ライブラリファイルに登録
されている前記翻訳指示によって指定された原始プログ
ラム対応の翻訳情報を読込み、前記翻訳環境設定手段で
前記翻訳情報入力手段が読込んだ翻訳情報に従って前記
翻訳処理手段の動作環境を設定し、前記翻訳処理手段で
前記翻訳指示によって指定された原始プログラムの翻訳
を行ない、前記翻訳情報置換手段で前記翻訳処理手段が
前記翻訳指示によって指定された原始プログラムを翻訳
する際に必要となった資源を示す情報を前記ライブラリ
ファイルに登録されている翻訳情報に反映させることを
特徴とするプログラム翻訳方式。[Claims] In a compiler system that inputs a source program that is a member from a library file and performs translation processing to generate a target program, translation information corresponding to the source program specified by a translation instruction is stored in the library. translation information checking means for determining whether or not it is registered in the file; translation processing means for translating the source program specified by the translation instruction to generate a target program; and securing a translation information storage area in the library file. Translation information output means for registering information indicating resources required by the translation processing means at the time of translation processing as translation information in the translation information storage area secured by the translation information storage region. , translation information input means for reading translation information corresponding to the source program specified by the translation instruction from the library file; and translation for setting the operating environment of the translation processing means according to the translation information read by the translation information input means. environment setting means; fixed translation environment setting means for setting the operating environment of the translation processing means to a predetermined one; and translation information replacement means for reflecting the translation information in the translation information registered in the library file, and the translation information checking means determines that the translation information corresponding to the source program specified by the translation instruction is not registered in the library file. In this case, the fixed translation environment setting means sets the operating environment of the translation processing means, the translation processing means translates the source program stored in the library file specified by the translation instruction, and the translation The information area securing means secures a translation information storage area in the library file, the translation information outputting means registers translation information in the translation information storage area secured by the translation information area securing means, and the translation information checking means If it is determined that the translation information corresponding to the source program specified by the translation instruction is registered in the library file, the translation information input means selects the translation information corresponding to the source program specified by the translation instruction registered in the library file. Read translation information corresponding to the source program, set the operating environment of the translation processing means in accordance with the translation information read by the translation information input means in the translation environment setting means, and set the operating environment of the translation processing means in accordance with the translation information specified by the translation instruction in the translation processing means. A source program is translated, and the translation processing means uses the translation information replacement means to convert information indicating the resources necessary when translating the source program specified by the translation instruction to the translation registered in the library file. A program translation method characterized by reflecting information.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2107388A JPH01196630A (en) | 1988-01-30 | 1988-01-30 | Program translating system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2107388A JPH01196630A (en) | 1988-01-30 | 1988-01-30 | Program translating system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH01196630A true JPH01196630A (en) | 1989-08-08 |
Family
ID=12044714
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2107388A Pending JPH01196630A (en) | 1988-01-30 | 1988-01-30 | Program translating system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH01196630A (en) |
-
1988
- 1988-01-30 JP JP2107388A patent/JPH01196630A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| GB2308470A (en) | Bit-width reduction of processor instructions | |
| JP4026940B2 (en) | Program converter | |
| US7624390B2 (en) | Optimizing compiling of object oriented source code | |
| US11068463B2 (en) | System and method for managing log data | |
| CN115098108B (en) | A lightweight context-sensitive pointer analysis method based on higher-order functions | |
| JPH08339298A (en) | Instruction addition method in microprocessor and microprocessor using the same | |
| US6233732B1 (en) | Compiling system using intermediate codes to store a plurality of values | |
| JPH01196630A (en) | Program translating system | |
| US8108828B2 (en) | System for generating optimized computer data field conversion routines | |
| JPH086797A (en) | Constant reference optimization processor | |
| JP2669387B2 (en) | Database driven automatic program generation system | |
| EP1249756B1 (en) | Management of co-processor information by integrating non-program information with program information | |
| JPH01270154A (en) | File converter | |
| JPH04205422A (en) | Program automatic translation combination and selection method | |
| JPH07129408A (en) | Executing system for language processing program | |
| JPH0588908A (en) | Object output system for cross compiler | |
| JPH05151000A (en) | Optimal internal call instruction generation processing method | |
| JPH06266562A (en) | Object code size optimizing system in object-oriented language processing system | |
| JPH03129535A (en) | Collecting volume optimizing system for debugging information | |
| JPH07121414A (en) | File system | |
| JPS6345603A (en) | Program storing system for programmable controller | |
| JPH04330526A (en) | Relocatable assembler | |
| JPH05204699A (en) | Identifier searching system at debugging | |
| JPH0264822A (en) | Error detecting method for file processing | |
| JPH06332719A (en) | Compiler code generating device |