JPH03201136A - Procedure accessing source/accessed destination parameter checking system - Google Patents

Procedure accessing source/accessed destination parameter checking system

Info

Publication number
JPH03201136A
JPH03201136A JP1342722A JP34272289A JPH03201136A JP H03201136 A JPH03201136 A JP H03201136A JP 1342722 A JP1342722 A JP 1342722A JP 34272289 A JP34272289 A JP 34272289A JP H03201136 A JPH03201136 A JP H03201136A
Authority
JP
Japan
Prior art keywords
procedure
parameter
parameters
checking
parameter information
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
JP1342722A
Other languages
Japanese (ja)
Inventor
Hisao Yamashita
久夫 山下
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 JP1342722A priority Critical patent/JPH03201136A/en
Publication of JPH03201136A publication Critical patent/JPH03201136A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To prevent the omission of checking parameters and to reduce manhour for checking by providing a compiler with an accessing source parameter information output means and an input parameter information check adding means. CONSTITUTION:At the time of detecting a procedure access, the accessing source parameter information output means 4 in the compiler 2 adds a procedure name to be accessed, the number of parameters and individual parameter types to a parameter list 6 and outputs the contents of the list 6 to an object file 3. At the time of detecting the procedure, the input parameter information check adding means 5 refers to the list 6 based upon procedure input parameter definition information and outputs an input parameter information checking object code 7 for checking a subroutine name, the number of parameters and the individual parameter types to the file 3. Consequently, whether the number of parameters and the parameter types of the accessing source coincide with that of the body side or not can be automatically checked at the time of executing a program.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は手続きの呼出し元/呼出し先パラメータチェッ
ク方式に関し、特にソースプログラムをコンパイルする
コンパイラにおいてサブルーチンや関数などの手続きの
呼出し元および呼出し先のパラメータをチェックする手
続きの呼出し元/呼出し先パラメータチェック方式に関
する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a procedure caller/callee parameter checking method, and in particular, a method for checking caller/callee parameters of a procedure such as a subroutine or function in a compiler that compiles a source program. This invention relates to a method for checking caller/callee parameters of a procedure that checks parameters.

〔従来の技術〕[Conventional technology]

従来の技術では、Ada等のように手続きの呼出し元の
パラメータと手続き本体のパラメータとが一致している
かどうかをチェックしているコンパイラを除くコンパイ
ラを使用する場合には、呼出し元のプログラムでの手続
きへのパラメータ数および個々のパラメータの型と、手
続き本体側で定義された入力パラメータ数および個々の
パラメータの型とが一致しているかどうかのチェックは
、人間の目視チェックによって行われていた。
In conventional technology, when using a compiler other than a compiler such as Ada that checks whether the parameters of the procedure caller and the parameters of the procedure body match, the Checking whether the number of parameters to the procedure and the type of each parameter match the number of input parameters and the type of each parameter defined in the procedure body was performed by a human visual check.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来の手続きの呼出し元/呼出し先パラメータ
チェック方式では、呼出し元のプログラムでの手続きへ
のパラメータ数および個々のパラメータの型と、手続き
本体側で定義された入力パラメータ数および個々のパラ
メータの型とが一致しているかどうかのチェックが人間
の目視チェックによって行われていたので、チェックも
れが発生するとともにチェックのための工数がかかると
いう欠点がある。
In the conventional procedure caller/callee parameter checking method described above, the number of parameters to the procedure in the calling program and the type of each parameter, the number of input parameters defined in the procedure body side, and the type of each parameter are checked. Since the check to see if it matches the type has been done by human visual inspection, there are disadvantages in that the check may be overlooked and it takes a lot of man-hours for the check.

本発明の目的は、上述の点に鑑み、プログラムにおける
手続きの呼出し元のパラメータ数およびパラメータの型
と手続き本体側のパラメータ数およびパラメータの型と
が一致しているかどうかをプログラムの実行時に自動的
にチェックできるようにした手続きの呼出し元/呼出し
先パラメータチェック方式を提供することにある。
In view of the above-mentioned points, it is an object of the present invention to automatically check at the time of program execution whether the number of parameters and parameter types of the procedure caller in a program match the number of parameters and parameter types of the procedure body. The object of the present invention is to provide a method for checking the caller/callee parameters of a procedure.

〔課題を解決するための手段〕[Means to solve the problem]

本発明の手続きの呼出し元/呼出し先パラメータチェッ
ク方式は、ソースプログラムをコンパイルするコンパイ
ラにおいて、手続きの呼出しを検出したときに呼び出す
手続き名、パラメータ数および個々のパラメータの型を
パラメータリストに付加してオブジェクトファイルに出
力する呼出し元パラメータ情報出力手段と、手続きを検
出したときに該手続きの入力パラメータ定義情報に基づ
いて前記パラメータリストを参照してサブルーチン名、
パラメータ数および個々のパラメータの型をチェックす
るためのオブジェクトコードを前記オブジェクトファイ
ルに出力する入力パラメータ情報チェック付加手段とを
有する。
The procedure caller/callee parameter checking method of the present invention adds the name of the procedure to be called, the number of parameters, and the type of each parameter to the parameter list when a call to the procedure is detected in the compiler that compiles the source program. a caller parameter information output means to output to an object file; and when a procedure is detected, the subroutine name is determined by referring to the parameter list based on the input parameter definition information of the procedure;
and input parameter information check addition means for outputting an object code for checking the number of parameters and the type of each parameter to the object file.

〔作用〕[Effect]

本発明の手続きの呼出し元/呼出し先パラメータチェッ
ク方式では、呼出し元パラメータ情報出力手段が手続き
の呼出しを検出したときに呼び出す手続き名、パラメー
タ数および個々のパラメータの型をパラメータリストに
付加してオブジェクトファイルに出力し、入力パラメー
タ情報チェック付加手段が手続きを検出したときに該手
続きの入力パラメータ定義情報に基づいてパラメータリ
ストを参照してサブルーチン名、パラメータ数および個
々のパラメータの型をチェックするためのオブジェクト
コードをオブジェクトファイルに出力する。
In the procedure caller/callee parameter checking method of the present invention, when the caller parameter information output means detects a call to a procedure, it adds the name of the procedure to be called, the number of parameters, and the type of each parameter to the parameter list and creates an object. Output to a file, and when the input parameter information check addition means detects a procedure, refer to the parameter list based on the input parameter definition information of the procedure and check the subroutine name, number of parameters, and type of each parameter. Output object code to an object file.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は、本発明の一実施例に係る手続きの呼出し元/
呼出し先パラメータチェック方式の構成を示すブロフク
図である0本実施例の手続きの呼出し元/呼出し先パラ
メータチェック方式は、手続きの呼出し文および手続き
の記述文を有するソースプログラム1と、呼出し元パラ
メータ情報出力手段4および人力パラメータ情報チェッ
ク付加手段5を含むコンパイラ2と、パラメータリスト
6および入力パラメータ情報チェック用オブジェクトコ
ード7が出力されるオブジェクトファイル3とから構成
されている。
FIG. 1 shows the procedure caller/
This is a block diagram illustrating the configuration of a callee parameter checking method. The procedure caller/callee parameter check method of this embodiment uses a source program 1 having a procedure call statement and a procedure description statement, and caller parameter information. It consists of a compiler 2 including an output means 4 and a manual parameter information check addition means 5, and an object file 3 from which a parameter list 6 and an object code 7 for checking input parameter information are output.

次に、このように構成された本実施例の手続きの呼出し
元/呼出し先パラメータチェック方式の動作について説
明する。
Next, the operation of the method for checking the caller/callee parameters of the procedure in this embodiment configured as described above will be explained.

ソースプログラムlをコンパイルするときに、コンパイ
ラ2は、手続きの呼出し文を検出したならば、呼出し元
パラメータ情報出力手段4を用いて、呼び出す手続き名
、パラメータ数9個々のパラメータの型等をパラメータ
リスト6に付加してオブジェクトファイル3に出力する
When compiling the source program l, if the compiler 2 detects a procedure call statement, it uses the call source parameter information output means 4 to display the name of the procedure to be called, the number of parameters 9, the type of each parameter, etc. in a parameter list. 6 and output to object file 3.

また、コンパイラ2は、手続きを検出したならば、入力
パラメータ情報チェック付加手段5を用いて、手続きの
入力パラメータ定義情報に基づいて、パラメータリスト
6を参照してサブルーチン名、パラメータ数2個々のパ
ラメータの型等をチェックするための入力パラメータ情
報チェック用オブジェクトコード7をオブジェクトファ
イル3に出力する。
In addition, when the compiler 2 detects a procedure, the compiler 2 uses the input parameter information check addition means 5 to refer to the parameter list 6 based on the input parameter definition information of the procedure and determine the subroutine name, number of parameters 2, and individual parameters. An input parameter information checking object code 7 for checking the type, etc. of is output to the object file 3.

このため、コンパイルされた単数または複数のプログラ
ムをリンクして実行すると、パラメータリスト6に設定
された手続き名、パラメータ数。
Therefore, when one or more compiled programs are linked and executed, the procedure name and number of parameters set in the parameter list 6 are displayed.

個々のパラメータの型等と、入力パラメータ情報チェッ
ク用オブジェクトコード7中の手続き名。
Types of individual parameters, etc., and procedure names in the object code 7 for checking input parameter information.

パラメータ数1個々のパラメータの型等とにより、呼出
し元のパラメータ数、パラメータの型等とすブルーチン
本体側のパラメータ数、パラメータの型等とが一致して
いるかどうかがチェックされる。
Number of Parameters 1 It is checked whether the number of parameters, type of parameters, etc. of the calling source matches the number of parameters, type of parameters, etc. of the broutine main body, depending on the type of each parameter.

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

以上説明したように本発明は、コンパイラに呼出し元パ
ラメータ情報出力手段および入力パラメータ情報チェッ
ク付加手段を設け、呼出し元のパラメータ情報をパラメ
ータリストに付加してオブジェクトファイルに出力し、
手続きのパラメータ数および個々のパラメータの型をチ
ェックするためのオブジェクトコードをオブジェクトフ
ァイルに出力しておくことにより、プログラムの実行時
に手続きの呼出し元のパラメータ数および個々のパラメ
ータの型と手続き本体側で定義されたパラメータ数およ
び個々のパラメータの型とが一致しているかどうかを自
動的にチェックすることができ、チェックもれが生じな
いとともにチェックのための工数が少な(てすむという
効果がある。
As explained above, the present invention provides a compiler with a caller parameter information output means and an input parameter information check addition means, adds caller parameter information to a parameter list, and outputs it to an object file.
By outputting object code for checking the number of parameters of a procedure and the types of individual parameters to an object file, you can check the number of parameters of the procedure caller, the types of individual parameters, and the procedure body when the program is executed. It is possible to automatically check whether the number of defined parameters and the types of individual parameters match, which has the effect of not omitting any checks and reducing the number of man-hours required for checking.

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

第1図は本発明の一実施例に係る手続きの呼出し元/呼
出し先パラメータチェック方式の構成を示すブロック図
である。 図において、 l・・・ソースプログラム、 2・・・コンパイラ、 3・・・オブジェクトファイル、 4・・・呼出し元パラメータ情報出力手段、5・・・入
力パラメータ情報チェック付加手段、6・・・パラメー
タリスト、 7・・・人力パラメータ情報チェック用オブジェクトコ
ードである。
FIG. 1 is a block diagram showing the configuration of a procedure caller/callee parameter checking method according to an embodiment of the present invention. In the figure, l... source program, 2... compiler, 3... object file, 4... calling source parameter information output means, 5... input parameter information check addition means, 6... parameters List, 7...Object code for checking human parameter information.

Claims (1)

【特許請求の範囲】 ソースプログラムをコンパイルするコンパイラにおいて
、 手続きの呼出しを検出したときに呼び出す手続き名、パ
ラメータ数および個々のパラメータの型をパラメータリ
ストに付加してオブジェクトファイルに出力する呼出し
元パラメータ情報出力手段と、 手続きを検出したときに該手続きの入力パラメータ定義
情報に基づいて前記パラメータリストを参照してサブル
ーチン名、パラメータ数および個々のパラメータの型を
チェックするためのオブジェクトコードを前記オブジェ
クトファイルに出力する入力パラメータ情報チェック付
加手段とを有することを特徴とする手続きの呼出し元/
呼出し先パラメータチェック方式。
[Claims] In a compiler that compiles a source program, when a call to a procedure is detected, the name of the procedure to be called, the number of parameters, and the type of each parameter are added to a parameter list and the caller parameter information is output to an object file. an output means, and an object code for checking the subroutine name, number of parameters, and type of each parameter by referring to the parameter list based on input parameter definition information of the procedure when a procedure is detected, in the object file. A caller of a procedure, characterized in that it has an output input parameter information check addition means.
Call destination parameter checking method.
JP1342722A 1989-12-28 1989-12-28 Procedure accessing source/accessed destination parameter checking system Pending JPH03201136A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1342722A JPH03201136A (en) 1989-12-28 1989-12-28 Procedure accessing source/accessed destination parameter checking system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1342722A JPH03201136A (en) 1989-12-28 1989-12-28 Procedure accessing source/accessed destination parameter checking system

Publications (1)

Publication Number Publication Date
JPH03201136A true JPH03201136A (en) 1991-09-03

Family

ID=18355986

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1342722A Pending JPH03201136A (en) 1989-12-28 1989-12-28 Procedure accessing source/accessed destination parameter checking system

Country Status (1)

Country Link
JP (1) JPH03201136A (en)

Similar Documents

Publication Publication Date Title
CA2284248A1 (en) System for creating, editing, displaying, and executing rules-based programming language rules having action part subsets for both true and false evaluation of the conditional part
JPH0748182B2 (en) Program error detection method
JPH03201136A (en) Procedure accessing source/accessed destination parameter checking system
JPH0736734A (en) Method for checking argument value
JPS6378231A (en) Partial program combining system
JP2568863B2 (en) Debug information output control method and device
JPH02240743A (en) Checking system for call/called parameter of subroutine
JPH01177165A (en) Definition-quotation relation checking system for array
JPS63147232A (en) Inspection system for matchability
JPH02206838A (en) Common sub routine linking method
JPH03154132A (en) In-circuit emulator
JPH0358232A (en) Preprocessor calling system
JPH02259844A (en) Program debugging system
Pilgrim Objects and Object-Orientation
JPS62100834A (en) Control system for number of editions of program
JPH0497448A (en) Interactive type simplex testing system
JPH02125337A (en) Dynamic characteristic acquiring system for fortran program
JPS6324422A (en) Coexistence system for more than two kinds of access procedures in segment system computer
JPH02115951A (en) Maintenance and debug system for high level language program
JPH0588878A (en) Lisp instruction executing system
JPS6337426A (en) Program address resolving system using external symbol address table
JPH0353335A (en) Compiler processing system
JPH04140851A (en) Diagnostic system for information processor
JPH0227431A (en) Correlation checking system between data due to function form
JPH03100837A (en) Detection system for shared data access