JPS63201726A - Reference procedure name decision processing system - Google Patents
Reference procedure name decision processing systemInfo
- Publication number
- JPS63201726A JPS63201726A JP3429787A JP3429787A JPS63201726A JP S63201726 A JPS63201726 A JP S63201726A JP 3429787 A JP3429787 A JP 3429787A JP 3429787 A JP3429787 A JP 3429787A JP S63201726 A JPS63201726 A JP S63201726A
- Authority
- JP
- Japan
- Prior art keywords
- procedure
- name
- procedure name
- user
- 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
- 238000000034 method Methods 0.000 title claims abstract description 103
- 238000013519 translation Methods 0.000 claims abstract description 18
- 238000004458 analytical method Methods 0.000 claims abstract description 7
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- YASYVMFAVPKPKE-UHFFFAOYSA-N acephate Chemical compound COP(=O)(SC)NC(C)=O YASYVMFAVPKPKE-UHFFFAOYSA-N 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、コンパイラによる、手続き引用時の手続き名
の判定処理方式に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a processing method for determining a procedure name when a procedure is cited by a compiler.
(従来の技術)
従来は、高級プログラミング言語に組込まれた手続き(
以下、組込み手続きと呼ぶ。)の名称(以下、組込み手
続き名と呼ぶ。)は、その組込み手続き名を利用者が作
成した手続き(以下、利用者手続きと呼ぶ。)の名称(
以下、利用者手続き名と呼ぶ。)として使用することが
原始プログラム中で予め宣言されている場合を除いて、
コンパイラにより組込み手続き名と判定され翻訳される
。(Prior art) Conventionally, procedures (
Hereinafter, this will be referred to as a built-in procedure. ) (hereinafter referred to as the built-in procedure name) is the name of the procedure created by the user (hereinafter referred to as the user procedure).
Hereinafter, this will be referred to as the user procedure name. ) unless previously declared in the source program to be used as
The compiler identifies it as an intrinsic procedure name and translates it.
(発明が解決しようとする問題点)
従って、従来の方式では、例えば高級プログラミング言
語に組込み手続き名を新たに追加したとき、既に作成さ
れている原始プログラム中にこの新たに追加された組込
み手続き名と偶然に同じ名称の利用者手続き名が引用さ
れている場合は、新たに追加された組込み手続き名と同
名の手続き名が利用者手続きであることを原始プログラ
ム中で宣言しておかないと、すなわち原始プログラムを
修正しなければその組込み手続き名と同名の利用者手続
き名は組込み手続き名と判定され、本来利用者手続きが
呼び出されるべきところで組込み手続きを呼び出す目的
プログラムが作成されるという欠点がある。(Problem to be Solved by the Invention) Therefore, in the conventional method, for example, when a new intrinsic procedure name is added to a high-level programming language, the newly added intrinsic procedure name is added to the already created source program. If a user procedure name with the same name is accidentally quoted, it is necessary to declare in the source program that the procedure name with the same name as the newly added built-in procedure name is a user procedure. In other words, unless the source program is modified, a user procedure name with the same name as the built-in procedure name will be determined to be a built-in procedure name, and a target program will be created that calls the built-in procedure where the user procedure should originally be called. .
(問題を解決するための手段)
本発明引用手続き名の判定処理方式は、高級プログラミ
ング言語で記述された原始プログラムを入力して機械コ
ードに翻訳し、目的プログラムを生成するコンパイラに
おいて、前記高級プログラミング言語に組込まれた組込
み手続きの手続き名であって、前記原始プログラム中に
おいて利用者が作成する利用者手続きの名称として翻訳
すべき手続き名を指示する翻訳時オプションを入力し、
その翻訳時オプションを解析して利用者手続き名として
翻訳すべき前記組込み手続き名を抜きだし登録する翻訳
時オプション解析手段と、前記原始プログラムを入力し
、この原始プログラムの構文解析処理に当って、前記手
段で得られ登録された手続き名の引用が前記構文中に現
れると、その手続き名を利用者手続き名と判定し翻訳す
る原始プログラム解析手段とを有することを特徴とする
。(Means for Solving the Problem) The cited procedure name determination processing method of the present invention is a compiler that inputs a source program written in a high-level programming language, translates it into machine code, and generates a target program. inputting a translation option that instructs the procedure name of a built-in procedure built into the language, which should be translated as the name of a user procedure created by the user in the source program;
a translation option analysis means for analyzing the translation options and extracting and registering the built-in procedure name to be translated as a user procedure name, inputting the source program and parsing the source program; The present invention is characterized by comprising source program analysis means for determining and translating the procedure name as a user procedure name when a reference to the procedure name obtained and registered by the means appears in the syntax.
(実施例)
次に本発明の一実施例について第1図ないし第3図の図
面を参照して説明する。(Embodiment) Next, an embodiment of the present invention will be described with reference to the drawings of FIGS. 1 to 3.
第1図は本発明の一実施例の機能を表わすブロック図で
ある。FIG. 1 is a block diagram showing the functions of one embodiment of the present invention.
第1図に示すように、本実施例では翻訳時オプション解
析手段10で得られた手続き名は利用者手続き名登録領
域100に格納される。翻訳時オプション解析手段10
は、利用者手続き名として翻訳すべき組込み手続き名を
指示する翻訳時オプション1を入力して解析し、その中
から利用者手続き名と判定すべき手続き名を抜きだし、
利用者手続き名登録領域100に格納チる。原始プログ
ラム解析手段20は、原始プログラム3を入力してその
構文解析を行う。原始プログラム3の構文中に組込み手
続きの引用が現れると、利用者手続き名登録領域100
を検索し、その手続き名が利用者手続き名登録領域10
0にあれば利用者手続き名と判定し、その手続き名が利
用者手続き名登録領域100になければ組込み手続き名
と判定する。目的プログラム生成手段30は、原始プロ
グラム解析手段20から与えられた情報に基づき、手続
きが組込み手続きならば組込み手続きを呼び出す目的プ
ログラムを生成し、手続きが利用者手続きならば利用者
手続きを呼び出す目的プログラムを生成する。As shown in FIG. 1, in this embodiment, the procedure name obtained by the translation option analysis means 10 is stored in a user procedure name registration area 100. Translation option analysis means 10
inputs and parses option 1 at the time of translation, which specifies the built-in procedure name to be translated as the user procedure name, extracts the procedure name that should be determined as the user procedure name,
It is stored in the user procedure name registration area 100. The source program analysis means 20 inputs the source program 3 and analyzes its syntax. When a reference to a built-in procedure appears in the syntax of the source program 3, the user procedure name registration area 100
, and the procedure name is registered in the user procedure name registration area 10.
If it is 0, it is determined to be a user procedure name, and if the procedure name is not in the user procedure name registration area 100, it is determined to be a built-in procedure name. Based on the information given from the source program analysis means 20, the object program generation means 30 generates an object program that calls the built-in procedure if the procedure is an embedded procedure, and generates an object program that calls the user procedure if the procedure is a user procedure. generate.
第2図は、FORTRAN言語で記述された原始プログ
ラムの一例である。FIG. 2 is an example of a source program written in the FORTRAN language.
同図(a)に示すように、原始プログラム300は、F
ORTRAN言語の組込み手続きであるSIN関数を引
用している組込み手続き引用文310と、利用者手続き
であるDATEサブルーチンを引用している利用者手続
き引用文320と、利用者手続きであるTIMEサブル
ーチンを引用している利用者手続き引用文330とを含
む原始プログラムである。この原始プログラム300の
DATE及びTIMEサブルーチンをFORTRAN言
語の組込み手続きとして翻訳するコンパイラで翻訳する
場合、第2図(b)の原始プログラム400に示すよう
にDATE及びTIMEサブルーチンが利用者手続きで
あることを宣言する利用者手続き宣言文410を挿入し
て原始プログラムを修正しなければならない。しかし、
本発明によれば、翻訳時オプションで手続き名DATE
及びTIMEが利用者手続き名であることを予め指定す
るから、上記のような原始プログラムの修正は不要であ
る。 第3図に示すのは、本発明を実施する場合の利用
者手続き名情報の一登録例である。As shown in FIG. 3(a), the source program 300 is F
A built-in procedure quotation statement 310 quoting the SIN function, which is an intrinsic procedure of the ORTRAN language, a user procedure quotation statement 320, which cites the DATE subroutine, which is a user procedure, and a TIME subroutine, which is a user procedure. This is a source program that includes a user procedure quotation 330. When the DATE and TIME subroutines of this source program 300 are translated by a compiler that translates them as built-in procedures in the FORTRAN language, it is necessary to understand that the DATE and TIME subroutines are user procedures, as shown in the source program 400 of FIG. 2(b). The source program must be modified by inserting the user procedure declaration statement 410 to be declared. but,
According to the present invention, the procedure name DATE can be set as an option at the time of translation.
Since it is specified in advance that and TIME are user procedure names, there is no need to modify the source program as described above. FIG. 3 shows an example of registration of user procedure name information when implementing the present invention.
第1図で示した実施例を例にとれば、手続き名DATE
及びTIMEが利用者手続き名であることを示す翻訳時
オプション1を翻訳時オプション解析手段10で解析し
、得られた手続き名であるDATE及びTIMEの手続
き名に関する情報を利用者手続き名登録領域100に格
納する。Taking the example shown in Figure 1 as an example, the procedure name DATE
Translation time option 1 indicating that , and TIME are user procedure names is analyzed by translation time option analysis means 10, and information regarding the procedure name of DATE and TIME, which are the obtained procedure names, is stored in user procedure name registration area 100. Store in.
(発明の効果)
このように、本発明では、高級プログラミング言語の組
込み手続きである手続き名を利用者手続き名として翻訳
することを翻訳時のオプションにより指定すれば、原始
プログラムの修正を行わずにコンパイラが組込み手続き
名を利用者手続き名と判定し翻訳することができる。(Effects of the Invention) As described above, in the present invention, if the option at the time of translation specifies that a procedure name that is a built-in procedure of a high-level programming language is to be translated as a user procedure name, the source program can be translated without modifying the source program. The compiler can determine the built-in procedure name as a user procedure name and translate it.
第1図は、本発明の一実施例の機能を示すブロック図で
ある。第2図はFORTRAN言語で記述された原始プ
ログラムを示す図面であって、同図(a)は修正前、同
図(b)は修正後をそれぞれ示す。第3図は本発明にお
ける利用者手続き名登録領域の一例を示す図である。
1・・・翻訳時オプション、2・・・コンパイラ、3・
・・原始プログラム、4・・・目的プログラム、10・
・・翻訳時オプション解析手段、20・・・原始プログ
ラム解析手段、30・・・目的プログラム生成手段、1
00・・・利用者手続き名登録領域、300・・・FO
RTRAN原始プログラム、310・・・組込み手続き
引用文、320・・・利用者手続き引用文、330・・
・利用者手続き引用文、400・・・FORTRANN
始プログラム、410・・・利用者手続き宣言文。FIG. 1 is a block diagram showing the functions of one embodiment of the present invention. FIG. 2 is a diagram showing a source program written in the FORTRAN language, in which (a) shows the program before modification, and (b) shows it after modification. FIG. 3 is a diagram showing an example of a user procedure name registration area in the present invention. 1... Compilation time options, 2... Compiler, 3.
...Original program, 4...Objective program, 10.
... Translation option analysis means, 20... Source program analysis means, 30... Target program generation means, 1
00...User procedure name registration area, 300...FO
RTRAN source program, 310...Built-in procedure reference text, 320...User procedure reference text, 330...
・User procedure quotation, 400...FORTRANN
Start program, 410...User procedure declaration statement.
Claims (1)
入力して機械コードに翻訳し、目的プログラムを生成す
るコンパイラにおいて、 前記高級プログラミング言語に組込まれた組込み手続き
の手続き名であって、前記原始プログラム中において利
用者が作成する利用者手続きの名称として翻訳すべき手
続き名を指示する翻訳時オプションを入力し、その翻訳
時オプションを解析して利用者手続き名として翻訳すべ
き前記組込み手続き名を抜きだし登録する翻訳時オプシ
ョン解析手段と、 前記原始プログラムを入力し、この原始プログラムの構
文解析処理に当って、前記手段で得られ登録された手続
き名の引用が前記構文中に現れると、その手続き名を利
用者手続き名と判定し翻訳する原始プログラム解析手段
とを有することを特徴とする引用手続き名判定処理方式
。[Claims] In a compiler that inputs a source program written in a high-level programming language, translates it into machine code, and generates a target program, a procedure name of an intrinsic procedure incorporated in the high-level programming language, The built-in procedure that inputs a translation option that indicates a procedure name to be translated as the name of a user procedure created by the user in the source program, analyzes the translation option, and translates it as the user procedure name. a translation option analysis means for extracting and registering a procedure name; inputting the source program; and upon parsing the syntax of the source program, if a quotation of the procedure name obtained and registered by the means appears in the syntax; , and source program analysis means for determining and translating the procedure name as a user procedure name.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3429787A JPS63201726A (en) | 1987-02-17 | 1987-02-17 | Reference procedure name decision processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3429787A JPS63201726A (en) | 1987-02-17 | 1987-02-17 | Reference procedure name decision processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS63201726A true JPS63201726A (en) | 1988-08-19 |
Family
ID=12410222
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3429787A Pending JPS63201726A (en) | 1987-02-17 | 1987-02-17 | Reference procedure name decision processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS63201726A (en) |
-
1987
- 1987-02-17 JP JP3429787A patent/JPS63201726A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR20090011974A (en) | Method for extracting the target files of compilation | |
JPS63201726A (en) | Reference procedure name decision processing system | |
JPH01277934A (en) | Switching system for parameter list reference method | |
JPH09218789A (en) | Division compiling system | |
JPS63276128A (en) | Processing system for decision of procedure name by file input | |
KR100290623B1 (en) | A method of controlling data of database | |
JP2002082811A (en) | Compiling method and recording medium | |
JPH06242958A (en) | Compilation system | |
JPS63262726A (en) | Translation processing system for designated program | |
JP2001125793A (en) | Compiler system, compile method and recording medium | |
JPH05197561A (en) | Compilation system | |
JPS62166432A (en) | Control system for program translation | |
JPH08194624A (en) | Executing form program preparing method | |
JP2607975B2 (en) | Debug method | |
JPH06314221A (en) | Compiling system | |
JPH01211120A (en) | Syntax analyzing processing method | |
JPH0358232A (en) | Preprocessor calling system | |
JPH0659904A (en) | Method for analyzing term in program | |
KR950015127A (en) | CHILL Separate Compilation Method | |
JPH0573330A (en) | Syntax analysis processing system | |
JPH01286037A (en) | Source file updating time automatic recognition compiling system | |
JPH0488531A (en) | Code optimizing system | |
JPH03142630A (en) | Program compiling time shortening system | |
JPH01144127A (en) | Interpreter system | |
JPH05204699A (en) | Identifier searching system at debugging |