JPH0769830B2 - Program translation device with expansion control function - Google Patents

Program translation device with expansion control function

Info

Publication number
JPH0769830B2
JPH0769830B2 JP62204371A JP20437187A JPH0769830B2 JP H0769830 B2 JPH0769830 B2 JP H0769830B2 JP 62204371 A JP62204371 A JP 62204371A JP 20437187 A JP20437187 A JP 20437187A JP H0769830 B2 JPH0769830 B2 JP H0769830B2
Authority
JP
Japan
Prior art keywords
data item
definition
source program
term
program
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.)
Expired - Fee Related
Application number
JP62204371A
Other languages
Japanese (ja)
Other versions
JPS6446837A (en
Inventor
正敬 大島
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 JP62204371A priority Critical patent/JPH0769830B2/en
Publication of JPS6446837A publication Critical patent/JPS6446837A/en
Publication of JPH0769830B2 publication Critical patent/JPH0769830B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、入力ソースプログラムを翻訳してオブジェク
トプログラムを生成し出力するプログラム翻訳装置に関
する。
Description: TECHNICAL FIELD The present invention relates to a program translation device that translates an input source program to generate an object program and outputs the object program.

〔従来の技術〕[Conventional technology]

従来、プログラムの作成はプログラム毎に新規に行なわ
れることが通例であった。しかし、この方法ではプログ
ラムの内容が類似していても新規に作成するため開発工
数がかかり、またプログラム中に含まれる記述上の誤り
やプログラム中の処理部の誤りも多かった。そこで、近
年では類似したプログラムを元にし、その一部を変更し
て新しいプログラムを作成する方法が増えている。
Conventionally, it has been customary to newly create a program for each program. However, in this method, even if the contents of the program are similar, it takes a lot of development man-hours to create a new program, and there are many errors in the description included in the program and errors in the processing unit in the program. Therefore, in recent years, there is an increasing number of methods of creating a new program by modifying a part of the similar program.

この方法を第5図を参照して説明する。まずプログラム
修正者は、これから作成しようとする新しいプログラム
の仕様をもとに元となるプログラム5-1自体の構造やそ
の仕様を調べ、新旧で共用できるデータ項目の定義5-1
1,新旧で共用できる処理5-14,新しいプログラムに適す
るように一部修正が必要なデータ項目の定義5-12,一部
修正が必要な処理5-15,新しいプログラムでは不要なデ
ータ項目の定義5-13,新しいプログラムでは不要な処理5
-16,新しいプログラムで追加されるデータ項目の定義5-
3,新しいプログラムで追加される処理5-26を洗い出す。
This method will be described with reference to FIG. First, the program modifier examines the structure of the original program 5-1 itself and its specifications based on the specifications of the new program to be created, and defines the data items that can be shared by the old and new 5-1.
1, Process that can be shared between old and new 5-14, Definition of data items that need to be partially modified to suit new programs 5-12, Process that needs to be partially modified 5-15, Data items that are not required by new programs Definition 5-13, Unnecessary processing in new program 5
-16, Definition of data item added by new program 5-
3, Identify the process 5-26 added by the new program.

次にプログラム修正者は前述の洗い出し作業の結果をも
とに、元となるプログラム中の一部修正が必要なデータ
項目の定義5-12を一部修正されたデータ項目の定義5-22
に、一部修正が必要な処理5-15を一部修正された処理5-
25に修正するとともに、新しいプログラムでは不要なデ
ータ項目の定義5-13,新しいプログラムでは不要な処理5
-16を削除し、新しいプログラムで追加されるデータ項
目の定義5-23,新しいプログラムで追加される処理5-26
を追加して新しいプログラム5-2を作成する。
Next, based on the results of the above-mentioned identification work, the program rectifier defines the data items in the original program that require partial modification 5-12 and defines the partially modified data items 5-22.
In addition, processing 5-15 that requires partial correction and processing 5 that is partially corrected 5-
Definition of data items unnecessary in the new program 5-13, and processing unnecessary in the new program 5
-Defining -16 and defining data items added by new program 5-23, Processing added by new program 5-26
To create a new program 5-2.

最近では、財務管理,販売管理,生産管理等の業務で適
用するプログラムを複数のユーザで共通に使用できるよ
うに予め汎用的に作成しておき、個々のユーザに適用す
る際には、上述した方法を採用して個々のユーザにとっ
て過不足な部分を変更し、目的とするプログラムとする
ことを狙ったプログラム群(これはプログラムパッケー
ジとも呼ばれる)も増えてきている。
Recently, a program to be applied in business such as financial management, sales management, and production management has been created in advance so that it can be commonly used by a plurality of users. An increasing number of programs (also referred to as program packages) aim to adopt a method to change an excess or deficiency of an individual user to obtain a desired program.

また、これとは別に複数のプログラムに散在する同一内
容を示すデータ項目の定義の修正を容易に行なえるよう
にするために、ソースプログラムとは独立に複数のプロ
グラムで共通に使用するデータ項目の属性や桁数を定義
しておき(これはデータディクショナリとも呼ばれ
る)、プログラムの翻訳時には翻訳システムがデータデ
ィクショナリの内容を自動的に引用して翻訳し、データ
項目の属性や桁数の変更はデータディクショナリの内容
のみ変更するという方法も行なわれるようになってい
る。
Separately from this, in order to easily modify the definition of the data items that have the same contents and are scattered in multiple programs, the data items commonly used by multiple programs independently of the source program The attributes and the number of digits are defined (this is also called the data dictionary), and when the program is translated, the translation system automatically cites and translates the contents of the data dictionary. A method of changing only the contents of the dictionary has also been adopted.

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

上述した従来の何れの方法においても、プログラムの修
正者は元のプログラムの仕様を熟知し、変更予定のデー
タ項目がどのプログラムでどのように定義,参照されて
いるか,また処理部にどのように影響しているかを知っ
たうえで元となるプログラム上でのデータ項目の削除,
修正およびそのデータ項目を参照する処理部の削除,修
正というソースプログラムの変更作業をソースプログラ
ム単位に行ない、新しいプログラムを作成しなければな
らなかった為、プログラム修正者は設計時には変更箇所
の特定に多くの工数を要し、製造時には複数のプログラ
ムに散在する類似した或いは同一の内容のソース修正を
全て個別に行なわなくてはならず、設計時に変更箇所の
特定が不十分だった場合には製造時に新たな誤りが作成
するプログラムに混入してしまう危険性があるという欠
点がある。
In any of the above-described conventional methods, the program modifier is familiar with the specifications of the original program, and how the data item to be changed is defined and referenced in which program, and how Delete the data item in the original program after knowing whether it is affected,
Since it was necessary to create a new program by modifying the source program such as modification and deletion of the processing section that refers to the data item, and modification, the program modifier must identify the modified part at the time of design. It requires a lot of man-hours, and at the time of manufacturing, it is necessary to individually perform source modification of similar or identical contents scattered in multiple programs. There is a drawback that sometimes there is a risk that a new error will be included in the created program.

本発明はこのような事情に鑑みて為されたものであり、
その目的は、或るソースプログラムを元にした別のプロ
グラムの作成を簡単に且つ誤り少なく行なうことができ
るプログラム翻訳装置を提供することにある。
The present invention has been made in view of such circumstances,
An object of the present invention is to provide a program translation device that can easily create another program based on a certain source program with less error.

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

本発明は上記目的を達成するために、 ソースプログラムを翻訳してオブジェクトプログラムを
生成し出力するプログラム翻訳装置において、 ソースプログラムで使用される可能性のあるデータ項目
毎に、それに割り当てた用語名と、そのデータ項目の項
目名と、そのデータ項目の属性と、そのデータ項目の桁
数と、そのデータ項目を展開するか否かを指示する展開
指示情報とを含む用語定義情報を定義し記憶する定義記
憶手段と、 データ項目定義と処理記述とを含み、削除,追加する可
能性のあるデータ項目定義については用語名を引用する
形式で記述すると共に、削除,追加する可能性のある処
理記述については用語名を含む条件文を付加した形式で
記述したソースプログラムを入力し、前記データ項目定
義,前記条件文付きの処理記述およびそれ以外の箇所を
判別するソースプログラム読取手段と、 該ソースプログラム読取手段で判別された前記ソースプ
ログラム中の前記それ以外の箇所を中間ソースプログラ
ムに展開すると共に、前記ソースプログラム読取手段で
判別された前記データ項目定義毎に、該データ項目定義
中の用語名を含む用語定義情報を前記定義記憶手段から
参照し、その用語定義情報中の前記展開指示情報が「展
開する」を指示しているときは、前記ソースプログラム
中のそのデータ項目定義の元の内容に代えて前記用語定
義情報中のデータ項目の項目名,属性および桁数を中間
ソースプログラムに展開すると共に、そのデータ項目定
義中の用語名を含む条件文が付加された前記処理記述を
前記中間ソースプログラムに展開し、前記展開指示情報
が「展開しない」を指示しているときは、そのデータ項
目定義,そのデータ項目定義中の用語名を含む条件文が
付加された前記処理記述は前記中間ソースプログラムに
展開しない展開制御手段とを有し、 該展開制御手段で作成された中間ソースプログラムから
オブジェクトプログラムを生成するように構成されてい
る。
In order to achieve the above object, the present invention provides a program translation device that translates a source program to generate and outputs an object program, and a term name assigned to each data item that may be used in the source program. Defines and stores term definition information including the item name of the data item, the attribute of the data item, the number of digits of the data item, and expansion instruction information that indicates whether to expand the data item. The definition storage means, the data item definition and the process description are included. The data item definition that may be deleted or added is described in a format that cites the term name, and the process description that may be deleted or added. Is a source program that is written in a format with conditional statements including term names, and the data item definition and processing description with conditional statements And a source program reading means for determining other portions, and the other portions in the source program determined by the source program reading means are expanded into an intermediate source program, and also determined by the source program reading means. For each data item definition, the term definition information including the term name in the data item definition is referenced from the definition storage means, and the expansion instruction information in the term definition information indicates "expand". In this case, in place of the original contents of the data item definition in the source program, the item name, attribute and number of digits of the data item in the term definition information are expanded in the intermediate source program and The processing description to which the conditional statement including the term name is added is expanded to the intermediate source program, and the expansion instruction information is “expansion”. When there is no instruction, the processing description to which the data item definition and the conditional statement including the term name in the data item definition are added has expansion control means that does not expand to the intermediate source program, An object program is generated from the intermediate source program created by the expansion control means.

なお、ソースプログラムがデータ項目定義と処理記述と
更に前記データ項目定義で定義されたデータ項目を参照
する参照文とを含む構成の場合には、前記ソースプログ
ラム読取手段および前記展開制御手段に代えて以下のよ
うなソースプログラム読取手段および展開制御手段が備
えられる。
In the case where the source program includes a data item definition, a process description, and a reference statement that refers to the data item defined in the data item definition, the source program reading unit and the expansion control unit may be used instead. The following source program reading means and expansion control means are provided.

ソースプログラム読取手段;前記データ項目定義,前記
条件文付きの処理記述,前記参照文およびそれ以外の箇
所を判別するソースプログラム読取手段。
Source program reading means: Source program reading means for discriminating the data item definition, the process description with the conditional statement, the reference sentence and other parts.

展開制御手段;前記ソースプログラム読取手段で判別さ
れた前記ソースプログラム中の前記それ以外の箇所を中
間ソースプログラムに展開すると共に、前記ソースプロ
グラム読取手段で判別された前記データ項目定義毎に、
該データ項目定義中の用語名を含む用語定義情報を前記
定義記憶手段から参照し、その用語定義情報中の前記展
開指示情報が「展開する」を指示しているときは、前記
ソースプログラム中のそのデータ項目定義の元の内容に
代えて前記用語定義情報中のデータ項目の項目名,属性
および桁数を中間ソースプログラムに展開すると共に、
そのデータ項目定義中の用語名を含む条件文が付加され
た前記処理記述およびそのデータ項目定義で定義された
データ項目を参照する前記参照文を前記中間ソースプロ
グラムに展開し、前記展開指示情報が「展開しない」を
指示しているときは、そのデータ項目定義,そのデータ
項目定義中の用語名を含む条件文が付加された前記処理
記述およびそのデータ項目定義で定義されたデータ項目
を参照する前記参照文は前記中間ソースプログラムに展
開しない展開制御手段。
Expansion control means: expands the other part of the source program determined by the source program reading means into an intermediate source program, and for each of the data item definitions determined by the source program reading means,
When the term definition information including the term name in the data item definition is referred to from the definition storage means and the expansion instruction information in the term definition information indicates “expand”, the In place of the original contents of the data item definition, the item name, attribute and number of digits of the data item in the term definition information are expanded in the intermediate source program, and
The processing statement to which the conditional statement including the term name in the data item definition is added and the reference statement that refers to the data item defined in the data item definition are expanded into the intermediate source program, and the expansion instruction information is When "not expand" is instructed, the data item definition, the processing description to which the conditional sentence including the term name in the data item definition is added, and the data item defined by the data item definition are referred to. Expansion control means that does not expand the reference sentence to the intermediate source program.

〔作用〕[Action]

ソースプログラムはデータ項目定義と処理記述とを含
み、削除,追加する可能性のあるデータ項目定義につい
ては用語名を引用する形式で記述されていると共に、削
除,追加する可能性のある処理記述については用語名を
含む条件文を付加した形式で記述されており、このよう
なソースプログラムが入力されると、ソースプログラム
読取手段が、前記データ項目定義,前記条件文付きの処
理記述およびそれ以外の箇所を判別し、次に展開制御手
段が、ソースプログラム読取手段で判別された前記デー
タ項目定義毎に、そのデータ項目定義中の用語名を含む
用語定義情報を定義記憶手段から参照し、その用語定義
情報中の展開指示情報が「展開する」を指示していると
きは、ソースプログラム中のそのデータ項目定義の元の
内容に代えてその用語定義情報中のデータ項目の項目
名,属性および桁数を中間ソースプログラムに展開する
と共に、そのデータ項目定義中の用語名を含む条件文が
付加された処理記述を中間ソースプログラムに展開し、
展開指示情報が「展開しない」を指示しているときは、
そのデータ項目定義,そのデータ項目定義中の用語名を
含む条件文が付加された処理記述は中間ソースプログラ
ムに展開しない。なお、ソースプログラム中の前記デー
タ項目定義,前記条件文付きの処理記述以外の箇所はそ
のまま中間ソースプログラムに展開される。そして、こ
の中間ソースプログラムに対し、構文解析,オブジェク
ト生成の処理を行って、オブジェクトプログラムを生成
する。
The source program includes data item definitions and process descriptions. Data item definitions that may be deleted or added are described in a format that cites term names, and process descriptions that may be deleted or added. Is described in a form in which a conditional statement including a term name is added, and when such a source program is input, the source program reading means causes the data item definition, the processing description with the conditional statement, and other Then, the expansion control means, for each of the data item definitions determined by the source program reading means, refers to the term definition information including the term name in the data item definition from the definition storing means, and the term When the expansion instruction information in the definition information indicates "expand", it is used instead of the original contents of the data item definition in the source program. Item name of the data item in the definition information, as well as expand the attributes and digits in the intermediate source program, expand the process description conditional statement is added that contain the term name of the data item being defined an intermediate source program,
When the deployment instruction information indicates "Do not deploy",
The data item definition and the processing description to which the conditional statement including the term name in the data item definition is added are not expanded in the intermediate source program. The parts other than the data item definition and the processing description with the conditional statement in the source program are directly expanded to the intermediate source program. Then, the intermediate source program is subjected to syntax analysis and object generation processing to generate an object program.

ソースプログラムがデータ項目定義と処理記述とに加え
更に前記データ項目定義で定義されたデータ項目を参照
する参照文とを含んで構成されている場合、ソースプロ
グラム読取手段が、前記データ項目定義,前記条件文付
きの処理記述,前記参照文およびそれ以外の箇所を判別
し、次に展開制御手段が、ソースプログラム読取手段で
判別された前記データ項目定義毎に、そのデータ項目定
義中の用語名を含む用語定義情報を定義記憶手段から参
照し、その用語定義情報中の展開指示情報が「展開す
る」を指示しているときは、ソースプログラム中のその
データ項目定義の元の内容に代えてその用語定義情報中
のデータ項目の項目名,属性および桁数を中間ソースプ
ログラムに展開すると共に、そのデータ項目定義中の用
語名を含む条件文が付加された処理記述およびそのデー
タ項目定義で定義されたデータ項目を参照する参照文を
中間ソースプログラムに展開し、展開指示情報が「展開
しない」を指示しているときは、そのデータ項目定義,
そのデータ項目定義中の用語名を含む条件文が付加され
た処理記述およびそのデータ項目定義で定義されたデー
タ項目を参照する参照文は中間ソースプログラムに展開
しない。なお、ソースプログラム中の前記データ項目定
義,前記条件文付きの処理記述,前記参照文以外の箇所
はそのまま中間ソースプログラムに展開される。そし
て、この中間ソースプログラムに対し、構文解析,オブ
ジェクト生成の処理を行って、オブジェクトプログラム
を生成する。
When the source program is configured to include a data item definition, a processing description, and a reference sentence that refers to the data item defined in the data item definition, the source program reading means includes the data item definition, The processing description with a conditional statement, the reference sentence and other parts are determined, and then the expansion control unit determines the term name in the data item definition for each of the data item definitions determined by the source program reading unit. When the term definition information to be included is referred to from the definition storage means and the expansion instruction information in the term definition information indicates "expand", the original contents of the data item definition in the source program are replaced with the original contents. While expanding the item name, attribute and number of digits of the data item in the term definition information to the intermediate source program, the conditional statement containing the term name in the data item definition Expand the reference statements that reference pressure has been processed described and defined data item in the data item defined intermediate the source program, when the expansion instruction information indicates "not expand", the data item definition,
A processing description to which a conditional statement including a term name in the data item definition and a reference statement referencing the data item defined in the data item definition are not expanded in the intermediate source program. The data item definition in the source program, the processing description with the conditional statement, and the part other than the reference statement are expanded as they are in the intermediate source program. Then, the intermediate source program is subjected to syntax analysis and object generation processing to generate an object program.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

本発明の一実施例を示す第1図を参照すると、本実施例
のプログラム翻訳装置は、用語定義部1-1,用語記憶部1-
2,用語読取部1-3,ソースプログラム読取部1-4,展開制御
部1-5,構文解析部1-6,オブジェクト生成部1-7,オブジェ
クト出力部1-8および制御部1-9から構成されている。
Referring to FIG. 1 showing an embodiment of the present invention, a program translation device according to the present embodiment has a term definition section 1-1 and a term storage section 1-
2, term reading unit 1-3, source program reading unit 1-4, expansion control unit 1-5, syntax analysis unit 1-6, object generation unit 1-7, object output unit 1-8 and control unit 1-9 It consists of

用語定義部1-1は、プログラムで使用する可能性のある
データ項目について、その属性,桁数およびプログラム
引用時に該データ項目の記述を有効なものとして扱うか
否かを指示する情報(これを展開指示情報と呼ぶ)等を
用語定義情報として定義する為の手段である。
The term definition section 1-1 provides information on the data item that may be used in the program, its attributes, the number of digits, and whether or not to treat the description of the data item as valid when quoting the program. It is a means for defining the term definition information).

用語記憶部1-2は、用語定義部1-1で定義された用語定義
情報を後で利用可能なように記憶する手段である。
The term storage unit 1-2 is means for storing the term definition information defined by the term definition unit 1-1 so that it can be used later.

ソースプログラム読取部1-4は、入力される入力ソース
プログラムを読取り、ソースプログラムのテキストを解
析し、前述の用語定義情報を引用するテキストか,参照
してテキストの展開制御を行なうテキストか,或いはそ
れ以外のテキストであるかを判別する手段である。
The source program reading unit 1-4 reads an input source program that is input, analyzes the text of the source program, and cites the term definition information described above, or refers to a text that controls expansion of the text, or It is a means to determine whether the text is other than that.

用語読取1-3は、用語記憶部1-2から必要な用語定義情報
の読取りを行なう手段である。
The term reading 1-3 is means for reading necessary term definition information from the term storage unit 1-2.

展開制御部1-5は、用語読取部1-3により読取られた用語
定義情報をもとにソーステキストの展開制御を行ない、
中間ソースプログラムとして出力する手段である。
The expansion control unit 1-5 controls the expansion of the source text based on the term definition information read by the term reading unit 1-3,
It is a means for outputting as an intermediate source program.

構文解析部1-6は、中間ソースプログラムを入力してプ
ログラムの構文をチェックする手段である。
The syntax analysis unit 1-6 is a means for inputting an intermediate source program and checking the syntax of the program.

オブジェクト生成部1-7は、オブジェクトプログラムの
為のオブジェクトを生成する手段である。
The object generator 1-7 is means for generating an object for an object program.

オブジェクト出力部1-8は、オブジェクト生成部1-7で生
成されたオブジェクトを編集してオブジェクトプログラ
ムを作成し、これを出力する手段である。
The object output unit 1-8 is a means for editing the object generated by the object generation unit 1-7 to create an object program and outputting this.

制御部1-9は、用語読取部1-3,ソースプログラム読取部1
-4,展開制御部1-5,構文解析部1-6,オブジェクト生成部1
-7およびオブジェクト出力部1-8の各々の動作を制御す
る手段である。
The control unit 1-9 includes the term reading unit 1-3 and the source program reading unit 1
-4, expansion control unit 1-5, syntax analysis unit 1-6, object generation unit 1
-7 and the object output unit 1-8 are means for controlling the respective operations.

以下、本実施例の動作を各図を参照して説明する。The operation of this embodiment will be described below with reference to the drawings.

用語定義部1-1はプログラムの翻訳に先立ち、プログラ
ム設計者により入力されるプログラムで使用する可能性
のあるデータ項目名とその属性,桁数,展開指示情報等
の情報とこの情報を識別するためにプログラム設計者に
より付けられる名称(これらを用語名と呼ぶ)を受取
り、これを一つの用語定義情報として用語記憶部1-2へ
渡す。
Prior to translation of the program, the term definition section 1-1 identifies information such as the data item name and its attributes, the number of digits, and the expansion instruction information that may be used in the program input by the program designer and this information. In order to do so, it receives names assigned by the program designer (these are called term names) and passes them to the term storage section 1-2 as one term definition information.

用語記憶部1-2は、これを後で利用可能なように用語名
をキーとして、データ項目名,属性,桁数,展開指示情
報等の情報を記憶する。第2図は用語記憶部1-2の記憶
内容例を示し、図中の2-1,2-2,2-3は個々の用語定義情
報である。
The term storage unit 1-2 stores information such as data item name, attribute, number of digits, and expansion instruction information, using the term name as a key so that it can be used later. FIG. 2 shows an example of the stored contents of the term storage unit 1-2, and 2-1, 2-2, 2-3 in the figure are individual term definition information.

一方、ソースプログラム読取部1-4は、プログラム翻訳
時に入力されるソースプログラムを読取り、ソースプロ
グラムを構成するソーステキストを解析して、用語定義
情報を引用するデータ項目の定義の箇所、その用語定義
情報中に含まれるデータ項目を参照する箇所,用語定義
情報中の展開制御情報を参照してその内容により一部の
ソーステキストを有効或いは無効とするソーステキスト
の展開制御を行なう箇所,それら以外の箇所を判別す
る。判別すた情報は展開制御部1-5に渡される。これと
ともにソースプログラムで引用或いは参照される用語定
義情報の用語名に関する情報は制御部1-9を介して用語
読取部1-3に渡される。
On the other hand, the source program reading unit 1-4 reads the source program input at the time of program translation, analyzes the source text that constitutes the source program, and defines the location of the data item that cites the term definition information. The part that refers to the data item included in the information, the part that controls the expansion of the source text that makes the part of the source text valid or invalid by referring to the expansion control information in the term definition information, and other parts Determine the location. The determined information is passed to the expansion control unit 1-5. Along with this, information about the term name of the term definition information that is cited or referred to in the source program is passed to the term reading section 1-3 via the control section 1-9.

第3図は入力ソースプログラムの一例を示し、図中3-1,
3-2,3-3は用語定義情報を引用するデータ項目の定義の
例であって、「A」,「B」,「C」は各々引用する用
語定義情報の用語名である。また3-4,3-5は用語定義情
報中の展開指示情報を参照し、ソーステキストの展開制
御を行なう記述の例である。3-4において「%IF ¥TER
MUSE(B)」という記述は、用語名としてBを持つ用語
定義情報の展開指示情報を参照してその内容が「展開す
る」であれば後続の「%THEN %DO;」と「%END;」と
の間に記述されたテキストを有効とする旨を指示してい
る。ソースプログラム読取部1-4は第3図で示されるソ
ースプログラムを読取ると、3-1,3-2,3-3をそれぞれ用
語定義情報を引用するデータ項目の定義の箇所,3-4,3-5
を用語定義情報中の展開指示情報を参照し、ソーステキ
ストの展開制御を行なう箇所,3-6を用語定義情報に含ま
れるデータ項目を参照する箇所と判別し、その中で使用
している用語名「A」,「B」,「C」を検出する。
Fig. 3 shows an example of the input source program.
3-2 and 3-3 are examples of definitions of data items that refer to the term definition information, and “A”, “B”, and “C” are term names of the term definition information that are referred to. Also, 3-4 and 3-5 are examples of descriptions for controlling the expansion of the source text by referring to the expansion instruction information in the term definition information. In 3-4, “% IF ¥ TER
The description "MUSE (B)" refers to the expansion instruction information of the term definition information having B as a term name, and if the content is "expand", the following "% THEN% DO;" and "% END; It is instructed to validate the text described between and. When the source program reading section 1-4 reads the source program shown in FIG. 3, it reads 3-1, 3-2, and 3-3 as data item definition points quoting term definition information, 3-4, 3-5
Refer to the expansion instruction information in the term definition information and determine the source text expansion control, and determine 3-6 as the reference to the data item included in the term definition information, and use the terms The names "A", "B", "C" are detected.

用語読取部1-3は、ソースプログラム読取部1-4から渡さ
れた用語名に関する情報をもとに用語記憶部1-2に記憶
されている用語定義情報を受取り、この情報を展開制御
部1-5へ渡す。
The term reading unit 1-3 receives the term definition information stored in the term storage unit 1-2 on the basis of the information on the term name passed from the source program reading unit 1-4, and expands this information. Pass to 1-5.

展開制御部1-5は、用語読取部1-3から渡された情報とソ
ースプログラム読取部1-4から渡された情報をもとに、
ソースプログラム中の用語定義情報の引用或いは参照箇
所の展開制御を以下のようにして行なう。
The expansion control unit 1-5, based on the information passed from the term reading unit 1-3 and the information passed from the source program reading unit 1-4,
Citation of term definition information in the source program or expansion control of the reference location is performed as follows.

用語定義情報中の展開指示情報が「展開する」であれ
ば、それを引用するデータ項目については翻訳が可能な
ようにデータ項目名とその属性,桁数の展開を行なうと
共に、ソースプログラム中の引用されたデータ項目名を
参照する箇所を有効なソーステキストとし、それを参照
してソーステキストの展開制御を行なう箇所ではその中
に記述されているソーステキストを有効なソーステキス
トとして展開する。若し、用語定義情報中の展開指示情
報が「展開しない」となっていれば、前述のデータ項
目,引用されるデータ項目の参照箇所およびそれを参照
してソーステキストの展開制御を行なう箇所に記述され
たソーステキストを無効として展開しない。
If the expansion instruction information in the term definition information is "expand", the data item that cites it is expanded in terms of the data item name, its attribute, and the number of digits so that it can be translated. The part that refers to the quoted data item name is defined as valid source text, and the part where the expansion control of the source text is performed by referring to it is expanded as the valid source text. If the expansion instruction information in the term definition information is "do not expand", the above-mentioned data item, the reference location of the data item to be quoted, and the location for controlling the expansion of the source text by referring to it Do not expand the written source text as invalid.

以上のようにして展開されたソースプログラムは中間ソ
ースプログラムとして出力される。第4図は第3図で示
すソースプログラムがソースプログラム読取部1-4によ
り読取られ、展開制御部1-5により展開制御された結果
できあがった中間ソースプログラムを示している。第4
図中、4-1は第3図の3-1で示す箇所の展開結果,4-2は第
3図の3-2で示す箇所の展開結果,4-3は第3図の3-4で示
す箇所の展開結果を示し、第3図の3-3,3-5,3-6で示さ
れた箇所は展開されなかったことを示す。
The source program expanded as described above is output as an intermediate source program. FIG. 4 shows an intermediate source program obtained as a result of the source program shown in FIG. 3 being read by the source program reading unit 1-4 and being expanded and controlled by the expansion controller 1-5. Fourth
In the figure, 4-1 is the deployment result of the location indicated by 3-1 in FIG. 3, 4-2 is the deployment result of the location indicated by 3-2 in FIG. 3, and 4-3 is the 3-4 in FIG. The results of expansion of the parts indicated by are shown, and the parts indicated by 3-3, 3-5, 3-6 in FIG. 3 are not expanded.

上述のようにして作られた中間ソースプログラムは構文
解析部1-6へ渡され、構文解析部1-6は中間ソースプログ
ラムの構文をチェックし、その結果をオブジェクト生成
部1-7へ引き渡す。若し、構文解析部1-6で構文エラーを
検出した場合はその旨をエラーメッセージとして出力す
る。オブジェクト生成部1-7は構文解析結果をもとにオ
ブジェクトプログラムを生成するために必要なオブジェ
クトを生成する。オブジェクト出力部1-8は生成された
オブジェクトを編集してオブジェクトプログラムとして
出力する。
The intermediate source program created as described above is passed to the syntax analysis unit 1-6, the syntax analysis unit 1-6 checks the syntax of the intermediate source program, and passes the result to the object generation unit 1-7. If the syntax analysis unit 1-6 detects a syntax error, the fact is output as an error message. The object generator 1-7 generates an object required for generating an object program based on the result of syntax analysis. The object output unit 1-8 edits the generated object and outputs it as an object program.

〔発明の効果〕 以上説明したように、本発明は、ソースプログラムとは
独立にソースプログラムで使用するデータ項目名とその
属性,桁数,翻訳時に展開をするかしないかを指示する
展開指示情報とを用語定義情報として記憶手段に記憶さ
せておき、ソースプログラムの翻訳時にソースプログラ
ム中に記述されている用語定義情報の参照箇所の展開制
御を自動的に行なう構成を有するため、プログラムの作
成,保守が容易となり且つ作成されたプログラムの正当
性を高めることができる。特にプログラムパッケージに
本発明を適用すれば、個々のユーザ用に仕様を変更する
際に削除,追加する可能性のあるデータ項目や処理部の
記述に対して用語定義情報を参照する記述を予めプログ
ラム作成者がプログラムパッケージ中に施しておくこと
により、プログラムパッケージの修正者は、個々のユー
ザの要望に従って定義さている用語定義情報内の展開指
示情報の値を変更することにより、ソースプログラムを
一切修正することなく翻訳するだけで個々のユーザに適
したオブジェクトプログラムを得ることができ、プログ
ラム作成者にとって汎用性のあるプログラムの作成が容
易となり、またプログラム修正者にとってはプログラム
の変更が容易に行なえ誤りも少なくなるという効果があ
る。
[Effects of the Invention] As described above, according to the present invention, the expansion instruction information for instructing the data item name used in the source program independently of the source program, its attribute, the number of digits, and whether or not to expand at the time of translation. Is stored in the storage means as the term definition information, and when the source program is translated, the reference location of the term definition information described in the source program is automatically expanded. Maintenance becomes easy and the legitimacy of the created program can be improved. In particular, when the present invention is applied to a program package, a description that refers to the term definition information is previously programmed for a data item or a description of a processing unit that may be deleted or added when the specifications are changed for individual users. The creator of the program package makes it possible for the program package modifier to modify the source program at all by changing the value of the expansion instruction information in the term definition information that is defined according to the individual user's request. The object program suitable for each user can be obtained by simply translating without doing so, and it becomes easy for the program writer to create a versatile program, and the program revamper can easily change the program. It also has the effect of decreasing.

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

第1図は本発明の一実施例のブロック図、 第2図は用語記憶部1-2の記憶内容例を示す図、 第3図は入力ソースプログラムの内容例を示す図、 第4図は中間ソースプログラムの内容例を示す図およ
び、 第5図は従来のプログラムの作成方法の説明図である。 図において、 1-1……用語定義部 1-2……用語記憶部 1-3……用語読取部 1-4……ソースプログラム読取部 1-5……展開制御部 1-6……構文解析部 1-7……オブジェクト生成部 1-8……オブジェクト出力部 2-1,2-2,2-3……用語定義情報 3-1,3-2,3-3……用語定義情報を参照し翻訳時に展開が
指示された場合にはデータ項目に対する属性,桁数を翻
訳が可能なように展開するよう指示した記述 3-4,3-5……用語定義情報を参照し翻訳時に展開が指示
された場合にはその中に含まれる処理部の一部を有効な
テキストとして展開するように指示した記述 3-6……用語定義情報に含まれるデータ項目を参照する
記述 4-1,4-2……3-1,3-2で示される記述の展開結果 4-3……3-4で示される記述の展開結果
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing an example of contents stored in a term storage unit 1-2, FIG. 3 is a diagram showing an example of contents of an input source program, and FIG. FIG. 5 is a diagram showing an example of contents of an intermediate source program, and FIG. 5 is an explanatory diagram of a conventional program creating method. In the figure, 1-1 …… Term definition section 1-2 …… Term storage section 1-3 …… Term reading section 1-4 …… Source program reading section 1-5 …… Expansion control section 1-6 …… Syntax Analysis part 1-7 …… Object generation part 1-8 …… Object output part 2-1,2-2,2-3 …… Term definition information 3-1,3-2,3-3 …… Term definition information Description that instructed to expand the attribute and the number of digits for the data item so that it can be translated when the expansion was instructed at the time of translation by referring to 3-4, 3-5. When expansion is instructed, a description instructing that a part of the processing part contained in it is expanded as valid text 3-6 ...... Description referring to data item included in term definition information 4-1 , 4-2 …… 3-1 Expansion result of description shown in 3-2 3-4… Expansion result of description shown in 3-4

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】ソースプログラムを翻訳してオブジェクト
プログラムを生成し出力するプログラム翻訳装置におい
て、 ソースプログラムで使用される可能性のあるデータ項目
毎に、それに割り当てた用語名と、そのデータ項目の項
目名と、そのデータ項目の属性と、そのデータ項目の桁
数と、そのデータ項目を展開するか否かを指示する展開
指示情報とを含む用語定義情報を定義し記憶する定義記
憶手段と、 データ項目定義と処理記述とを含み、削除,追加する可
能性のあるデータ項目定義については用語名を引用する
形式で記述すると共に、削除,追加する可能性のある処
理記述については用語名を含む条件文を付加した形式で
記述したソースプログラムを入力し、前記データ項目定
義,前記条件文付きの処理記述およびそれ以外の箇所を
判別するソースプログラム読取手段と、 該ソースプログラム読取手段で判別された前記ソースプ
ログラム中の前記それ以外の箇所を中間ソースプログラ
ムに展開すると共に、前記ソースプログラム読取手段で
判別された前記データ項目定義毎に、該データ項目定義
中の用語名を含む用語定義情報を前記定義記憶手段から
参照し、その用語定義情報中の前記展開指示情報が「展
開する」を指示しているときは、前記ソースプログラム
中のそのデータ項目定義の元の内容に代えて前記用語定
義情報中のデータ項目の項目名,属性および桁数を中間
ソースプログラムに展開すると共に、そのデータ項目定
義中の用語名を含む条件文が付加された前記処理記述を
前記中間ソースプログラムに展開し、前記展開指示情報
が「展開しない」を指示しているときは、そのデータ項
目定義,そのデータ項目定義中の用語名を含む条件文が
付加された前記処理記述は前記中間ソースプログラムに
展開しない展開制御手段とを有し、 該展開制御手段で作成された中間ソースプログラムから
オブジェクトプログラムを生成することを特徴とする展
開制御機能をもつプログラム翻訳装置。
1. A program translation apparatus for translating a source program to generate and outputting an object program, for each data item that may be used in the source program, a term name assigned to the data item, and an item of the data item. A definition storage unit that defines and stores term definition information including a name, an attribute of the data item, the number of digits of the data item, and expansion instruction information that indicates whether to expand the data item; A condition that includes an item definition and a process description, describes data item definitions that may be deleted or added in a format that cites a term name, and conditions that include a term name for a process description that may be deleted or added. Input the source program described in the format with the statement added, and specify the data item definition, the processing description with the conditional statement, and other parts. Separate source program reading means, and expanding the other part of the source program determined by the source program reading means into an intermediate source program, and each of the data item definitions determined by the source program reading means In the case where the term definition information including the term name in the data item definition is referred to from the definition storage means and the expansion instruction information in the term definition information indicates "expand", the source program In place of the original contents of the data item definition in the item definition, the item name, the attribute and the number of digits of the data item in the term definition information are expanded in the intermediate source program, and the conditional statement including the term name in the data item definition Is expanded to the intermediate source program, and the expansion instruction information indicates “not expanded” When the processing description to which the data item definition and the conditional statement including the term name in the data item definition are added has expansion control means which is not expanded in the intermediate source program, it is created by the expansion control means. A program translation device having an expansion control function, which is characterized by generating an object program from an intermediate source program.
【請求項2】ソースプログラムを翻訳してオブジェクト
プログラムを生成し出力するプログラム翻訳装置におい
て、 ソースプログラムで使用される可能性のあるデータ項目
毎に、それに割り当てた用語名と、そのデータ項目の項
目名と、そのデータ項目の属性と、そのデータ項目の桁
数と、そのデータ項目を展開するか否かを指示する展開
指示情報とを含む用語定義情報を定義し記憶する定義記
憶手段と、 データ項目定義と処理記述と前記データ項目定義で定義
されたデータ項目を参照する参照文とを含み、削除,追
加する可能性のあるデータ項目定義については用語名を
引用する形式で記述すると共に、削除,追加する可能性
のある処理記述については用語名を含む条件文を付加し
た形式で記述したソースプログラムを入力し、前記デー
タ項目定義,前記条件文付きの処理記述,前記参照文お
よびそれ以外の箇所を判別するソースプログラム読取手
段と、 該ソースプログラム読取手段で判別された前記ソースプ
ログラム中の前記それ以外の箇所を中間ソースプログラ
ムに展開すると共に、前記ソースプログラム読取手段で
判別された前記データ項目定義毎に、該データ項目定義
中の用語名を含む用語定義情報を前記定義記憶手段から
参照し、その用語定義情報中の前記展開指示情報が「展
開する」を指示しているときは、前記ソースプログラム
中のそのデータ項目定義の元の内容に代えて前記用語定
義情報中のデータ項目の項目名,属性および桁数を中間
ソースプログラムに展開すると共に、そのデータ項目定
義中の用語名を含む条件文が付加された前記処理記述お
よびそのデータ項目定義で定義されたデータ項目を参照
する前記参照文を前記中間ソースプログラムに展開し、
前記展開指示情報が「展開しない」を指示しているとき
は、そのデータ項目定義,そのデータ項目定義中の用語
名を含む条件文が付加された前記処理記述およびそのデ
ータ項目定義で定義されたデータ項目を参照する前記参
照文は前記中間ソースプログラムに展開しない展開制御
手段とを有し、 該展開制御手段で作成された中間ソースプログラムから
オブジェクトプログラムを生成することを特徴とする展
開制御機能をもつプログラム翻訳装置。
2. In a program translation device for translating a source program to generate and outputting an object program, a term name assigned to each data item that may be used in the source program and an item of the data item. A definition storage unit that defines and stores term definition information including a name, an attribute of the data item, the number of digits of the data item, and expansion instruction information that indicates whether to expand the data item; Includes item definitions, processing descriptions, and reference sentences that refer to the data items defined in the data item definition. Data item definitions that may be deleted or added are described in a format in which term names are quoted and deleted. , For the processing description that may be added, enter the source program described in the format in which the conditional statement including the term name is added, and An item definition, a process description with the conditional statement, a source program reading means for discriminating the reference sentence and other portions, and an intermediate source for the other portions in the source program discriminated by the source program reading means. While expanding into a program, for each of the data item definitions determined by the source program reading means, the term definition information including the term name in the data item definition is referenced from the definition storage means, and the term definition information in the term definition information is read. When the expansion instruction information indicates "expand", the item name, attribute, and number of digits of the data item in the term definition information are replaced with the original contents of the data item definition in the source program. The processing description expanded to an intermediate source program and the conditional statement including the term name in the data item definition and its processing description are added. Expand the reference statements that reference a data item defined in data fields defined in said intermediate source program,
When the expansion instruction information indicates “not expand”, the data item definition, the processing description to which the conditional statement including the term name in the data item definition is added, and the data item definition are defined. The reference sentence that refers to a data item has expansion control means that does not expand the intermediate source program, and generates an object program from the intermediate source program created by the expansion control means. A program translation device.
JP62204371A 1987-08-18 1987-08-18 Program translation device with expansion control function Expired - Fee Related JPH0769830B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62204371A JPH0769830B2 (en) 1987-08-18 1987-08-18 Program translation device with expansion control function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62204371A JPH0769830B2 (en) 1987-08-18 1987-08-18 Program translation device with expansion control function

Publications (2)

Publication Number Publication Date
JPS6446837A JPS6446837A (en) 1989-02-21
JPH0769830B2 true JPH0769830B2 (en) 1995-07-31

Family

ID=16489408

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62204371A Expired - Fee Related JPH0769830B2 (en) 1987-08-18 1987-08-18 Program translation device with expansion control function

Country Status (1)

Country Link
JP (1) JPH0769830B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3494376B1 (en) * 2002-12-05 2004-02-09 株式会社システムズ Program analysis device and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6194149A (en) * 1984-10-15 1986-05-13 Fujitsu Ltd Translating sequence deciding system

Also Published As

Publication number Publication date
JPS6446837A (en) 1989-02-21

Similar Documents

Publication Publication Date Title
US6920419B2 (en) Apparatus and method for adding information to a machine translation dictionary
US5930806A (en) Method and system for data migration from network database to relational database
US4853873A (en) Knowledge information processing system and method thereof
JPH0830620A (en) Structure retrieving device
JPH0769830B2 (en) Program translation device with expansion control function
JPS62177654A (en) Document producer
JP2946715B2 (en) Program generation method and specification input method for it
JPH04242829A (en) Program update processing device
JP2002082811A (en) Compiling method and recording medium
JPS6027941A (en) Identifier generation system
JP2598082B2 (en) Documentation device and documentation method for knowledge processing language
JPH07129381A (en) Program document preparing device
JPH0887416A (en) Control program generating device
JPH05313867A (en) Automatic preparing device for control sentence
JPH04248624A (en) Program conversion processor
JPH02253443A (en) Program generating method
JP2000207184A (en) Program source description restandardizing device
JPH1091411A (en) Source program generation system
JPH01246633A (en) Check system for compiling unit
JPH03191424A (en) Software parts synthetic system
JPH03156641A (en) Compiling process system
JPH0268622A (en) Program specializing system
JPH05165617A (en) System for unifying software design book with program source
JPH0540612A (en) Computer prperty conversion processor
JPS62166432A (en) Control system for program translation

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees