JPS62200426A - Macro expansion method for high level language - Google Patents

Macro expansion method for high level language

Info

Publication number
JPS62200426A
JPS62200426A JP4185386A JP4185386A JPS62200426A JP S62200426 A JPS62200426 A JP S62200426A JP 4185386 A JP4185386 A JP 4185386A JP 4185386 A JP4185386 A JP 4185386A JP S62200426 A JPS62200426 A JP S62200426A
Authority
JP
Japan
Prior art keywords
macro
file
source program
secondary storage
storage device
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
JP4185386A
Other languages
Japanese (ja)
Inventor
Shinji Tsuchida
真二 土田
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP4185386A priority Critical patent/JPS62200426A/en
Publication of JPS62200426A publication Critical patent/JPS62200426A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To easily execute a macro expansion of a module being common to plural source files by reading out a desired macro file from a storage means and executing the macro expansion to a work file, in case a macro descriptor has been brought to coding at the time of compiling a source program file. CONSTITUTION:A file managing module 41 recognizes a source program and a macro inputted from a program input device 3 and manages a registration to a secondary storage device 4. In case of registering the macro to the secondary storage device 4, it is read from the input device 3 and when a CPU 2 recognizes it to be the macro, it is written in a management table of the file managing module 41, and thereafter, an access of the secondary storage device 4 is executed by the file managing module 41. In the same way, in case of registering the source program in the secondary storage device 4, it is read from the input device and when the CPU 2 recognizes it to be the source program, it is written in the management table of the file managing module 41, and thereafter, an access of the secondary storage device 4 is executed by the file managing module 41.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、高級言語に共通するモジュールをマクロ展
開する高級言語のマクロ展開方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a high-level language macro expansion method for macro-expanding modules common to high-level languages.

〔従来の技術〕[Conventional technology]

従来、高級言語を使用して複数のソースプログラムをコ
ーディングする場合に、各モジュール間に共通する部分
が存在する場合は、モジュール間に共通な部分は、各モ
ジュール毎に同じコーディングを行うかあるいは、モジ
ュール間に共通な部分をあらかじめ1つ作成しておき、
コンパイル時期に、ファイルコピー等により1つのファ
イルに展開する等の方法がとられていた。
Conventionally, when coding multiple source programs using a high-level language, if there are common parts between each module, the common parts between the modules must be coded in the same way for each module, or Create one common part between modules in advance,
At the time of compilation, a method such as expanding into one file by file copying etc. was used.

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

このため、前者においては、コーディングミスによるバ
グが発生したり、共通部分に変更がでた場合には、関係
するすべてのモジュールを修正しなければならないとと
もに、ソースファイルの容量が極めて大きくなってしま
う等の問題点を有していた。
Therefore, in the former case, if a bug occurs due to a coding mistake or a change is made to a common part, all related modules must be modified, and the source file size becomes extremely large. It had the following problems.

また後者による方法では、コンパイル毎にファイルコピ
ーを実行しなければならない。また言語特性によっては
同じモジュールを数回コピーしなければ実際に起動しな
いばかりか、コンパイルするまでに煩雑な作業を余儀な
くされる等の問題点を有していた。
Furthermore, in the latter method, file copy must be executed every time a compilation is made. Furthermore, depending on the language characteristics, the same module has to be copied several times before it actually starts up, and it also has the problem of requiring complicated work before it can be compiled.

この発明は、上記の問題点を解消するためになさたもの
で、高級言語において複数のソースファイルに共通する
モジュールを容易にマクロ展開できる高級言語のマクロ
展開方法を提供することを目的とする。
The present invention has been made to solve the above-mentioned problems, and an object of the present invention is to provide a high-level language macro expansion method that allows easy macro expansion of modules common to a plurality of source files in a high-level language.

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

この発明に係る高級言語のマクロ展開方法は、ソースプ
ログラムファイルのコンパイル時に、ソースプログラム
にマクロ記述子がコーディングされているかを判定して
、マクロ記述子がコーディングされている場合に、対応
する所望のマクロファイルを記憶手段より読み出し、ソ
ースプログラムが展開されたワークファイルにマクロ展
開する。
A macro expansion method for a high-level language according to the present invention determines whether a macro descriptor is coded in a source program when compiling a source program file, and if a macro descriptor is coded, a corresponding desired A macro file is read from a storage means, and the macro is expanded into a work file in which the source program is expanded.

〔作用〕 この発明においては、ソースプログラムファイルのコン
パイル時に、ソースプログラムにマクロ記述子がコーデ
ィングされているかを判定して、この判定結果に応じて
、マクロ記述子がコーディングされている場合に、対応
する所望のマクロファイルを記憶手段より読み出し、ソ
ースプログラムが展開されワークファイルにマクロ展開
させる。
[Operation] In this invention, when compiling a source program file, it is determined whether a macro descriptor is coded in the source program, and depending on the result of this determination, if a macro descriptor is coded, a countermeasure is taken. A desired macro file is read out from the storage means, the source program is expanded, and the macro is expanded into a work file.

〔実施例〕〔Example〕

第1図はこの発明の一実施例を示す高級言語のマクロ展
開方法を説明するブロック図であり、1はシステムコン
ソールで、CPU2のシステム動作を表示したり、CP
U1に各種の情報を入力する。3はプログラム入力装置
で、例えばカードリーグで構成される。4は2次記憶装
置で、例えば磁気ディスク装置で構成される。5はメモ
リで、2次記憶装置4に記憶されるソースファイルまた
はモジュールの共通する部分(マクロ)を1つのファイ
ルとして登録するための管理データを記憶する。
FIG. 1 is a block diagram illustrating a macro expansion method for a high-level language showing an embodiment of the present invention. 1 is a system console that displays the system operation of CPU 2, and
Enter various information into U1. 3 is a program input device, for example, a card league. Reference numeral 4 denotes a secondary storage device, which is composed of, for example, a magnetic disk device. A memory 5 stores management data for registering common parts (macro) of source files or modules stored in the secondary storage device 4 as one file.

第2図はこの発明のマクロ本体を説明する模式図であり
、11はマクロ本体で、マクロ記述子11a 、マクロ
エンド11b 、マクロ名11cより構成されている。
FIG. 2 is a schematic diagram illustrating the macro body of the present invention. Reference numeral 11 denotes the macro body, which is composed of a macro descriptor 11a, a macro end 11b, and a macro name 11c.

1つのマクロ本体11はマクロ記述子11aの後にマク
ロ名11C1例えばABCが記述され、続いてマクロ1
2が定義され、マクロ終了を示すマクロエンド11bで
終了される。
One macro body 11 has a macro descriptor 11a followed by a macro name 11C1, for example, ABC, and then macro 1.
2 is defined and terminated at macro end 11b indicating the end of the macro.

第3図(a)、(b)はこの発明によるソースプログラ
ムのコーディングを説明する模式図であり、同図(a)
において、21はソースプログラム本体で、その前後に
ソースプログラム記述子21a 、ソースエンド21b
が記述される。ソースプログラム記述子21aの後には
、プログラム名22、例えばXYZ等が記述される。
FIGS. 3(a) and 3(b) are schematic diagrams illustrating the coding of a source program according to the present invention, and FIG. 3(a)
, 21 is a source program body, and before and after it are a source program descriptor 21a and a source end 21b.
is described. After the source program descriptor 21a, a program name 22, such as XYZ, is written.

同図(b)において、31はマクロパラメータで、ソー
スプログラム本体21中に記述される。
In FIG. 2B, 31 is a macro parameter, which is written in the source program body 21. As shown in FIG.

マクロパラメータ31はコロン31a 、マクロ名11
C、アンドマーク&、パラメータP、Q等で構成される
。1カラム目がコロン31aの場合は、マクロコール行
であることを示す。アンドマーク&はP、Qがパラメー
タであることを示す。
Macro parameter 31 is colon 31a, macro name 11
It consists of C, and mark &, parameters P, Q, etc. A colon 31a in the first column indicates a macro call line. The and mark & indicates that P and Q are parameters.

次に第4図を参照しながらソースプログラムおよびマク
ロの登録動作について説明する。
Next, the source program and macro registration operation will be explained with reference to FIG.

第4図はこの発明によるソースプログラムおよびマクロ
の登録動作を説明する図であり、第1図と同一のものに
は同じ符号を付している。
FIG. 4 is a diagram for explaining the source program and macro registration operation according to the present invention, and the same parts as in FIG. 1 are given the same reference numerals.

この図において、41はファイル管理モジュールで、プ
ログラム入力装置3から入力されるソースプログラムお
よびマクロを認識して2次記憶装置4への登録を管理す
る。
In this figure, 41 is a file management module that recognizes source programs and macros input from the program input device 3 and manages their registration in the secondary storage device 4.

マクロを2次記憶装置4に登録する場合は、プログラム
入力装置3より読み取らせて、CPU2がマクロである
と認識すると、ファイル管理モージュール41の図示し
ない管理テーブルに書き込み、以後2次記憶装置4のア
クセスがファイル管理モジュール41により実行される
When registering a macro in the secondary storage device 4, it is read from the program input device 3, and when the CPU 2 recognizes it as a macro, it is written in a management table (not shown) of the file management module 41, and thereafter stored in the secondary storage device 4. The access is executed by the file management module 41.

同様にソースプログラムを2次記憶装置4に登録する場
合は、プログラム入力装置3より読み取らせて、CPU
2がソースプログラムであると認識すると、ファイル管
理モージュール41の図示しない管理テーブルに書き込
み、以後2次記憶装否4のアクセスがファイル管理モジ
ュール41により実行される。
Similarly, when registering a source program in the secondary storage device 4, it is read from the program input device 3, and the CPU
2 is recognized as a source program, it is written in a management table (not shown) of the file management module 41, and thereafter access to the secondary storage device 4 is executed by the file management module 41.

次に第5図を参照しながらこの発明によるマクロ展開動
作を説明する。
Next, the macro expansion operation according to the present invention will be explained with reference to FIG.

第5図はこの発明によるマクロ展開動作を説明する模式
図であり、第3図(a)、(b)と同一のちには同じ符
号を付している。
FIG. 5 is a schematic diagram for explaining the macro expansion operation according to the present invention, and the same reference numerals as in FIGS. 3(a) and 3(b) are given.

この図において、5oはソースプログラムファイル、5
1.52はソースプログラムで、その間にマクロコール
行を示すコロン31aが記されている。53はマクロフ
ァイル、54はマクロで、マク1:y記述子11 a 
、マクロエンド11b 、マクロ名11Cがそれぞれ記
されている。55はワークファイルで、ソースプログラ
ム51a 、マクロ53a 、ソースプログラム52a
がこの順に展開されている。
In this figure, 5o is a source program file;
1.52 is a source program, between which a colon 31a indicating a macro call line is written. 53 is a macro file, 54 is a macro, Mac1:y descriptor 11 a
, macro end 11b, and macro name 11C are respectively written. 55 is a work file, which includes a source program 51a, a macro 53a, and a source program 52a.
are expanded in this order.

オペレータより第1図に示したシステムコンソール1か
らプログラムXYZのコンパイルがWi示されると、コ
ンパイラはコンパイルを実行する前に、まず、指定され
たソースプログラム50をアクセスして、マクロコール
命令、すなわち、マクロコール行があるかどうかを判断
し、マクロコール命令がない場合には、例えばソースプ
ログラム51をワークファイル55にソースプログラム
51aとしてムーブし、マクロコール行がソースプログ
ラムファイル50に存在する場合は、マクロ記述子11
aで指示されるマクロファイル53をワークファイル5
5をマクロ54aとしてムーブする。次いで、マクロコ
ール記述子11aの次の行からソースプログラム52を
ワークファイル55にムーブされたマクロ54aの後続
にソースプログラム52aとしてムーブする。マクロ展
開が終了したら、コンパイラはワークファイル55を1
つのソースプログラムとしてコンパイルを開始する。
When the operator instructs the compiler to compile the program XYZ from the system console 1 shown in FIG. It is determined whether there is a macro call line, and if there is no macro call instruction, for example, the source program 51 is moved to the work file 55 as the source program 51a, and if the macro call line exists in the source program file 50, Macro descriptor 11
The macro file 53 specified in a is converted to the work file 5.
5 is moved as the macro 54a. Next, the source program 52 is moved from the next line of the macro call descriptor 11a to the work file 55 following the macro 54a as the source program 52a. After the macro expansion is completed, the compiler converts the work file 55 into 1
Start compiling as a single source program.

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

以上説明したように、この発明はソースプログラムファ
イルのコンパイル時に、ソースプログラムにマクロ記述
子がコーディングされているかを判定して、マクロ記述
子がコーディングされている場合に、対応する所望のマ
クロファイルを記憶手段より読み出し、ソースプログラ
ムが展開されたワークファイルにマクロ展開するように
したので、各ソースプログラムファイルにマクロファイ
ルをマクロ展開することが可能となり、展開後のファイ
ルアクセスが高速化されるとともに、ソフトウェアの生
産性を向上できる極めて優れた利点を有する。
As explained above, the present invention determines whether a macro descriptor is coded in the source program when compiling a source program file, and if a macro descriptor is coded, a corresponding desired macro file is created. Since the macro is read from the storage means and expanded into the work file in which the source program is expanded, it becomes possible to expand the macro file into each source program file, speeding up file access after expansion. It has an extremely excellent advantage of improving software productivity.

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

第1図はこの発明の一実施例を示す高級言語のマクロ展
開方法を説明するブロック図、第2図はこの発明のマク
ロ本体を説明する模式図、第3図(a)、(b)はこの
発明によるソースプログラムのコーディングを説明する
模式図、第4図はこの発明によるソースプログラムおよ
びマクロの登録動作を説明する図、第5図はこの発明に
よるマクロ展開動作を説明する模式図である。 図中、1はシステムコンソール、2はCPU、3はプロ
グラム入力装置、4は2次記憶装置、5はメモリ、11
はマクロ本体、Ilaはマクロ記述子、11bはマクロ
エンド、11Cはマクロ名、12.54はマクロ、21
はソースプログラム本体、21aはソースプログラム記
述子、21bはソースエンド、31はマクロパラメータ
、31aはコロン、41はファイル管理モジュール、5
0はソースプログラムファイル、51゜52はソースプ
ログラム、53はマクロファイル、55はワークファイ
ルである。 第1図 ム 第2図 1r 第3図 (a)
FIG. 1 is a block diagram illustrating a macro expansion method for a high-level language showing an embodiment of the present invention, FIG. 2 is a schematic diagram illustrating the main body of a macro according to the present invention, and FIGS. 3(a) and (b) are FIG. 4 is a schematic diagram illustrating the source program coding according to the present invention, FIG. 4 is a diagram illustrating the source program and macro registration operation according to the present invention, and FIG. 5 is a schematic diagram illustrating the macro expansion operation according to the present invention. In the figure, 1 is a system console, 2 is a CPU, 3 is a program input device, 4 is a secondary storage device, 5 is a memory, 11
is the macro body, Ila is the macro descriptor, 11b is the macro end, 11C is the macro name, 12.54 is the macro, 21
21a is a source program body, 21a is a source program descriptor, 21b is a source end, 31 is a macro parameter, 31a is a colon, 41 is a file management module, 5
0 is a source program file, 51 and 52 are source programs, 53 is a macro file, and 55 is a work file. Figure 1 M Figure 2 1r Figure 3 (a)

Claims (2)

【特許請求の範囲】[Claims] (1)入力される複数の高級言語のソースプログラムフ
ァイルおよびマクロファイルを記憶する記憶手段を有し
、コンパイル指定に応じて1つのソースプログラムを作
成する装置において、前記ソースプログラムファイルの
コンパイル時に、前記ソースプログラムにマクロ記述子
がコーディングされているかを判定して、前記マクロ記
述子がコーディングされている場合に、対応する所望の
マクロファイルを前記記憶手段より読み出し、前記ソー
スプログラムが展開されたワークファイルにマクロ展開
することを特徴とする高級言語のマクロ展開方法。
(1) In an apparatus that has a storage means for storing input source program files and macro files of a plurality of high-level languages and creates one source program according to a compilation specification, when the source program file is compiled, the Determine whether a macro descriptor is coded in the source program, and if the macro descriptor is coded, read a corresponding desired macro file from the storage means, and read a corresponding desired macro file from the storage means, and a work file in which the source program is expanded. A macro expansion method for high-level languages that is characterized by macro expansion.
(2)ソースプログラム展開後は、ワークファイルをコ
ンパイルすることを特徴とする特許請求の範囲第(1)
項記載の高級言語のマクロ展開方法。
(2) Claim (1) characterized in that after the source program is developed, the work file is compiled.
How to expand macros in high-level languages as described in the section.
JP4185386A 1986-02-28 1986-02-28 Macro expansion method for high level language Pending JPS62200426A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4185386A JPS62200426A (en) 1986-02-28 1986-02-28 Macro expansion method for high level language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4185386A JPS62200426A (en) 1986-02-28 1986-02-28 Macro expansion method for high level language

Publications (1)

Publication Number Publication Date
JPS62200426A true JPS62200426A (en) 1987-09-04

Family

ID=12619810

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4185386A Pending JPS62200426A (en) 1986-02-28 1986-02-28 Macro expansion method for high level language

Country Status (1)

Country Link
JP (1) JPS62200426A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7571431B2 (en) 2003-04-29 2009-08-04 Microsoft Corporation Processing macro information and displaying via GUI in different tools

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7571431B2 (en) 2003-04-29 2009-08-04 Microsoft Corporation Processing macro information and displaying via GUI in different tools

Similar Documents

Publication Publication Date Title
JPS62200426A (en) Macro expansion method for high level language
US5724559A (en) Method for displaying ISPF panels in a VM non-ISPF environment
JP3461185B2 (en) Method and apparatus for registering source code line number to load module
JPH02165353A (en) Conversation type data processing system
Pierce Source language debugging on a small computer
JPH0390933A (en) Automatic generating system for software program
JP2786689B2 (en) Compiler processing method
KR100229567B1 (en) Coordination and text value generation method
JPS6020275A (en) Simple programming system of multiprocessor
JP2590083B2 (en) Source program translation processing method
JPH0690669B2 (en) Character string manipulation instruction compilation processing method
JPS61206041A (en) Extension method for program language
JPH05108372A (en) System for outputting compiler optimization processing content
JPH0654472B2 (en) Micro computer
JPH0991173A (en) Execution history display method for program
JPH0359726A (en) Program unit batch translation system
JPH04353933A (en) Program execution control language conversation device
JPS63157240A (en) Digital control device
JPH07141156A (en) Information processor and its program combining method
JPH07200271A (en) Program resource management device
JPS5953944A (en) Program control system
JPH0358225A (en) File editing system
JPS61264441A (en) Compiling system
JPH04324525A (en) Program transplantation supporting device
JPH0766399B2 (en) Mask pattern generator