JPH0778087A - Compiler device - Google Patents

Compiler device

Info

Publication number
JPH0778087A
JPH0778087A JP22272593A JP22272593A JPH0778087A JP H0778087 A JPH0778087 A JP H0778087A JP 22272593 A JP22272593 A JP 22272593A JP 22272593 A JP22272593 A JP 22272593A JP H0778087 A JPH0778087 A JP H0778087A
Authority
JP
Japan
Prior art keywords
common symbol
program
common
attribute
section
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
JP22272593A
Other languages
Japanese (ja)
Inventor
Masayuki Ikura
正幸 伊倉
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP22272593A priority Critical patent/JPH0778087A/en
Publication of JPH0778087A publication Critical patent/JPH0778087A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To obtain the compiler device which can omit the attribute definitions of common symbols when an execution type program is generated from plural object programs as to the process of a compiler on a computer. CONSTITUTION:An object generation part 1 generates a common symbol section 7 as to the common symbols in a source program 2 and sets a data area and attribute definition information as to the respective common symbols. An execution type program generation part 4 generates the execution type program by using the common symbol section 7 that a common symbol management part 6 selects when there is the common symbol section 7 of the object program 3. The common symbol management part 6 selects the common symbol section 7 having the merging result of all pieces of attribute definition information when there are no contradictions between all items of pieces of attribute definition information of plural common symbol sections 7 by the common symbols.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、計算機におけるコンパ
イラの処理に係り、特に複数の目的プログラムを結合編
集して実行形式プログラムを生成する場合の、共通シン
ボルの処理を効率よく行えるようにしたコンパイラ装置
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the processing of a compiler in a computer, and more particularly to a compiler capable of efficiently processing a common symbol when a plurality of object programs are combined and edited to generate an executable program. Regarding the device.

【0002】[0002]

【従来の技術と発明が解決しようとする課題】計算機に
おける、原始プログラムから目的プログラムを生成し、
複数の目的プログラムについて、いわゆる結合編集の処
理を行うことにより、一つの実行形式プログラムを生成
するコンパイラの処理を行うコンパイラ装置がある。
2. Description of the Related Art In a computer, a target program is generated from a source program,
There is a compiler device that performs a process of a compiler that generates a single executable program by performing so-called combined edit processing on a plurality of target programs.

【0003】そのような結合編集処理では、処理対象の
複数の目的プログラムの各原始プログラムで宣言された
共通シンボルについて、各同一の共通シンボルは同一の
ただ1組のデータを示すものとして処理し、各共通シン
ボルについては、それら複数の目的プログラムが実行形
式プログラム上で同一のデータにアクセスできるよう
に、実行形式プログラムを生成することはよく知られて
いるとおりである。
In such a combined editing process, common symbols declared in each source program of a plurality of target programs to be processed are processed such that each same common symbol represents the same set of data, It is well known that for each common symbol, an executable program is generated so that the plurality of target programs can access the same data on the executable program.

【0004】その処理のためにコンパイラのオブジェク
ト生成部は、解析部が原始プログラムの共通シンボル宣
言文(例えばFORTRAN プログラミング言語の場合には、
図4(a)又は(b)に例示するCOMMON文)を解析した場合
に、生成する目的プログラムのデータとデータ属性情報
を設定する例えばデータセクションに、データ属性情報
の一部として共通シンボルとプログラム内のデータ名と
を対応付けて、COMMON文を示す情報を設定しておく。
For the processing, in the object generation unit of the compiler, the analysis unit uses the common symbol declaration statement of the source program (for example, in the case of FORTRAN programming language,
When the COMMON statement illustrated in FIG. 4 (a) or (b) is analyzed, the data of the target program to be generated and the data attribute information are set. For example, in the data section, the common symbol and the program are included as part of the data attribute information. The information indicating the COMMON statement is set by associating it with the data name in.

【0005】図4のCOMMON文の例は、(a)と(b)がそれぞ
れ個別の目的プログラムが生成されるべきプログラム単
位の各部分を示し、(a) の原始プログラムでは、プログ
ラム内のデータ名「A」のデータに共通シンボル「BL
K」を定義し、(b)の原始プログラムでは、プログラム内
のデータ名「B」のデータに共通シンボル「BLK 」を定
義している。
In the example of the COMMON statement in FIG. 4, (a) and (b) show respective parts of a program unit in which individual object programs are to be generated. In the source program of (a), data in the program is written. Common symbol “BL
"K" is defined, and in the source program (b), a common symbol "BLK" is defined for the data of the data name "B" in the program.

【0006】COMMON文は、このような両原始プログラム
から生成された目的プログラムを結合編集する場合に、
共通シンボル「BLK 」を仲介として、一方のプログラム
で指示するデータ名「A」のデータと他方のプログラム
で指示するデータ名「B」のデータとを同一のデータと
して扱うように実行形式プログラムを生成する必要があ
ることを示す。
The COMMON statement is used to combine and edit a target program generated from both source programs.
Generates an executable program so that the data with the data name "A" specified by one program and the data with the data name "B" specified by the other program are treated as the same data, using the common symbol "BLK" as an intermediary. Indicates that you need to.

【0007】なお、図4のプログラム例において、公知
のように「REAL A(1000)」等は「データ名Aのデータが
実数型、一次元配列で配列要素数1000」を示すデータ属
性定義である。
In the program example of FIG. 4, as is well known, "REAL A (1000)" is a data attribute definition indicating "the data of data name A is a real number type and the number of array elements is 1000 in a one-dimensional array". is there.

【0008】又、「PARTITION P=(プロセッサ数=2,分割
範囲=1:1000,分割方法=均等)」及び「LOCATE A(P)」
は、マルチプロセッサの環境において、LOCATE文で「デ
ータAを割り付け方法Pに従ってプロセッサに割り付
け」、割り付け方法P はPARTITION文の「P=」により
「2個のプロセッサに、要素1から1000までを、均等
に」であることを示すデータ属性定義であり、これによ
り、配列データA は要素1〜500と要素501 〜1000とに分
けて2つのプロセッサで分担して処理するように目的プ
ログラムが生成されることになる。
[PARTITION P = (number of processors = 2, division range = 1: 1000, division method = equal)] and “LOCATE A (P)”
In a multi-processor environment, "allocate data A to a processor according to allocation method P" in the LOCATE statement, and allocation method P uses "P =" in the PARTITION statement to "allocate two processors, elements 1 to 1000, This is a data attribute definition that indicates "equally", and by this, the target program is generated so that the array data A is divided into elements 1 to 500 and elements 501 to 1000 and shared by the two processors. Will be.

【0009】次に、複数の目的プログラムを結合編集し
て実行形式プログラムを生成する場合に、実行形式プロ
グラム生成部の処理では、目的プログラムに共通シンボ
ルの情報があり、2以上の異なる目的プログラムに同一
の共通シンボルがある場合には、それらのプログラムで
同一の共通シンボルに対応しているデータを同一の記憶
領域のデータとしてアクセスするように実行形式プログ
ラムを生成する。
Next, when a plurality of target programs are combined and edited to generate an executable program, in the processing of the executable program generator, the target program has common symbol information, and two or more different target programs are stored. When there is the same common symbol, the executable program is generated so that the data corresponding to the same common symbol in those programs is accessed as the data of the same storage area.

【0010】そのために、実行形式プログラム生成部は
該当する共通シンボルについて、例えば入力順で前位に
ある一つの目的プログラムの当該共通シンボルに対応す
るデータ名について準備されているデータを無条件に選
択して、結合対象の全プログラムが、それぞれ共通シン
ボルに対応する各データ名によって、その選択した同じ
データにアクセスするようにアクセス先を調整するよう
に結合編集処理を進める。
To this end, the executable program generator unconditionally selects the prepared common symbol, for example, the data prepared for the data name corresponding to the common symbol of the one target program that is the first in the input order. Then, all programs to be combined proceed with the combined edit processing so that the access destinations are adjusted so that the selected same data is accessed by each data name corresponding to the common symbol.

【0011】従って、結合対象のすべての目的プログラ
ムで、同一のデータ属性定義がされている場合には問題
がないが、誤って互いに矛盾した属性が定義されていた
場合に、不都合な処理結果となる恐れがある(図4の例
の(a)と(b)から生成した目的プログラムを結合する場合
に場合、partition文等は(a)のみにあって(b) には無い
ので正しく結合できるか保証されない)。
Therefore, there is no problem if the same data attribute definitions are defined in all the object programs to be combined, but if the attributes that are inconsistent with each other are defined by mistake, the processing result is inconvenient. (When combining the target programs generated from (a) and (b) in the example of Fig. 4, the partition statement is only in (a) and not in (b), so it can be combined correctly. Or not guaranteed).

【0012】又、結合編集対象のプログラムが、メイン
プログラムとサブプログラムの関係にある場合等におい
て、共通シンボルで結合されるべき変数に対して、プロ
グラムごとに異なる属性定義をしてプログラムを作成し
たいことがある。
Further, when the program to be combined and edited has a relationship between the main program and the subprogram, it is desired to create a program by defining different attributes for each variable to be combined with a common symbol. Sometimes.

【0013】たとえば、メインプログラムでは使用され
るがサブプログラムでは使用されないデータ属性につい
ては、プログラミングの容易さの観点からサブプログラ
ムでは意識しない(従って定義しない)でよいようにし
たい。
For example, regarding the data attribute which is used in the main program but not used in the sub program, from the viewpoint of ease of programming, the sub program does not need to be aware of it (thus not defining it).

【0014】或いは、サブプログラムでは、サブプログ
ラム単位で目的プログラム生成処理を可能にするために
必要な基本的なデータ属性のみを定義し、メインプログ
ラムで、より詳細な属性を定義することができれば、1
個のサブプログラムを種々の異なるデータ属性の詳細定
義をするプログラムに共通に使用できるので、サブプロ
グラムを汎用的な部品として作成できるようになる。
Alternatively, if the subprogram defines only the basic data attributes necessary for enabling the target program generation process in subprogram units, and the main program can define more detailed attributes, 1
Since the individual subprograms can be commonly used by programs that define various different data attributes in detail, the subprogram can be created as a general-purpose component.

【0015】従って、結合編集処理に際し共通シンボル
を介してデータを同一化する場合に、関連するプログラ
ムのデータ属性定義間について矛盾の無いことをチェッ
クすると共に、各プログラムでデータ属性定義の省略が
できることが望まれる。
Therefore, in the case where data is made to be the same through the common symbol in the combined editing process, it is checked that there is no contradiction between the data attribute definitions of the related programs, and the data attribute definition can be omitted in each program. Is desired.

【0016】本発明は、共通シンボルについて属性定義
の省略を可能にしたコンパイラ装置を目的とする。
It is an object of the present invention to provide a compiler device capable of omitting attribute definition for common symbols.

【0017】[0017]

【課題を解決するための手段】図1は、本発明の構成を
示すブロック図である。図はコンパイラ装置の構成であ
って、オブジェクト生成部1が所定のプログラミング言
語で記述された原始プログラム2を解析して目的プログ
ラム3を生成し、実行形式プログラム生成部4が複数の
目的プログラム3を結合編集して実行形式プログラム5
を生成する装置であって、共通シンボル管理部6を有す
る。
FIG. 1 is a block diagram showing the configuration of the present invention. The figure shows the configuration of a compiler device, in which an object generation unit 1 analyzes a source program 2 written in a predetermined programming language to generate a target program 3, and an execution format program generation unit 4 generates a plurality of target programs 3. Combined edit and execute program 5
And a common symbol management unit 6.

【0018】オブジェクト生成部1は、原始プログラム
2中の共通シンボルに関する所定の宣言について、目的
プログラム3内に共通シンボルセクション7を生成し、
共通シンボルセクション7に、各該共通シンボルに関す
るデータ領域と属性定義情報とを設定する。
The object generation unit 1 generates a common symbol section 7 in the object program 3 for a predetermined declaration regarding a common symbol in the source program 2,
In the common symbol section 7, a data area and attribute definition information regarding each common symbol are set.

【0019】実行形式プログラム生成部4は、該結合編
集の対象の目的プログラム3に共通シンボルセクション
7がある場合に、共通シンボル管理部6が選択する共通
シンボルセクション7を使用して、当該共通シンボルに
関わる該実行形式プログラムの生成を処理する。
When the target program 3 to be combined and edited has a common symbol section 7, the executable program generator 4 uses the common symbol section 7 selected by the common symbol manager 6 to use the common symbol section 7. Process the generation of the executable program related to.

【0020】共通シンボル管理部6は、各該共通シンボ
ルごとに、当該共通シンボルを有する複数の目的プログ
ラム3の共通シンボルセクション7について、すべての
該共通シンボルセクション7の当該共通シンボルに関す
る該属性定義情報を各項目ごとに比較し、すべての該項
目間に互いに矛盾がない場合に、すべての該属性定義情
報をマージした結果を属性定義情報に持つ該共通シンボ
ルセクション7を選択して、実行形式プログラム生成部
4に通知する。
For each of the common symbols, the common symbol management section 6 determines, for each common symbol, the common symbol section 7 of the plurality of object programs 3 having the common symbol, the attribute definition information regarding the common symbol of all the common symbol sections 7. Are compared for each item, and when there is no contradiction among all the items, the common symbol section 7 having the attribute definition information which is the result of merging all the attribute definition information is selected to execute the executable program. Notify the generation unit 4.

【0021】[0021]

【作用】本発明のコンパイラ装置により、共通シンボル
を定義したプログラムを実行形式プログラムにするよう
に結合編集する際に、プログラム間の属性定義の矛盾が
チェックされ、矛盾が無い限り、複数の属性定義をマー
ジした結果の、最も定義項目の多い属性定義をしたプロ
グラムのデータが、当該共通シンボルに対応するデータ
として選択される。
With the compiler apparatus of the present invention, when a program in which a common symbol is defined is combined and edited so as to be an executable program, a contradiction of attribute definitions between programs is checked. The data of the program having the attribute definition with the most definition items as a result of merging is selected as the data corresponding to the common symbol.

【0022】従って、共通シンボルに関して、プログラ
ム間の属性定義の矛盾が検出されて適当な処置が可能に
なると共に、結合編集するプログラムのうちの少なくと
も1個のプログラムに完全な属性定義があれば、その属
性定義に矛盾した定義にならない範囲で、他のプログラ
ムでは属性定義を省略したり、複数の異なる属性定義と
のマージが可能なように定義をすることができるように
なる。
Therefore, regarding the common symbol, if an inconsistency in the attribute definitions between the programs is detected and appropriate action can be taken, and at least one of the programs to be combined and edited has a complete attribute definition, As long as the definition does not conflict with the attribute definition, other programs can omit the attribute definition or define it so that it can be merged with different attribute definitions.

【0023】[0023]

【実施例】図2(a) は、本発明の共通シンボルセクショ
ンを持つ目的プログラムの概念的な構成を示し、目的プ
ログラムの従来からの構成のデータセクションと実行部
セクションとの間に、データセクションに続けて共通シ
ンボルセクションが追加される。
FIG. 2 (a) shows a conceptual structure of an object program having a common symbol section according to the present invention, in which a data section is provided between a data section and an execution section of a conventional object program. The common symbol section is added following.

【0024】公知のように、データセクションはデータ
に関する属性とデータ本体の情報を設定する部分であ
り、実行部セクションは処理手順の情報を設定する部分
であるが、本発明によりCOMMON文に係るデータに関する
情報は、データセクションと区別して共通シンボルセク
ションに置かれるようになる。
As is well known, the data section is a part for setting the attribute relating to the data and the information of the data body, and the execution part section is the part for setting the information of the processing procedure. Information will be placed in the common symbol section separately from the data section.

【0025】共通シンボルセクションには、通常のデー
タの場合に各データ名についてデータセクションに設定
される内容とほぼ同様に、各共通シンボルについて、デ
ータの属性定義情報とデータ本体 (必要な初期値を持
つ) が設定される。
In the common symbol section, the attribute definition information of the data and the data body (necessary initial value is set for each common symbol) are similar to the contents set in the data section for each data name in the case of normal data. Has) is set.

【0026】共通シンボルセクションに設定される各属
性定義情報は、例えば図2(b) のように属性情報の長さ
等の制御情報と、共通シンボル名等の共通シンボル情報
とに続いて属性定義情報が設定されるようにする。
Each attribute definition information set in the common symbol section is, for example, as shown in FIG. 2B, control information such as the length of the attribute information and common symbol information such as the common symbol name, followed by the attribute definition. Allow information to be set.

【0027】属性定義情報は複数の項目からなり、例え
ば先頭から順に基本属性1、基本属性2、....基本属性
m、付加属性1、付加属性2、....付加属性nのよう
に、各項目位置を各特定の種類の属性定義に対応させ
る。
The attribute definition information is composed of a plurality of items, for example, basic attribute 1, basic attribute 2, ... Basic attribute m, additional attribute 1, additional attribute 2 ,. Then, each item position is made to correspond to each specific type of attribute definition.

【0028】ここで各基本属性は、定義が必須である
(省略値として定まる場合を含む) 属性であって、実
数、整数等のデータ型、配列か単純変数か、配列の構成
と大きさ、その他である。又、付加属性は、任意に定義
する属性であって、例えば前記図4(a)のプログラムの
「PARTITION」は、その一例である。
Here, each basic attribute is an attribute whose definition is indispensable (including the case where it is determined as a default value), such as a real number, a data type such as an integer, an array or a simple variable, the configuration and size of the array, Others. Further, the additional attribute is an attribute that is arbitrarily defined, and for example, "PARTITION" of the program shown in FIG. 4A is an example thereof.

【0029】オブジェクト生成部1は、原始プログラム
2を解析して目的プログラム3を生成する場合に、原始
プログラム2に共通シンボルを宣言するCOMMON文を識別
すると、目的プログラム3に共通シンボルセクション7
を設ける。
When the object generator 1 analyzes the source program 2 to generate the target program 3, and identifies a COMMON statement that declares a common symbol to the source program 2, the target program 3 receives the common symbol section 7
To provide.

【0030】オフジェクト生成部1は共通シンボルセク
ション7に、COMMON文で指定された共通シンボルとロー
カルなデータ名との対応(図4(a)の例のBLKとA) に従っ
て、ローカルデータ名のデータについて定義されている
属性に従うデータの情報を共通シンボルセクションに生
成すると共に、前記図2の形式で属性定義情報を設定す
る。
The object generation unit 1 stores the local data name in the common symbol section 7 according to the correspondence between the common symbol specified in the COMMON statement and the local data name (BLK and A in the example of FIG. 4 (a)). Information of data according to the attributes defined for the data is generated in the common symbol section, and the attribute definition information is set in the format of FIG.

【0031】オフジェクト生成部1は属性定義情報を、
図2(b)の各項目に、各項目位置によって定まる内容を
順次設定していって、有効情報を設定した最後の項目ま
での長さの情報として生成し、途中に該当する定義の無
い項目があれば、それらの項目には例えば所定のnull記
号を設定しておく。
The object generation unit 1 sends the attribute definition information to
The contents determined by each item position are sequentially set in each item of FIG. 2 (b), and valid information is generated as information up to the last item to be set. If so, those items are set with predetermined null symbols, for example.

【0032】実行形式プログラム生成部4は、複数の目
的プログラムを指定されて、それらの結合編集を行って
実行形式プログラムを生成する場合に、目的プログラム
に共通シンボルセクションがあれば、それらの共通シン
ボルをしらべて、複数の異なる目的プログラムの共通シ
ンボルセクションに同一の共通シンボルがある場合に
は、その処理を共通シンボル管理部6に依頼する。
When a plurality of target programs are specified and the target program has a common symbol section when a target program has a common symbol section when a plurality of target programs are combined and edited to generate the executable program, the execution-form program generator 4 If the same common symbol exists in the common symbol sections of a plurality of different target programs, the common symbol management unit 6 is requested to perform the processing.

【0033】その場合に共通シンボル管理部6は後述の
ようにして、同一の共通シンボルを持つ複数の共通シン
ボルセクションから、1つの共通シンボルセクションを
選択して、実行形式プログラム生成部4に選択結果を通
知するか、又は複数の共通シンボルセクション間で属性
定義に矛盾があることを検出し、その結果選択不成功と
して実行形式プログラム生成部4に通知する。
In this case, the common symbol management unit 6 selects one common symbol section from a plurality of common symbol sections having the same common symbol, and the execution format program generation unit 4 selects the result as described later. Or it is detected that the attribute definitions are inconsistent among a plurality of common symbol sections, and as a result, the execution format program generation unit 4 is notified as selection failure.

【0034】この通知を受けて、実行形式プログラム生
成部4は選択された共通シンボルセクションの当該共通
シンボルに対応するデータ情報を、その共通シンボルで
関係付けられるすべてのデータ名によってアクセスされ
るべきデータとして、結合編集を進める。
In response to this notification, the executable program generator 4 receives the data information corresponding to the common symbol of the selected common symbol section from the data to be accessed by all the data names associated with the common symbol. As, proceed with the merge editing.

【0035】図3は、本発明の共通シンボル管理部の処
理の流れの一例を示す図であり、この場合の処理対象の
共通シンボルセクションは前記例のような構成に設定さ
れ、図2(b)に例示したような構成の属性定義情報を持
っているものとする。
FIG. 3 is a diagram showing an example of the processing flow of the common symbol management section of the present invention. In this case, the common symbol section to be processed is set to the configuration as in the above example, and FIG. It is assumed that the attribute definition information has the configuration as illustrated in ().

【0036】図3において、共通シンボル管理部6は実
行形式プログラム生成部4から共通シンボルセクション
と共通シンボルを指定して処理要求を受けて起動し、処
理ステップ10で処理対象の共通シンボルセクションから
それぞれ指定の共通シンボルに関する属性定義情報を取
り出す。
In FIG. 3, the common symbol management unit 6 is activated by receiving a processing request by designating a common symbol section and a common symbol from the execution format program generation unit 4, and starting from the common symbol section to be processed in processing step 10. Fetch attribute definition information for the specified common symbol.

【0037】それらの取り出した属性定義情報の先頭の
項目(前記図2(b)の「基本属性1」の項目)から順次
処理するものとし、処理ステップ11でそれらすべての属
性定義情報について同じ項目があればその内容が同一か
比較する。
It is assumed that the extracted items of the attribute definition information are sequentially processed from the first item (the item of "basic attribute 1" in FIG. 2 (b)), and the same item is set for all the attribute definition information in processing step 11. If there is, compare whether the contents are the same.

【0038】処理ステップ12で、前記比較処理で同じ項
目のある属性定義情報が複数個あったか識別し、複数個
あった場合は処理ステップ13でそれらの内容がすべて一
致したか識別し、一致した場合には処理ステップ14で次
の項目があるか識別し、次の項目があれば処理ステップ
11に戻る。
In processing step 12, it is identified whether or not there are a plurality of attribute definition information items having the same item in the comparison processing, and if there is a plurality, it is identified in processing step 13 whether or not all of their contents match, and if they match. Identifies the next item in process step 14 and if there is a next item, process step
Return to 11.

【0039】従って、複数の属性定義情報に同じ項目が
あり、それらの内容が一致する限り、処理ステップ11か
ら処理ステップ14までの以上の処理を繰り返して、順次
各項目を調べる。
Therefore, as long as a plurality of attribute definition information have the same item and the contents thereof match, the above processing from processing step 11 to processing step 14 is repeated to sequentially check each item.

【0040】このようにして処理を進め、処理ステップ
12で何れか1個の属性定義情報にしか現処理対象の項目
が無いことが検出されるか、又は処理ステップ14で何れ
の属性定義情報の項目も終わったことが検出されること
により、比較のための繰り返し処理を成功裏に終わる。
The processing proceeds in this way, and the processing steps
In step 12, it is detected that only one of the attribute definition information has an item to be currently processed, or in processing step 14, it is detected that the item of any attribute definition information has ended The iterative process for successfully ends.

【0041】即ち、上記の何れかであるということは、
すべての項目について全属性定義情報間で定義内容の一
致が有る場合か、又は属性定義情報間で項目数が異なる
場合には、項目数の多い属性定義情報間で定義が一致
し、項目数の少ない属性定義情報ではその項目について
定義をしていない場合である。
That is, any of the above means that
If there is a match in the definition content between all attribute definition information for all items, or if the number of items differs among the attribute definition information, the definition matches among the attribute definition information with a large number of items, and the number of items This is the case when the item is not defined with a small amount of attribute definition information.

【0042】なお、各プログラムごとのデータ属性定義
については、オブジェクト生成部1が目的プログラム生
成処理中でチェックしているので、基本属性について各
個のプログラムでは正しい定義がされている筈であるの
で、上記処理で成功するということは、基本属性の全項
目は全属性定義情報間で一致したことになる。
Since the object attribute generator 1 checks the data attribute definition for each program during the object program generation process, the basic attribute must be correctly defined in each program. The success of the above process means that all items of the basic attribute match among all the attribute definition information.

【0043】以上のように成功した場合には、処理ステ
ップ15で、繰り返し比較処理の最後回まで項目が終わら
なかった属性定義情報の一つを選択する。即ち最も長い
項目数の属性定義情報が選ばれ、その属性定義情報の各
項目に対応する項目を持つ他の属性定義情報について
は、すべて対応する項目の定義内容は一致しているの
で、選択された属性定義情報は、結局全属性定義情報を
マージした結果に等しい。
If successful as described above, in processing step 15, one of the attribute definition information items whose items have not been completed until the final round of the repeated comparison process is selected. That is, the attribute definition information with the longest number of items is selected, and the other attribute definition information having items corresponding to each item of the attribute definition information is selected because the corresponding definition contents of all items are the same. The attribute definition information is equal to the result of merging all the attribute definition information.

【0044】以上の後、共通シンボル管理部6は処理ス
テップ16で、選択した属性定義情報を持つ共通シンボル
セクションを選択結果として実行形式プログラム生成部
4に通知して処理を終わる。
After the above, in the processing step 16, the common symbol management section 6 notifies the execution format program generation section 4 of the common symbol section having the selected attribute definition information as a selection result and ends the processing.

【0045】又、前記比較処理の繰り返し中に処理ステ
ップ13で、或る項目の定義内容で不一致があることを検
出した場合には、共通シンボルセクションの選択不成功
として、処理ステップ17に進み、実行形式プログラム生
成部4に対し定義エラーのあることを通知して処理を終
わる。
If it is detected in step 13 during the comparison process that the definition contents of a certain item do not match, it is determined that the common symbol section has not been selected, and the process proceeds to step 17. The execution format program generation unit 4 is notified that there is a definition error, and the processing ends.

【0046】以上の処理により、図4(a)と(b)とに例示
したようなプログラムの目的プログラムを結合編集する
場合に、(b)にも(a)と同様のPARTITON文及びLOCATE文が
記述されている場合と同様に正常に結合処理が行われ
る。
By the above processing, when the object program of the program illustrated in FIGS. 4A and 4B is combined and edited, the same PARTITON statement and LOCATE statement as in (a) are also used in (b). As in the case where is described, the combining process is performed normally.

【0047】又、図4(b)のプログラムは、言うまでも
無く、(a)のプログラムがPARTITON文及びLOCATE文が無
いような単純なデータ属性定義になっている場合は、勿
論図に示す同じ記述内容のままで対応でき、別の付加属
性が定義された場合にも、同様に対応できる可能性があ
る。
Needless to say, the program of FIG. 4 (b) is shown in the figure when the program of FIG. 4 (a) has a simple data attribute definition without a PARTITON statement and a LOCATE statement. It is possible to deal with the same description content as it is, and it is possible to deal with the case where another additional attribute is defined.

【0048】[0048]

【発明の効果】以上の説明から明らかなように本発明に
よれば、共通シンボルを定義したプログラムを実行形式
プログラムにするように結合編集する際において、プロ
グラム間の属性定義の矛盾がチェックされ、矛盾が無い
限り、複数の属性定義をマージした結果の、最も定義項
目の多い属性定義をしたプログラムのデータが、当該共
通シンボルに対応するデータとして選択されるので、共
通シンボルに関して、プログラム間の属性定義の矛盾が
検出されて適当な処置が可能になると共に、結合編集す
るプログラムのうちの少なくとも1個のプログラムに完
全な属性定義があれば、その属性定義に矛盾した定義に
ならない範囲で、他のプログラムでは属性定義を省略し
たり、複数の異なる属性定義とのマージが可能なように
定義をすることができるという著しい工業的効果があ
る。
As is apparent from the above description, according to the present invention, when a program in which a common symbol is defined is combined and edited to be an executable program, a contradiction of attribute definition between programs is checked, As long as there is no contradiction, the data of the program that has the attribute definition with the most definition items as a result of merging multiple attribute definitions is selected as the data corresponding to the common symbol. If a definition conflict is detected and appropriate action can be taken, and if at least one of the programs to be combined and edited has a complete attribute definition, the other attribute will not conflict with the attribute definition. In some programs, attribute definitions can be omitted or defined so that they can be merged with multiple different attribute definitions. There is a significant industrial effect that kill.

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

【図1】 本発明の構成を示すブロック図FIG. 1 is a block diagram showing the configuration of the present invention.

【図2】 共通シンボルセクションを説明する図FIG. 2 is a diagram illustrating a common symbol section.

【図3】 本発明の処理の流れ図FIG. 3 is a flow chart of processing of the present invention.

【図4】 プログラム例を示す図FIG. 4 is a diagram showing an example program.

【符号の説明】[Explanation of symbols]

1 オブジェクト生成部 2 原始プログラム 3 目的プログラム 4 実行形式プログラム生成部 5 実行形式プログラム 6 共通シンボル管理部 7 共通シンボルセクション 10〜17 処理ステップ 1 Object Generator 2 Source Program 3 Object Program 4 Executable Program Generator 5 Executable Program 6 Common Symbol Management 7 Common Symbol Sections 10-17 Processing Steps

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 オブジェクト生成部(1) が所定のプログ
ラミング言語で記述された原始プログラム(2)を解析し
て目的プログラム(3)を生成し、実行形式プログラム生
成部(4) が複数の該目的プログラムを結合編集して実行
形式プログラムを生成する装置であって、 共通シンボル管理部(6)を有し、 該オブジェクト生成部(1)は、該原始プログラム(2)中の
共通シンボルに関する所定の宣言について、該目的プロ
グラム(3)内に共通シンボルセクション(7)を生成し、該
共通シンボルセクションに、各該共通シンボルに関する
データ領域と属性定義情報とを設定し、 該実行形式プログラム生成部(4)は、該結合編集の対象
の目的プログラム(3)に該共通シンボルセクション(7)が
ある場合に、該共通シンボル管理部(6)が選択する該共
通シンボルセクションを使用して、当該共通シンボルに
関わる該実行形式プログラムの生成を処理し、 該共通シンボル管理部(6) は、各該共通シンボルごと
に、当該共通シンボルを有する複数の該目的プログラム
(3)の該共通シンボルセクション(7)について、すべての
該共通シンボルセクションの当該共通シンボルに関する
該属性定義情報を各項目ごとに比較し、すべての該項目
間に互いに矛盾がない場合に、すべての該属性定義情報
をマージした結果を属性定義情報に持つ該共通シンボル
セクションを選択して、該実行形式プログラム生成部
(4) に通知するように構成されていることを特徴とする
コンパイラ装置。
1. An object generation unit (1) analyzes a source program (2) written in a predetermined programming language to generate a target program (3), and an execution format program generation unit (4) includes a plurality of the programs. An apparatus for combining and editing an object program to generate an executable program, comprising a common symbol management unit (6), wherein the object generation unit (1) is a predetermined symbol related to a common symbol in the source program (2). , A common symbol section (7) is generated in the target program (3), a data area and attribute definition information regarding each common symbol are set in the common symbol section, and the execution format program generation unit (4) uses the common symbol section selected by the common symbol management unit (6) when the target program (3) to be combined and edited has the common symbol section (7). Processing the production of said executable program relating to the common symbol, the common symbol managing unit (6), for each said common symbol, a plurality of said purpose program having the common symbol
Regarding the common symbol section (7) of (3), the attribute definition information about the common symbol of all the common symbol sections is compared for each item, and if there is no contradiction between all the items, all And selecting the common symbol section that has the result of merging the attribute definition information of
A compiler device configured to notify (4).
JP22272593A 1993-09-08 1993-09-08 Compiler device Pending JPH0778087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22272593A JPH0778087A (en) 1993-09-08 1993-09-08 Compiler device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22272593A JPH0778087A (en) 1993-09-08 1993-09-08 Compiler device

Publications (1)

Publication Number Publication Date
JPH0778087A true JPH0778087A (en) 1995-03-20

Family

ID=16786929

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22272593A Pending JPH0778087A (en) 1993-09-08 1993-09-08 Compiler device

Country Status (1)

Country Link
JP (1) JPH0778087A (en)

Similar Documents

Publication Publication Date Title
US20030093420A1 (en) Method and system for retrieving sharable information using a hierarchically dependent directory structure
JP2000242501A (en) Information processor, information processing method and program writing device
JPH06103463B2 (en) Code generation method
JPH086812A (en) Debugging method and debugger for information processing program
US5062039A (en) Sharing of workspaces in interactive processing using workspace name tables for linking of workspaces
US5379407A (en) Error handling in a state-free system
US11635947B2 (en) Instruction translation support method and information processing apparatus
JPH0778087A (en) Compiler device
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
US8069193B2 (en) Method and system for utilizing a generic scalar function to allow a column function to operate on row data
JPH03135630A (en) Instruction scheduling system
JPS61147336A (en) Generation management system of load module
JPH04287121A (en) Tuple space system
JP2841363B2 (en) External module acquisition method
JPH08212081A (en) Memory allocation method, compiling method and compiler
JP2809073B2 (en) Array memory allocation method
JP2002082811A (en) Compiling method and recording medium
JP3120434B2 (en) Program operation analysis method
JP2862734B2 (en) Screen form definition body automatic generation processing device
JP2003085013A (en) Pdm system and programming method for system connection
JP2755646B2 (en) Data driven data processor
JPH06266562A (en) Object code size optimizing system in object-oriented language processing system
JPH0756744A (en) Compiler device
JPH02201541A (en) Compiling system
JPH0675987A (en) Loop converting method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020402