JPS63128438A - Checking method for external procedure calling style of compiler - Google Patents

Checking method for external procedure calling style of compiler

Info

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
Application number
JP61275061A
Other languages
Japanese (ja)
Inventor
Hiroshi Takeuchi
寛 竹内
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 JP61275061A priority Critical patent/JPS63128438A/en
Publication of JPS63128438A publication Critical patent/JPS63128438A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To realize check of matching properties between a registered calling style and the subsequent calling styles of the same external procedure, by registering the final external procedure calling style into a program library if no external procedure calling style is registered in the program library. CONSTITUTION:Plural calling descriptions of the same external procedure are stored in a program to be compiled and the external procedure calling style is not registered in a program library 9 before the program is compiled. In such a case, a calling style is produced from the external calling procedure and registered in the library 9 when the program compiling process proceeds to the first calling description of the same external procedure. Thus the calling style of the external procedure is registered into the library 9 when said compiling process proceeds to the subsequent calling of the same external procedure. Thus the matching properties are checked between both calling styles. Then an error message 8 is informed to the program producer when no matching is secured between both calling styles.

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. .

〔従来の技術〕[Conventional technology]

プログラム言語のうちには、ソースプログラム(以下単
にソースと称す)中に記述する外部手続呼出しの形式を
、同一外部手続に対しては同一の呼出し形式を用いなけ
ればならないものがある。
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.

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

上述したように、従来は、プログラムライブラリに外部
手続に対する呼出し形式を予め登録しておき、プログラ
ムのコンパイル時にプログラムに含まれる外部手続呼出
しの形式とプログラムライブラリに登録されている呼出
し形式とが一致しているか否かを調べることにより、外
部手続呼出しの形式を検査しているため、プログラムラ
イブラリに呼出し形式が登録されていない場合、同じ外
部手続に対する呼出しが複数個存在し、その呼出し形式
がまちまちであったとしてもその誤りをプログラム作成
者に通知することができない問題があった。
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.

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

本発明は前述の如き問題点を解決するため、外部手続呼
出しを含むプログラムのコンパイル時に前記外部手続呼
出しによって呼出される外部手続対応の呼出し形式がプ
ログラムライブラリ内に存在しない場合は前記外部手続
呼出しから呼出し形式を生成して前記プログラムライブ
ラリに登録し、 前記外部手続呼出しによって呼出される外部手続対応の
呼出し形式がプログラムライブラリ内に存在している場
合は前記外部手続呼出しの呼出し形式と前記プログラム
ライブラリに登録されている呼出し形式との整合性を検
査し、不整合のときはエラーメツセージを出力するよう
にしたものである。
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.

〔作用〕[Effect]

コンパイル対象のプログラム中に、同一外部手続の呼出
し記述が複数個存在し、その外部手続の呼出し形式がコ
ンパイル前にプログラムライブラリ中に登録されていな
かった場合、同一外部手続の最初の呼出し記述にコンパ
イル処理が進んだ時点で、その外部手続呼出しから呼出
し形式が生成されてプログラムライブラリに登録される
。従って、同一外部手続の後続する呼出しにコンパイル
処理が進んだ時点では、その外部手続の呼出し形式がプ
ログラムライブラリに登録されているので、両者の整合
性が検査され、不整合のときはエラーメツセージが出さ
れる。このため、同一外部手続の呼出しに異なる呼出し
形式が用いられていた場合、エラーメツセージを通して
そのことをプログラム作成者に通知することができる。
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.

〔実施例〕〔Example〕

次に、図面を参照して本発明の詳細な説明する。 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.

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

以上説明したように、本発明は、同一の外部手続を複数
回呼出しているプログラムをコンパイルする場合、その
外部手続の呼出し形式がコンパイル前にプログラムライ
ブラリに登録されていないと、最初に現れた外部手続呼
出しの呼出し形式がプログラムライブラリに登録され、
以後、その登録された呼出し形式と後続する同一外部手
続の呼出し形式との整合性が検査されるので、同一外部
手続に対し呼出し形式の異なる複数の外部手続呼出しが
含まれていた場合、そのことをエラーメツセージを通し
てプログラム作成者に積極的に通知することができる効
果がある。
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.

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

第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.
JP61275061A 1986-11-18 1986-11-18 Checking method for external procedure calling style of compiler Pending JPS63128438A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03271935A (en) * 1990-03-20 1991-12-03 Nec Corp Program constitution definition system

Cited By (1)

* Cited by examiner, † Cited by third party
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