JPH04181326A - Compiling method for source program - Google Patents

Compiling method for source program

Info

Publication number
JPH04181326A
JPH04181326A JP30966590A JP30966590A JPH04181326A JP H04181326 A JPH04181326 A JP H04181326A JP 30966590 A JP30966590 A JP 30966590A JP 30966590 A JP30966590 A JP 30966590A JP H04181326 A JPH04181326 A JP H04181326A
Authority
JP
Japan
Prior art keywords
common data
object module
source program
compiler
common
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
JP30966590A
Other languages
Japanese (ja)
Inventor
Osamu Yokogawa
横川 修
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators Ltd
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 Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP30966590A priority Critical patent/JPH04181326A/en
Publication of JPH04181326A publication Critical patent/JPH04181326A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To secure the justice of common data before linking by generating the common data separately as an object module by a compiler when the source program is translated and inspecting the uniformity of the common data. CONSTITUTION:When the common data that plural source programs 1 and 2 use in common are translated by the compiler 3 to generate object modules 8 and 9, the common data are outputted as an independent object module 7 and the uniformity of the initial values and size of the common data are inspected at the time of the translation. Thus, the uniformity of the common data is secured to reduce in-execution trouble of a program in advance.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、複数のソースプログラムで共通に使用する共
通データをコンパイラで翻訳してオブジェクトモジュー
ルを作成する方法に関し、特に共通データの不統一によ
るプログラムの実行時トラブルを事前に軽減するように
したソースプログラムのコンパイル方法に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a method of creating an object module by translating common data commonly used in multiple source programs using a compiler, and in particular, relates to a method for creating an object module by translating common data commonly used in multiple source programs. This invention relates to a method for compiling a source program that reduces troubles during program execution in advance.

〔従来の技術〕[Conventional technology]

従来、共通データは、それぞれのオブジェクトモジュー
ルに出力しており、共通データの統一性の検査はオブジ
ェクトモジュールをリンケージエディタでリンクする時
に行われていた。
Conventionally, common data has been output to each object module, and the consistency of the common data has been checked when linking object modules using a linkage editor.

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

上述シたリンケージエディタでリンク時に共通データの
統一性を検査する方法では、共通データが複数のオブジ
ェクトモジュールにそれぞれ格納されているため、共通
データネ統一な場合、本来どれが正しい共通データであ
るかりンケージエディタには決められず、とりあえず先
にリンクされたオブジェクトモジュールに格納された共
通データを有効とするか、または最大サイズの共通デー
タを有効とするしかないため、正しくない共通データを
有効としたプログラムは正しく動作しないという欠点が
ある。また、共通データが複数のオブジェクトモジュー
ルにそれぞれ格納されているため、全オブジェクトモジ
ュールのファイル量が無駄に膨れると共に、りンケージ
エディタ等オブジェクトモジュールを入力して処理する
ユーティリティの実行処理時間が余計にかかるという欠
点がある。
In the above-mentioned method of checking the consistency of common data at the time of linking using the linkage editor, since the common data is stored in multiple object modules, it is difficult to determine which common data is correct if the common data is unified. The cage editor cannot decide, and the only option is to enable the common data stored in the object module linked first, or to enable the maximum size common data, so invalid common data was enabled. The drawback is that the program does not work properly. In addition, because common data is stored in multiple object modules, the file size of all object modules increases unnecessarily, and the execution processing time of utilities such as the linkage editor that inputs and processes object modules increases. There is a drawback that it takes a long time.

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

本発明のソースプログラムのコンパイル方法ハ、複数の
ソースプログラムで共通に使用する共通データをコンパ
イラで翻訳してオブジェクトモジュールを作成するとき
、共通データを単独の別なオブジェクトモジュールとし
て出力し、翻訳時に共通データの初期値とサイズの統一
性を検査することを特徴とする。
A method for compiling a source program according to the present invention is that when creating an object module by translating common data commonly used in multiple source programs with a compiler, the common data is output as a separate object module, and the common data is shared during translation. It is characterized by checking the uniformity of the initial value and size of data.

〔実施例〕〔Example〕

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

第1図は本発明の一実施例の動作説明図である。FIG. 1 is an explanatory diagram of the operation of an embodiment of the present invention.

第1図に基づき動作を説明する。The operation will be explained based on FIG.

コンパイラ3はソースプログラム1を翻訳するとき、共
通データXのオブジェクトを作成する前に共通データ統
一性検査部4において、共通データXに対応するオブジ
ェクトモジュール7が既に作成されているか検査し、作
成されてなければ、オブジェクトモジュール生成部5で
、共通データXに対応するオブジェクトモジュール7を
出力し、ソースプログラム1に対応するオブジェクトモ
ジュール8を出力する。このとき、ソースプログラム1
に対応するオブジェクトモジュール8には、共通データ
Xに対する参照情報は作成するが、定義情報は作成しな
い。各オブジェクトには、データ部と命令部が存在する
When the compiler 3 translates the source program 1, before creating the object of the common data X, the common data consistency checking unit 4 checks whether an object module 7 corresponding to the common data If not, the object module generation unit 5 outputs the object module 7 corresponding to the common data X, and outputs the object module 8 corresponding to the source program 1. At this time, source program 1
In the object module 8 corresponding to , reference information for the common data X is created, but definition information is not created. Each object has a data section and an instruction section.

次に、ソースプログラム2をコンパイラ3で翻訳すると
き、共通データXのオブジェクトを作成する前に、共通
データ統一性検査部4において、共通データXに対応す
るオブジェクトモジュール7が既に作成されているか検
査し、既に存在する場合共通データの統一性検査として
、サイズと初期値の同一性を検査する。
Next, when the source program 2 is translated by the compiler 3, before creating the object of the common data X, the common data consistency checking section 4 checks whether the object module 7 corresponding to the common data X has already been created. However, if it already exists, the size and initial value are checked for consistency as a consistency check for common data.

統一性の検査は次のように行う。The uniformity check is performed as follows.

既に作成されている共通データオブジェクトモジュール
7の共通データXと初期値とサイズが一致していれば、
オブジェクトモジュール生成部5で、共通データXに対
応するオブジェクトモジュール7は生成しない指示コー
ドを立てる。既に作成されている共通データオブジェク
トモジュール7と共通データXのサイズまたは初期値が
不一致の場合、翻訳時エラーメツセージ6を出力し、既
に作成されている共通データオブジェクトモジュール7
に初期値がなく、サイズが一致している場合は、共通デ
ータオブジェクトモジュール7を置き換えるようにオブ
ジェクト生成部5に対して指示コードを立てる。オブジ
ェクト生成部5は、共通データ統一性検査部4の指示コ
ードに従って、共通データオブジェクトモジュール7を
生成し、ソースプログラム2に対応するオブジェクトモ
ジュール8を作成する。この時も、ソースプロクラム1
に対応するオブジェクトモジュール8と同様に、ソース
プログラム2に対応するオブジェクトモジュール9中に
は共通データXに対する参照情報は作成するが、共通デ
ータXに対する定義情報は作成しない。
If the initial value and size match the common data X of the common data object module 7 that has already been created,
The object module generation unit 5 sets an instruction code for not generating the object module 7 corresponding to the common data X. If the sizes or initial values of the common data object module 7 that has already been created and the common data X do not match, a translation error message 6 is output and the common data object module 7 that has already been created
If there is no initial value and the sizes match, an instruction code is set for the object generation unit 5 to replace the common data object module 7. The object generating section 5 generates a common data object module 7 according to the instruction code of the common data consistency checking section 4, and creates an object module 8 corresponding to the source program 2. At this time as well, source program 1
Similarly to the object module 8 corresponding to the source program 2, reference information for the common data X is created in the object module 9 corresponding to the source program 2, but definition information for the common data X is not created.

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

以上説明したように本発明は、コンパイラがソースプロ
グラムを翻訳時に共通データをオブジェクトモジュール
として別に作成することによって、共通データの統一性
を検査することが可能となり、共通データの正当性がリ
ンク前に保証され、また全オブジェクトモジュールのフ
ァイル量が削減され、リンケージエディタの処理時間を
速くする効果を奏する。
As explained above, the present invention allows the compiler to separately create common data as an object module when translating a source program, thereby making it possible to check the consistency of the common data, and verifying the validity of the common data before linking. This has the effect of reducing the file size of all object modules and speeding up the processing time of the linkage editor.

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

第1図は本発明の一実施例の動作説明図である。 1.2−・・ソースプログラム X・・・共通データ 3・・・コンパイラ 4・・・共通データ統一性検査部 5・・・オブジェクトモジュール生成部6・・・翻訳時
エラーメツセージ 7・・・共通データXに対応するオブジェクトモジュー
ル 8・・・ソースプログラム1に対応するオブジェクトモ
ジュール 9・・・ソースプログラム2に対応するオブジェクトモ
ジュール
FIG. 1 is an explanatory diagram of the operation of an embodiment of the present invention. 1.2- Source program X Common data 3 Compiler 4 Common data consistency checker 5 Object module generator 6 Translation error message 7 Common Object module 8 corresponding to data X...Object module 9 corresponding to source program 1...Object module corresponding to source program 2

Claims (1)

【特許請求の範囲】[Claims] 複数のソースプログラムで共通に使用する共通データを
コンパイラで翻訳してオブジェクトモジュールを作成す
るとき、共通データを単独の別なオブジェクトモジュー
ルとして出力し、翻訳時に共通データの初期値とサイズ
の統一性を検査することを特徴とするソースプログラム
のコンパイル方法。
When creating an object module by translating common data that is commonly used in multiple source programs with a compiler, the common data is output as a separate object module, and the initial value and size of the common data are maintained uniformly during translation. A method for compiling a source program characterized by inspecting it.
JP30966590A 1990-11-15 1990-11-15 Compiling method for source program Pending JPH04181326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP30966590A JPH04181326A (en) 1990-11-15 1990-11-15 Compiling method for source program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP30966590A JPH04181326A (en) 1990-11-15 1990-11-15 Compiling method for source program

Publications (1)

Publication Number Publication Date
JPH04181326A true JPH04181326A (en) 1992-06-29

Family

ID=17995792

Family Applications (1)

Application Number Title Priority Date Filing Date
JP30966590A Pending JPH04181326A (en) 1990-11-15 1990-11-15 Compiling method for source program

Country Status (1)

Country Link
JP (1) JPH04181326A (en)

Similar Documents

Publication Publication Date Title
Shao Certified software
JPH08202545A (en) Object-oriented system and method for generation of target language code
US8423971B2 (en) Generating an application software library
JPS63278145A (en) Parameter correspondence check system
JPH04181326A (en) Compiling method for source program
JP3196675B2 (en) Language processing method
Erkkinen Embedded control system implementation and modeling issues
JPH0736734A (en) Method for checking argument value
JP2803369B2 (en) Inspection method for interactive system
JPH11154093A (en) Program compiler and storage medium recording compiler program
JP2001256075A (en) Developing system and developing method and recording medium
JPS6170641A (en) Automatic generating method of test program
JPH03240837A (en) Debug information generating device
JPH01177165A (en) Definition-quotation relation checking system for array
JP2882876B2 (en) Program test method
JPH0355633A (en) Inter-module interface check device
JPH08137714A (en) Debugging method and debugging system for multitask program
JP2590083B2 (en) Source program translation processing method
CN117492727A (en) JAVA-based attribute copying method and device, storage medium and electronic equipment
CN116226161A (en) Method for improving efficiency of developing MyBatis
JPH02205930A (en) Interface check processing method
Massey et al. X Meets Z: Verifying Correctness in the Presence of POSIX Threads.
JPH0358232A (en) Preprocessor calling system
JP2004102458A (en) Logic composition support system
JPS58169637A (en) Compile processing system