JPS63128438A - Checking method for external procedure calling style of compiler - Google Patents
Checking method for external procedure calling style of compilerInfo
- Publication number
- JPS63128438A JPS63128438A JP61275061A JP27506186A JPS63128438A JP S63128438 A JPS63128438 A JP S63128438A JP 61275061 A JP61275061 A JP 61275061A JP 27506186 A JP27506186 A JP 27506186A JP S63128438 A JPS63128438 A JP S63128438A
- Authority
- JP
- Japan
- Prior art keywords
- external procedure
- call
- calling
- program
- format
- 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 89
- UGDGKPDPIXAUJL-UHFFFAOYSA-N ethyl n-[4-[benzyl(2-phenylethyl)amino]-2-(4-ethylphenyl)-1h-imidazo[4,5-c]pyridin-6-yl]carbamate Chemical compound N=1C(NC(=O)OCC)=CC=2NC(C=3C=CC(CC)=CC=3)=NC=2C=1N(CC=1C=CC=CC=1)CCC1=CC=CC=C1 UGDGKPDPIXAUJL-UHFFFAOYSA-N 0.000 abstract 2
- 238000010586 diagram Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明はコンピュータプログラムのコンパイラによる検
査方法に関し、特にコンピュータプログラムに含まれる
外部手続呼出しの呼出し形式を検査するコンパイラの外
部手続呼出し形式検査方法に関する。[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a method for checking a computer program using a compiler, and more particularly to a method for checking the format of an external procedure call by a compiler for checking the calling format of an external procedure call included in a computer program. .
プログラム言語のうちには、ソースプログラム(以下単
にソースと称す)中に記述する外部手続呼出しの形式を
、同一外部手続に対しては同一の呼出し形式を用いなけ
ればならないものがある。Some programming languages require the same external procedure call format to be written in a source program (hereinafter simply referred to as source) for the same external procedure.
従って、そのようなプログラム言語で作成されたソース
中に、同一外部手続を異なる形式の外部手続呼出しで呼
出す記述が為されているときは記述誤りであるので、プ
ログラム作成者に通知する必要がある。この為、従来に
おいては、外部手続に対する呼出し形式をプログラムラ
イブラリに予め登録しておき、ソースをコンパイルする
過程でソース中に外部手続の呼出し記述があると、コン
パイラにおいて、その記述された外部手続の呼出し形式
がプログラムライブラリに登録された同一外部手続の呼
出し形式と整合しているが否がを検査させ、不整合の場
合は、エラーメツセージを出力するようにしていた。Therefore, if a source created in such a programming language contains a description that calls the same external procedure using a different format of external procedure call, this is a writing error and the program creator must be notified. . For this reason, in the past, the calling format for external procedures was registered in the program library in advance, and when there was a call description of an external procedure in the source during the process of compiling the source, the compiler would automatically call the external procedure. It is checked whether the calling format matches the calling format of the same external procedure registered in the program library, and if there is a mismatch, an error message is output.
上述したように、従来は、プログラムライブラリに外部
手続に対する呼出し形式を予め登録しておき、プログラ
ムのコンパイル時にプログラムに含まれる外部手続呼出
しの形式とプログラムライブラリに登録されている呼出
し形式とが一致しているか否かを調べることにより、外
部手続呼出しの形式を検査しているため、プログラムラ
イブラリに呼出し形式が登録されていない場合、同じ外
部手続に対する呼出しが複数個存在し、その呼出し形式
がまちまちであったとしてもその誤りをプログラム作成
者に通知することができない問題があった。As mentioned above, conventionally, the call format for external procedures is registered in the program library in advance, and when the program is compiled, the format of the external procedure call included in the program matches the call format registered in the program library. Since the format of the external procedure call is checked by checking whether the external procedure is Even if there were errors, there was a problem in that the program creator could not be notified of the errors.
本発明は前述の如き問題点を解決したものであり、その
目的はプログラムライブラリに呼出し形式が登録されて
いない場合であっても同一外部手続に対する外部手続呼
出しが複数存在する場合は外部手続呼出しの整合性の検
査を行なえるようにすることにある。The present invention solves the above-mentioned problems, and its purpose is to solve the problem of external procedure calls when there are multiple external procedure calls to the same external procedure even if the call format is not registered in the program library. The purpose is to enable consistency checks.
本発明は前述の如き問題点を解決するため、外部手続呼
出しを含むプログラムのコンパイル時に前記外部手続呼
出しによって呼出される外部手続対応の呼出し形式がプ
ログラムライブラリ内に存在しない場合は前記外部手続
呼出しから呼出し形式を生成して前記プログラムライブ
ラリに登録し、
前記外部手続呼出しによって呼出される外部手続対応の
呼出し形式がプログラムライブラリ内に存在している場
合は前記外部手続呼出しの呼出し形式と前記プログラム
ライブラリに登録されている呼出し形式との整合性を検
査し、不整合のときはエラーメツセージを出力するよう
にしたものである。In order to solve the above-mentioned problems, the present invention provides that when a program including an external procedure call is compiled, if there is no call format compatible with the external procedure called by the external procedure call in the program library, Generate a call format and register it in the program library, and if a call format compatible with the external procedure called by the external procedure call exists in the program library, the call format of the external procedure call and the program library. It checks for consistency with the registered calling formats, and outputs an error message if there is a mismatch.
コンパイル対象のプログラム中に、同一外部手続の呼出
し記述が複数個存在し、その外部手続の呼出し形式がコ
ンパイル前にプログラムライブラリ中に登録されていな
かった場合、同一外部手続の最初の呼出し記述にコンパ
イル処理が進んだ時点で、その外部手続呼出しから呼出
し形式が生成されてプログラムライブラリに登録される
。従って、同一外部手続の後続する呼出しにコンパイル
処理が進んだ時点では、その外部手続の呼出し形式がプ
ログラムライブラリに登録されているので、両者の整合
性が検査され、不整合のときはエラーメツセージが出さ
れる。このため、同一外部手続の呼出しに異なる呼出し
形式が用いられていた場合、エラーメツセージを通して
そのことをプログラム作成者に通知することができる。If there are multiple call descriptions of the same external procedure in the program to be compiled, and the call format of the external procedure has not been registered in the program library before compilation, the first call description of the same external procedure is used. When processing progresses, a call format is generated from the external procedure call and registered in the program library. Therefore, when the compilation process progresses to a subsequent call of the same external procedure, since the calling format of that external procedure is registered in the program library, the consistency between the two is checked, and if there is a mismatch, an error message is displayed. Served. Therefore, if different call formats are used to call the same external procedure, the program creator can be notified of this through an error message.
次に、図面を参照して本発明の詳細な説明する。 Next, the present invention will be described in detail with reference to the drawings.
第1図は、本発明の実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the invention.
コンパイラ5は呼出し検査手段6と、呼出し形式登録手
段7とを備えている。プログラムライブラリ9は複数の
呼出し形式10を蓄えることができる。The compiler 5 includes a call checking means 6 and a call format registration means 7. The program library 9 can store a plurality of call types 10.
入力ソース1はコンパイラ5で処理されるプログラムで
あり、定義2と外部手続呼出し3と外部手続呼出し4を
含んでいる。エラーメツセージ8はコンパイラ使用者へ
外部手続呼出しの不整合等を通知するためにコンパイラ
5が出力するメツセージである。Input source 1 is a program processed by compiler 5 and includes definition 2, external procedure call 3, and external procedure call 4. The error message 8 is a message output by the compiler 5 to notify the compiler user of inconsistencies in external procedure calls.
コンパイラ5が入力ソース1をコンパイルする場合を説
明する。入力ソースlは同一の外部手続Fに対する呼出
しとして外部手続呼出し3と外部手続呼出し4とを含ん
でいる。コンパイラ5は入力ソース1をコンパイルする
場合、先ず定義2を処理して定義の情報(例えば、Xは
変数でありBIN(15)のタイプを持つ等)を記憶す
る。入力ソース1のうち実行を定義している部分は記述
されている順に従ってコンパイラ5によって処理され、
外部手続Fに対する呼出しは外部手続呼出し3が先に処
理され、外部手続呼出し4が次に処理される。A case where the compiler 5 compiles the input source 1 will be explained. Input source l includes external procedure call 3 and external procedure call 4 as calls to the same external procedure F. When the compiler 5 compiles the input source 1, it first processes the definition 2 and stores definition information (for example, X is a variable and has a type of BIN (15), etc.). The parts of the input source 1 that define execution are processed by the compiler 5 in the order in which they are written,
Among the calls to external procedure F, external procedure call 3 is processed first, and external procedure call 4 is processed next.
コンパイラ5は外部子VtFに対する外部手続呼出し3
を処理する場合、呼出し検査手段6によって、第2図の
フローチャートに示すように、外部手mFに対する呼出
し形式10がプログラムライブラリ9内に存在するか否
かを調べる(ステップ21)。Compiler 5 makes external procedure call 3 for external child VtF.
When processing , the call checking means 6 checks whether the call format 10 for the external hand mF exists in the program library 9, as shown in the flowchart of FIG. 2 (step 21).
プログラムライブラリ9内に外部子11tFに対する呼
出し形式10が存在していないならば、呼出し形式登録
手段7によって入力ソース1の定義2の定義情報と外部
手続呼出し3とから外部手続の名前とパラメタ数とパラ
メタタイプのリストとを含む第3図に示す外部手続Fに
対する呼出し形式を生成し、プログラムライブラリ9内
の呼出し形式10として登録しくステップ23)、その
後、呼出し形式が登録されていなかったことを通知する
ためにエラーメツセージを出力する。If the call format 10 for the external child 11tF does not exist in the program library 9, the call format registration means 7 determines the name and number of parameters of the external procedure from the definition information of the definition 2 of the input source 1 and the external procedure call 3. A call format for the external procedure F shown in FIG. 3, including a list of parameter types, is generated and registered as the call format 10 in the program library 9 (step 23), and then a notification is sent that the call format has not been registered. output an error message to do so.
従って、外部手続呼出し3に対する処理が行なわれた時
点で外部手続Fに対する呼出し形式が必ずプログラムラ
イブラリ9内の呼出し形式10として登録されることに
なる。Therefore, at the time when external procedure call 3 is processed, the call format for external procedure F is always registered as call format 10 in program library 9.
次に、入力ソース1の外部手続Fに対する外部手続呼出
し4がコンパイラ5によって処理される。Next, the external procedure call 4 to the external procedure F of the input source 1 is processed by the compiler 5.
このときもコンパイラ5は呼出し検査手段6によってそ
の外部手続呼出し4に対応する呼出し形式10がプログ
ラムライブラリ9内に存在するか否かを調べる(ステッ
プ21)。今度は外部手続Fの呼出し形式10が存在す
るので、呼出し検査手段6によって外部手続呼出し4の
呼出し形式とプログラムライブラリ9に登録されている
第3図に示す外部手続呼出し3の呼出し形式との整合性
が検査される(ステップ22)。この場合、外部手続呼
出し4の第2パラメクPのタイプがPTRであるのに対
し、呼出し形式のパラメタタイプのリストの第2パラメ
タYのタイプがBINであるのでコンパイラ5は外部手
続呼出し3,4の何れかに形式の誤りがあると判断して
エラーメツセージ8を出力する。At this time as well, the compiler 5 uses the call checking means 6 to check whether the call format 10 corresponding to the external procedure call 4 exists in the program library 9 (step 21). This time, since the calling format 10 of external procedure F exists, the call checking means 6 matches the calling format of external procedure call 4 with the calling format of external procedure call 3 shown in FIG. 3 registered in the program library 9. The gender is checked (step 22). In this case, the type of the second parameter P of external procedure call 4 is PTR, whereas the type of the second parameter Y in the parameter type list of the call format is BIN, so the compiler 5 It is determined that there is a format error in either of the formats, and error message 8 is output.
以上説明したように、本発明は、同一の外部手続を複数
回呼出しているプログラムをコンパイルする場合、その
外部手続の呼出し形式がコンパイル前にプログラムライ
ブラリに登録されていないと、最初に現れた外部手続呼
出しの呼出し形式がプログラムライブラリに登録され、
以後、その登録された呼出し形式と後続する同一外部手
続の呼出し形式との整合性が検査されるので、同一外部
手続に対し呼出し形式の異なる複数の外部手続呼出しが
含まれていた場合、そのことをエラーメツセージを通し
てプログラム作成者に積極的に通知することができる効
果がある。As explained above, when compiling a program that calls the same external procedure multiple times, if the calling format of the external procedure is not registered in the program library before compilation, the first external procedure that appears The calling format of the procedure call is registered in the program library,
Thereafter, the consistency between the registered call format and the subsequent call format of the same external procedure is checked, so if multiple external procedure calls with different call formats are included for the same external procedure, this will be checked. This has the effect of actively notifying the program creator through error messages.
第1図は本発明の実施例のブロック図、第2図は第1図
のコンパイラ5の呼出し検査手段6と呼出し形式登録手
段7による処理の手順を説明するフローチャート及び、
第3図は呼出し形式登録手段7によって生成される呼出
し形式10の構成例を示す図である。
図において、1・・・入力ソース、2・・・定義、3・
・・外部手続呼出し、4・・・外部手続呼出し、5・・
・コンパイラ、6・・・呼出し検査手段、7・・・呼出
し形式登録手段、8・・・エラーメツセージ、9・・・
プログラムライブラリ、10・・・呼出し形式。FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flowchart explaining the procedure of processing by the call inspection means 6 and call format registration means 7 of the compiler 5 in FIG. 1, and FIG. 3 is a call format. 7 is a diagram showing an example of the configuration of a calling format 10 generated by a registration means 7. FIG. In the figure, 1... input source, 2... definition, 3...
... External procedure call, 4... External procedure call, 5...
- Compiler, 6... Call inspection means, 7... Call format registration means, 8... Error message, 9...
Program library, 10... Calling format.
Claims (1)
外部手続呼出しによって呼出される外部手続対応の呼出
し形式がプログラムライブラリ内に存在しない場合は前
記外部手続呼出しから呼出し形式を生成して前記プログ
ラムライブラリに登録し、 前記外部手続呼出しによって呼出される外部手続対応の
呼出し形式がプログラムライブラリ内に存在している場
合は前記外部手続呼出しの呼出し形式と前記プログラム
ライブラリに登録されている呼出し形式との整合性を検
査し、不整合のときはエラーメッセージを出力すること
を特徴とするコンパイラの外部手続呼出し形式検査方法
。[Claims] When compiling a program including an external procedure call, if a call format compatible with the external procedure called by the external procedure call does not exist in the program library, a call format is generated from the external procedure call and the If a call format compatible with the external procedure that is registered in the program library and is called by the external procedure call exists in the program library, the call format of the external procedure call and the call format registered in the program library are A method for checking the external procedure call format of a compiler, which is characterized by checking the consistency of a compiler and outputting an error message in case of inconsistency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61275061A JPS63128438A (en) | 1986-11-18 | 1986-11-18 | Checking method for external procedure calling style of compiler |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP61275061A JPS63128438A (en) | 1986-11-18 | 1986-11-18 | Checking method for external procedure calling style of compiler |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS63128438A true JPS63128438A (en) | 1988-06-01 |
Family
ID=17550298
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP61275061A Pending JPS63128438A (en) | 1986-11-18 | 1986-11-18 | Checking method for external procedure calling style of compiler |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS63128438A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03271935A (en) * | 1990-03-20 | 1991-12-03 | Nec Corp | Program constitution definition system |
-
1986
- 1986-11-18 JP JP61275061A patent/JPS63128438A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH03271935A (en) * | 1990-03-20 | 1991-12-03 | Nec Corp | Program constitution definition system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH01201753A (en) | Asn.1 information data system | |
JPS63128438A (en) | Checking method for external procedure calling style of compiler | |
JPH09288580A (en) | Device and method for optimizing source program | |
JP4152752B2 (en) | Data consistency check device and data consistency check method | |
JPS58144913A (en) | Circuit diagram producing and output device for user program of programmable controller | |
JP2002312167A (en) | Program for making computer calculate value of variable, compile program, variable value determining method, and program generating method | |
JPH01177165A (en) | Definition-quotation relation checking system for array | |
JPH02205930A (en) | Interface check processing method | |
JPH02151932A (en) | External name version check system at linking | |
JPH05150960A (en) | Precompiler | |
JPH0340138A (en) | Batch control system for source error program | |
JPH02197935A (en) | Output system for application state of control table | |
JPH01226038A (en) | Automatic forming method for test program | |
JPH03152628A (en) | Control system for program compiling error in decentralized processing system | |
JPH03230228A (en) | Output system for program error | |
JPH04330521A (en) | Cross reference list forming system | |
JPH04273523A (en) | Code preparing device | |
JPS62135958A (en) | Simulation system | |
JPH08249193A (en) | Checking system for language specification range of program | |
JPH0359724A (en) | Error information compression system for translation system | |
JPH04177534A (en) | Undefined name mark error processing system | |
JPH04312130A (en) | Language processing program | |
JPH03156641A (en) | Compiling process system | |
JPH0264744A (en) | Fault analyzing information acquiring system | |
JPH04273328A (en) | Generation system for cross-reference list |