[go: up one dir, main page]

JP2013137716A - Macro expansion device and program - Google Patents

Macro expansion device and program Download PDF

Info

Publication number
JP2013137716A
JP2013137716A JP2011289186A JP2011289186A JP2013137716A JP 2013137716 A JP2013137716 A JP 2013137716A JP 2011289186 A JP2011289186 A JP 2011289186A JP 2011289186 A JP2011289186 A JP 2011289186A JP 2013137716 A JP2013137716 A JP 2013137716A
Authority
JP
Japan
Prior art keywords
source program
macro
unit
expansion
macro expansion
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
JP2011289186A
Other languages
Japanese (ja)
Inventor
Yasuaki Kono
靖明 河野
Saburo Iijima
三朗 飯島
Tsutomu Matsuno
強 松野
Hideo Sakatani
秀夫 坂谷
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.)
Hitachi Information and Control Systems Inc
Hitachi Industry and Control Solutions Co Ltd
Original Assignee
Hitachi Information and Control Systems Inc
Hitachi Information and Control Solutions 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 Hitachi Information and Control Systems Inc, Hitachi Information and Control Solutions Ltd filed Critical Hitachi Information and Control Systems Inc
Priority to JP2011289186A priority Critical patent/JP2013137716A/en
Publication of JP2013137716A publication Critical patent/JP2013137716A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

【課題】展開したソースプログラムをデバッグ中に、展開したソースプログラムを修正する場合は、最終的にはユーザがソースプログラムの不良箇所を特定して修正する必要がある。しかし、展開したデバッグ用のソースプログラムと展開ソースプログラムの2つの箇所関係をユーザが手動で特定しなければいけない。
【解決手段】ソースプログラムに記述されたマクロを展開する指示を行うマクロ展開指示部1と、マクロをソースプログラム51aに展開したマクロ展開ソースプログラム51bを作成し、マクロ展開ソースプログラム51bを表示部に表示するマクロ展開処理部2と、表示部に表示されるマクロ展開ソースプログラム51bに対して、ソースプログラム51aへの特定箇所への移動を指示するソースプログラム移動指示部3と、指示された特定箇所に移動してソースプログラム51aを表示部に表示するソースプログラム移動部4と、を備える。
【選択図】図5
When correcting a developed source program while debugging the developed source program, it is finally necessary for a user to identify and correct a defective portion of the source program. However, the user must manually specify the relationship between the developed debug source program and the developed source program.
A macro expansion instructing unit for instructing to expand a macro described in a source program and a macro expansion source program 51b in which the macro is expanded into a source program 51a are created, and the macro expansion source program 51b is used as a display unit. The macro expansion processing unit 2 to be displayed, the source program movement instructing unit 3 for instructing the macro expansion source program 51b displayed on the display unit to move to the specific location to the source program 51a, and the specified specific location And a source program moving unit 4 for displaying the source program 51a on the display unit.
[Selection] Figure 5

Description

本発明は、ソースプログラムに記述されたマクロの特定箇所を展開して表示する場合に適用できるマクロ展開装置及びプログラムに関する。   The present invention relates to a macro expansion device and a program that can be applied when a specific portion of a macro described in a source program is expanded and displayed.

従来、一般的なソフトウェアを開発する際には、ソースプログラム上に何度も記述される命令や関数を定義したマクロをプログラムに実装する場合があった。このマクロを用いると、ソフトウェアの処理時間を短縮することができると共に、ソースプログラムのコードの量を削減でき、開発効率を高めることができる。このため、保守時にはソースプログラムの視認性が高まり、内容を容易に把握しやすくなる。   Conventionally, when developing general software, a macro that defines instructions and functions that are described many times in a source program may be implemented in the program. By using this macro, it is possible to shorten the software processing time, reduce the amount of source program code, and improve the development efficiency. For this reason, the visibility of the source program is increased during maintenance, and the contents can be easily grasped.

また、複数種類のマクロを組み合わせて、処理を行わせるようにソースプログラムをプログラミングすることが可能である。そして、定型化された処理をマクロに集約することによって、マクロを用いた同じ系統の機能をソースプログラムに容易に追加できる。例えば、処理時点における日付情報を取得する処理については、事前に日付取得マクロを作成しておく。そして、ソースプログラムには、日付取得マクロを呼び出す記述をしておく。これにより、複数のソフトウェアであっても同じ日付情報を取得することができる。また、マクロを用いた特定の処理を複数のソフトウェアで再利用することも可能である。   In addition, it is possible to program a source program to perform processing by combining a plurality of types of macros. Then, the functions of the same system using the macro can be easily added to the source program by consolidating the standardized processing into the macro. For example, for the process of acquiring date information at the time of processing, a date acquisition macro is created in advance. In the source program, a description for calling the date acquisition macro is written. Thereby, the same date information can be acquired even with a plurality of software. In addition, a specific process using a macro can be reused by a plurality of software.

ソフトウェアの開発時には、プログラミングを担当するユーザがソフトウェアに不具合を発見すると、デバッグを行ってソースプログラム内の不良箇所を特定し、修正を行っている。この際、ソースプログラム内のマクロにどのような命令が記述されているかを確認する場合がある。   During software development, when a user in charge of programming finds a defect in the software, debugging is performed to identify a defective part in the source program and correct it. At this time, there are cases where it is confirmed what instruction is described in the macro in the source program.

しかし、マクロを用いた処理からマクロの中身を直接デバッグできない場合がある。このため、ソースプログラムのデバッグ時に、マクロにどのような命令が記述されているかを展開して(以下、このような処理を「マクロ展開」と呼ぶ。)、不具合が生じた箇所を特定した後に、デバッグ中のソースプログラムを修正する仕組みが必要とされていた。ここで、マクロ展開してソースプログラムを修正する技術としては、特許文献1に開示されているものが知られている。   However, there are cases where the contents of the macro cannot be debugged directly from the processing using the macro. For this reason, when debugging a source program, expand what instruction is described in the macro (hereinafter, such processing is referred to as “macro expansion”), and identify the location where the problem occurred. There was a need for a mechanism to modify the source program being debugged. Here, a technique disclosed in Patent Document 1 is known as a technique for correcting a source program by performing macro expansion.

特許文献1には、C言語を用いて記述されたソースプログラムをマクロ定義の定義内容に従って展開する過程において、マクロ定義の内容を示す文字列配列変数を得た後、展開後のソースプログラムに文字列配列変数を付加する技術が開示されている。そして、ソースプログラムのマクロ使用命令に対して、マクロ定義内容を展開してデバッグするプログラムコンパイラが提供されている。   In Patent Document 1, in the process of developing a source program written in C language according to the definition contents of the macro definition, after obtaining a character string array variable indicating the contents of the macro definition, a character string is added to the expanded source program. A technique for adding a column array variable is disclosed. A program compiler is provided that expands and debugs the macro definition contents for the macro use instructions of the source program.

特開平11―154093号公報Japanese Patent Laid-Open No. 11-154093

ここで、マクロ展開した後のソースプログラムをデバッグ中に、ユーザが特定した不良箇所を修正する場合を想定する。このとき、特許文献1に開示されたプログラムコンパイラを用いると、ユーザはマクロ展開される前のソースプログラムを目視で検索して、特定したマクロの不良箇所を修正できる。しかし、プログラムコードの量が膨大になっても、展開したデバッグ用のソースプログラムとソースプログラムの2つからマクロの位置関係を手動で特定しなければいけない。このため、マクロ展開した後のソースプログラムから不良箇所を特定しても、マクロ展開する前のソースプログラムから不良箇所のマクロを特定することは困難であった。   Here, it is assumed that a defective portion specified by the user is corrected during debugging of the source program after the macro expansion. At this time, if the program compiler disclosed in Patent Document 1 is used, the user can visually search the source program before the macro expansion and correct the defective portion of the identified macro. However, even if the amount of program code becomes enormous, the macro positional relationship must be manually specified from the developed debug source program and source program. For this reason, even if a defective part is specified from the source program after the macro expansion, it is difficult to specify the macro of the defective part from the source program before the macro expansion.

本発明はこのような状況に鑑みて成されたものであり、マクロ展開したソースプログラム内に記述されたマクロのコメントから、マクロ展開される前のソースプログラムにおけるマクロの特定箇所に移動して表示する方法を提供するものである。   The present invention has been made in view of such a situation, and moves from a macro comment described in a macro expanded source program to a specific location of the macro in the source program before the macro expansion. It provides a way to

本発明は、ソースプログラムに記述されたマクロを展開する指示を行い、マクロをソースプログラムに展開したマクロ展開ソースプログラムを作成し、マクロ展開ソースプログラムを表示部に表示する。そして、表示部に表示されるマクロ展開ソースプログラムに対して、ソースプログラムへの特定箇所への移動を指示し、指示された特定箇所に移動してソースプログラムを表示部に表示する。   The present invention instructs to expand a macro described in a source program, creates a macro expanded source program in which the macro is expanded into the source program, and displays the macro expanded source program on the display unit. Then, the macro expansion source program displayed on the display unit is instructed to move to the source program, and the source program is displayed on the display unit.

本発明によれば、ソースプログラムをマクロ展開することによって、ユーザがデバッグを行うソースプログラム内のマクロを特定し易くなる。また、マクロ展開ソースプログラムから、ユーザが修正するマクロ箇所を指定するだけで、ソースプログラム内のマクロの不良箇所に移動してソースプログラムを表示部に表示する。このため、ユーザが目視でソースプログラムからマクロを検索しなくてもよくなり、ソフトウェア開発の効率が向上する。   According to the present invention, macro expansion of a source program makes it easy for a user to specify a macro in the source program to be debugged. Further, by simply specifying a macro location to be corrected by the user from the macro expansion source program, the macro program moves to a defective location of the macro in the source program and displays the source program on the display unit. This eliminates the need for the user to visually search for a macro from the source program, improving the efficiency of software development.

本発明の一実施の形態例におけるマクロ展開装置の内部構成例を示すブロック図である。It is a block diagram which shows the example of an internal structure of the macro expansion | deployment apparatus in the example of 1 embodiment of this invention. 本発明の一実施の形態例におけるマクロ展開装置の詳細な内部構成例を示すブロック図である。It is a block diagram which shows the detailed internal structural example of the macro expansion | deployment apparatus in the example of 1 embodiment of this invention. 本発明の一実施の形態例におけるマクロ展開装置が画面に表示する画面表示メニューの例を示す説明図である。It is explanatory drawing which shows the example of the screen display menu which the macro expansion | deployment apparatus in one example of this invention displays on a screen. 本発明の一実施の形態例におけるマクロ展開装置の使用例を示す説明図である。It is explanatory drawing which shows the usage example of the macro expansion | deployment apparatus in the example of 1 embodiment of this invention. 本発明の一実施の形態例におけるマクロ展開指示部及びマクロ展開処理部の処理例を示すフローチャートである。It is a flowchart which shows the process example of the macro expansion | deployment instruction | indication part in one embodiment of this invention, and a macro expansion | deployment process part. 本発明の一実施の形態例におけるソースプログラム移動指示部及びソースプログラム移動部の処理例を示すフローチャートである。It is a flowchart which shows the process example of the source program movement instruction | indication part and source program movement part in one embodiment of this invention. 本発明の一実施の形態例におけるマクロ展開の前後におけるソースプログラムの表示例を示す説明図である。It is explanatory drawing which shows the example of a display of the source program before and behind macro expansion | deployment in the example of 1 embodiment of this invention. 本発明の一実施の形態例におけるマクロ展開時に作成されるテーブルの例を示す説明図である。It is explanatory drawing which shows the example of the table produced at the time of macro expansion | deployment in one embodiment of this invention. 本発明の一実施の形態例におけるマクロ使用箇所にジャンプする場合のソースプログラムの表示例を示す説明図である。It is explanatory drawing which shows the example of a display of a source program in the case of jumping to the macro use location in one embodiment of this invention. 本発明の一実施の形態例におけるマクロ定義箇所にジャンプする場合のソースプログラムの表示例を示す説明図である。It is explanatory drawing which shows the example of a display of the source program in the case of jumping to the macro definition location in one embodiment of this invention.

以下、本発明の一実施の形態例について、添付図面を参照して説明する。本実施の形態例では、ソースプログラムに記述されるマクロを展開して表示部5に表示し、ユーザが直接マクロを編集することを可能とするマクロ展開装置10に適用した例について説明する。このマクロ展開装置10は、コンピュータがプログラムを実行することにより、内部ブロックが連携して行うソースプログラムのマクロ展開方法を実現する。   Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings. In the present embodiment, an example will be described in which the macro described in the source program is expanded and displayed on the display unit 5 and applied to the macro expansion apparatus 10 that allows the user to directly edit the macro. The macro expansion apparatus 10 realizes a macro expansion method of a source program that is performed in cooperation with internal blocks by executing a program by a computer.

図1は、マクロ展開装置10の内部構成例を示すブロック図である。
マクロ展開装置10は、ソースプログラムに記述されたマクロの展開を指示するマクロ展開指示部1と、指示されたマクロのマクロ展開を行って、マクロ展開ソースプログラムを表示部5に表示するマクロ展開処理部2とを備える。また、マクロ展開装置10は、ソースプログラムの特定箇所への移動を指示するソースプログラム移動指示部3と、ソースプログラム内に記述されるマクロの使用箇所又は定義箇所へ移動してソースプログラムを表示するソースプログラム移動部4とを備える。また、マクロが展開される前後のソースプログラム等は表示部5に表示され、ユーザが操作する操作部6の操作入力により展開されるマクロ等が特定される。
FIG. 1 is a block diagram illustrating an internal configuration example of the macro expansion device 10.
The macro expansion apparatus 10 performs a macro expansion instruction unit 1 for instructing expansion of a macro described in the source program, and a macro expansion process for performing macro expansion of the instructed macro and displaying the macro expansion source program on the display unit 5. Part 2. Further, the macro expansion apparatus 10 displays the source program by moving to the source program movement instructing unit 3 that instructs movement of the source program to a specific place and the use or definition place of the macro described in the source program. A source program moving unit 4. The source program before and after the macro is expanded is displayed on the display unit 5, and the macro and the like to be expanded are specified by the operation input of the operation unit 6 operated by the user.

次に、マクロ展開装置10の動作例を説明する。
始めに、ユーザが操作部6を操作してソースプログラム内のマクロをクリックし、マクロ展開を指示すると、マクロ展開指示部1は、指示内容を受け付け、マクロ展開を指示する。マクロ展開処理部2は、マクロ展開指示部1からの指示に基づいて、マクロ展開ソースプログラムを表示部5に表示する。
Next, an operation example of the macro expansion device 10 will be described.
First, when the user operates the operation unit 6 and clicks a macro in the source program to instruct macro expansion, the macro expansion instruction unit 1 receives the instruction content and instructs macro expansion. The macro expansion processing unit 2 displays the macro expansion source program on the display unit 5 based on an instruction from the macro expansion instruction unit 1.

そして、ユーザがソースプログラムのデバッグを行う際には、マクロ展開ソースプログラム内のマクロの不良箇所を特定すると、ソースプログラムに移動して特定されたマクロが表示される。以下の説明では、マクロ展開ソースプログラム内でマクロを指定して、このマクロが記述されているソースプログラムの特定箇所を表示することを、「ジャンプ」と呼ぶ。   Then, when the user debugs the source program, if the defective part of the macro in the macro expansion source program is identified, the macro is identified by moving to the source program. In the following description, specifying a macro in a macro expansion source program and displaying a specific part of the source program in which the macro is described is referred to as “jump”.

図2は、マクロ展開装置10の詳細な内部構成例を示すブロック図である。
上述したように、マクロ展開装置10は、マクロ展開指示部1、マクロ展開処理部2、ソースプログラム移動指示部3、ソースプログラム移動部4を備える。さらに、マクロ展開装置10は、ソースプログラム51aを保存する記憶部7を備える。記憶部7は、ソースプログラム記憶部51とバックアップソースプログラム記憶部53を備える。そして、ソースプログラム記憶部51は、ソースプログラム記憶部51内に記述されたマクロの使用箇所等の情報が書き込まれるテーブル52を備える。テーブル52には、プリプロセス制御部によって、展開したマクロのマクロ名、マクロの展開箇所、及びマクロが定義されている箇所、マクロがソースプログラムに記述されている箇所が保存される。
FIG. 2 is a block diagram illustrating a detailed internal configuration example of the macro expansion device 10.
As described above, the macro expansion device 10 includes the macro expansion instruction unit 1, the macro expansion processing unit 2, the source program movement instruction unit 3, and the source program movement unit 4. Furthermore, the macro expansion device 10 includes a storage unit 7 that stores the source program 51a. The storage unit 7 includes a source program storage unit 51 and a backup source program storage unit 53. The source program storage unit 51 is provided with a table 52 in which information such as a macro use location described in the source program storage unit 51 is written. In the table 52, the macro name of the macro developed by the preprocess control unit, the macro development location, the location where the macro is defined, and the location where the macro is described in the source program are stored.

ソースプログラム記憶部51は、マクロ展開される前のソースプログラム51aを記憶する。そして、ソースプログラム51aがマクロ展開されると、ソースプログラム記憶部51にマクロ展開ソースプログラム51bが上書き保存される。バックアップソースプログラム記憶部53には、バックアップとしてコピーされたマクロ展開される前のソースプログラム51aを記憶する。   The source program storage unit 51 stores a source program 51a before macro expansion. When the source program 51a is macro expanded, the macro expanded source program 51b is overwritten and stored in the source program storage unit 51. The backup source program storage unit 53 stores a source program 51a that has been copied as a backup and is not expanded into a macro.

また、マクロ展開処理部2は、バックアップソースプログラム保存部21とプリプロセス制御部22を備える。バックアップソースプログラム保存部21は、ソースプログラム記憶部51から読み出したソースプログラム51aをバックアップしたバックアップソースプログラム53aを、バックアップソースプログラム記憶部53に保存する。プリプロセス制御部22は、C言語等でコンパイルを行う前にソースプログラム51aにプリプロセス処理を行って、マクロ展開したマクロ展開ソースプログラム51bをソースプログラム記憶部51に保存する。   The macro expansion processing unit 2 includes a backup source program storage unit 21 and a preprocess control unit 22. The backup source program storage unit 21 stores in the backup source program storage unit 53 a backup source program 53 a that is a backup of the source program 51 a read from the source program storage unit 51. The preprocess control unit 22 performs preprocess processing on the source program 51 a before compiling with the C language or the like, and saves the macro expanded source program 51 b which has been macro expanded in the source program storage unit 51.

また、ソースプログラム移動部4は、バックアップソースプログラム回復部41と、バックアップソースプログラム削除部42と、ソースプログラムジャンプ処理部43とを備える。バックアップソースプログラム回復部41は、ソースプログラム記憶部51に記憶されているソースプログラム51aに対して、バックアップソースプログラム記憶部53から読み出したバックアップソースプログラム53aを上書きする回復処理を行う。バックアップソースプログラム削除部42は、バックアップソースプログラム記憶部53からマクロ展開ソースプログラム51bを削除する処理を行う。ソースプログラムジャンプ処理部43は、ソースプログラム記憶部51に保存されているソースプログラム51aにアクセスして、マクロの特定箇所にジャンプする処理を行う。   Further, the source program moving unit 4 includes a backup source program recovery unit 41, a backup source program deletion unit 42, and a source program jump processing unit 43. The backup source program recovery unit 41 performs a recovery process for overwriting the backup source program 53 a read from the backup source program storage unit 53 on the source program 51 a stored in the source program storage unit 51. The backup source program deletion unit 42 performs a process of deleting the macro expansion source program 51b from the backup source program storage unit 53. The source program jump processing unit 43 accesses the source program 51a stored in the source program storage unit 51 and performs a process of jumping to a specific part of the macro.

ここで、各処理ブロックの動作を説明する前に、マクロ展開装置10が画面に表示する画面表示メニュー11に含まれる各種のボタンの例を説明する。   Here, before explaining the operation of each processing block, examples of various buttons included in the screen display menu 11 displayed on the screen by the macro expansion device 10 will be described.

図3は、マクロ展開装置10を制御する画面表示メニュー11である。
ユーザがソースプログラム51aを右クリックすると、表示部5に画面表示メニュー11が表示される。なお、右クリックとしたのは一例であり、画面表示メニュー11を出現させる手法は限定されない。そして、ユーザが画面表示メニュー11からマクロ展開ボタン12を選択すると、選択されたマクロ展開ボタン12は反転表示され、プリプロセス制御部22によってマクロ展開が実行される。なお、マクロ展開はソースプログラム51aに含まれる全てのマクロ、又は指定したマクロ毎に展開することが可能である。
FIG. 3 shows a screen display menu 11 for controlling the macro expansion device 10.
When the user right-clicks the source program 51a, the screen display menu 11 is displayed on the display unit 5. Note that the right click is just an example, and the method of causing the screen display menu 11 to appear is not limited. When the user selects the macro expansion button 12 from the screen display menu 11, the selected macro expansion button 12 is displayed in reverse video, and the macro expansion is executed by the preprocess control unit 22. Macro expansion can be performed for all macros included in the source program 51a or for each designated macro.

その後、マクロ展開ソースプログラム51b内のマクロに対して、ユーザが定義移動ボタン13を選択すると、ソースプログラム51a内のユーザが選択したマクロの定義箇所にジャンプすることができる。一方、ユーザが使用箇所移動ボタン14を選択すると、ソースプログラム51a内のユーザが選択したマクロの使用箇所にジャンプすることができる。また、デバッグにてソースプログラム記憶部51の修正が不要である場合には、ソースプログラム51aのマクロ展開した箇所に戻るという意味で、使用箇所移動ボタン14を選択すればよい。   Thereafter, when the user selects the definition movement button 13 for the macro in the macro expansion source program 51b, it is possible to jump to the definition portion of the macro selected by the user in the source program 51a. On the other hand, when the user selects the use location movement button 14, it is possible to jump to the use location of the macro selected by the user in the source program 51a. If the source program storage unit 51 need not be corrected for debugging, the use location moving button 14 may be selected to return to the macro expanded location of the source program 51a.

ここで、図2に戻って、マクロ展開装置10の動作例を説明する。
マクロ展開指示部1は、マクロ展開装置10が動作するための画面を表示するプロセスであり、ユーザが画面表示メニュー11からマクロ展開ボタン12を選択すると、マクロ展開処理部2が行うマクロ展開処理の開始を指示する。また、マクロ展開指示部1は、ソースプログラムに記述されている個別のマクロ毎、又はソースプログラムに記述されている全てのマクロを選択して展開することを指示することができる。
Here, returning to FIG. 2, an operation example of the macro expansion device 10 will be described.
The macro expansion instruction unit 1 is a process for displaying a screen for operating the macro expansion device 10. When the user selects the macro expansion button 12 from the screen display menu 11, the macro expansion processing unit 2 performs macro expansion processing. Instruct the start. Further, the macro expansion instruction unit 1 can instruct to select and expand each individual macro described in the source program or all the macros described in the source program.

マクロ展開処理部2は、ソースプログラム51aに対してマクロ使用箇所をマクロの実体に置換するプロセスであり、マクロ展開指示部1からマクロ展開の指示を受けると、ソースプログラム記憶部51をマクロ展開して表示する。また、マクロ展開処理部2は、マクロ展開ソースプログラム51bに展開したマクロの名称をコメントとしてソースプログラム51aに挿入する。   The macro expansion processing unit 2 is a process of replacing a macro use location with a macro entity in the source program 51a. When receiving a macro expansion instruction from the macro expansion instruction unit 1, the macro expansion processing unit 2 expands the source program storage unit 51 into a macro. To display. Further, the macro expansion processing unit 2 inserts the name of the macro expanded in the macro expansion source program 51b into the source program 51a as a comment.

このとき、バックアップソースプログラム保存部21は、マクロ展開をする前のソースプログラム51aをバックアップしたバックアップソースプログラム53aをバックアップソースプログラム記憶部53に保存する。そして、プリプロセス制御部22は、ソースプログラム記憶部51から読み出したソースプログラム51aをマクロ展開したマクロ展開ソースプログラム51bをソースプログラム記憶部51に上書き保存する。   At this time, the backup source program storage unit 21 stores, in the backup source program storage unit 53, the backup source program 53a obtained by backing up the source program 51a before macro expansion. Then, the preprocess control unit 22 overwrites and saves in the source program storage unit 51 a macro expansion source program 51b obtained by macro expansion of the source program 51a read from the source program storage unit 51.

ソースプログラム移動指示部3は、ソースプログラム移動部4の実行を、ユーザが定義移動ボタン13又は使用箇所移動ボタン14等の選択ボタンを選択することによって制御する。ソースプログラム移動部4は、マクロ展開ソースプログラム51bから、ユーザが指定したマクロの定義がされている箇所又はマクロが使用されている箇所を特定箇所とし、この特定箇所にジャンプするプロセスである。ソースプログラム移動部4は、ソースプログラム51aへの移動、バックアップソースプログラム記憶部53に保存したバックアップソースプログラム53aの削除、及びソースプログラム51aに記述されるマクロの特定箇所へジャンプ処理を行う。   The source program movement instruction unit 3 controls the execution of the source program movement unit 4 when the user selects a selection button such as the definition movement button 13 or the use location movement button 14. The source program moving unit 4 is a process of jumping from the macro expansion source program 51b to a specific location where a macro defined by the user is defined or a location where the macro is used. The source program moving unit 4 moves to the source program 51a, deletes the backup source program 53a stored in the backup source program storage unit 53, and performs jump processing to a specific part of the macro described in the source program 51a.

バックアップソースプログラム回復部41は、バックアップソースプログラム記憶部53から読み出したバックアップソースプログラム53aをソースプログラム記憶部51に上書き保存する。バックアップソースプログラム削除部42は、バックアップソースプログラム記憶部53からバックアップソースプログラム53aを削除する。   The backup source program recovery unit 41 overwrites and saves the backup source program 53 a read from the backup source program storage unit 53 in the source program storage unit 51. The backup source program deletion unit 42 deletes the backup source program 53 a from the backup source program storage unit 53.

ソースプログラムジャンプ処理部43は、ユーザが指定したソースプログラム51aの特定箇所へ移動して、ソースプログラム51aを表示する。なお、ソースプログラム51aに移動するときにマクロ展開ソースプログラム51bを自動的に削除しているが、マクロ展開ソースプログラム51bを残したままとしてもよい。   The source program jump processing unit 43 moves to a specific location of the source program 51a designated by the user and displays the source program 51a. Although the macro expansion source program 51b is automatically deleted when moving to the source program 51a, the macro expansion source program 51b may be left as it is.

図4は、マクロ展開装置10の使用例を示す説明図である。
始めに、ユーザがソースプログラム51aのテスト又はデバッグを行う前に、ソースプログラム51aをマクロ展開する方法について説明を行う。
FIG. 4 is an explanatory diagram showing a usage example of the macro expansion device 10.
First, a method for macro-expanding the source program 51a before the user tests or debugs the source program 51a will be described.

上述したように、ユーザがソースプログラム51aに記述されている特定のマクロを指定して、画面表示メニュー11のマクロ展開ボタン12を選択する。この選択により、マクロ展開処理部2は、指定されたマクロを展開したマクロ展開ソースプログラム51bを表示部5に表示する。   As described above, the user designates a specific macro described in the source program 51a and selects the macro expansion button 12 of the screen display menu 11. By this selection, the macro expansion processing unit 2 displays the macro expansion source program 51b in which the designated macro is expanded on the display unit 5.

一方、ユーザが特定のマクロを指定せずに、マクロ展開ボタン12を選択すると、マクロ展開処理部2は、ソースプログラム51aに記述されている全てのマクロを展開したマクロ展開ソースプログラム51bを表示部5に表示する。その後、ユーザは、マクロ展開ソースプログラム51bを使用してテストとデバッグを行うこととなる。そして、ユーザが特定のマクロを指定して定義移動ボタン13を選択すると、ソースプログラム移動部4は、指定されたマクロがソースプログラム51a内で定義されている箇所に移動して、この指定されたマクロを表示部5に表示する。   On the other hand, when the user selects the macro expansion button 12 without designating a specific macro, the macro expansion processing unit 2 displays a macro expansion source program 51b in which all the macros described in the source program 51a are expanded. 5 is displayed. Thereafter, the user performs testing and debugging using the macro expansion source program 51b. When the user designates a specific macro and selects the definition movement button 13, the source program movement unit 4 moves to the location where the designated macro is defined in the source program 51a, and this designated The macro is displayed on the display unit 5.

次に、ユーザがテスト・デバッグを行った後に、ソースプログラム51aに戻る方法について説明を行う。
ユーザがマクロ展開ソースプログラム51bに記述されたマクロを指定して定義移動ボタン13を選択すると、ソースプログラム51a内でマクロが定義されているマクロ定義箇所55を表示する。また、ユーザがマクロを指定して使用箇所移動ボタン14を選択すると、ソースプログラム51a内でマクロが使用されているマクロ使用箇所56を表示する。また、ソースプログラム51a内におけるマクロ定義がネスト(入れ子)で記述されている場合であっても、任意のマクロ定義箇所55へジャンプすることも可能である。
Next, a method of returning to the source program 51a after the user performs test / debug will be described.
When the user designates a macro described in the macro expansion source program 51b and selects the move definition button 13, the macro definition portion 55 where the macro is defined in the source program 51a is displayed. When the user designates a macro and selects the use location moving button 14, the macro use location 56 where the macro is used in the source program 51a is displayed. Even if the macro definition in the source program 51a is described in a nested manner, it is possible to jump to an arbitrary macro definition location 55.

<マクロ展開指示部1及びマクロ展開処理部2の処理例>
図5は、マクロ展開指示部1及びマクロ展開処理部2の処理例を示すフローチャートである。図5において、マクロ展開指示部1は、ステップS1のマクロ展開判定処理を行い、マクロ展開処理部2は、ステップS2〜S4のマクロ展開処理を行う。
<Processing Example of Macro Expansion Instruction Unit 1 and Macro Expansion Processing Unit 2>
FIG. 5 is a flowchart showing a processing example of the macro expansion instruction unit 1 and the macro expansion processing unit 2. In FIG. 5, the macro expansion instruction unit 1 performs a macro expansion determination process in step S1, and the macro expansion processing unit 2 performs a macro expansion process in steps S2 to S4.

始めに、マクロ展開指示部1は、ソースプログラム51aに対してマクロ展開の実施を指示したか否かを判定する(ステップS1)。マクロ展開の実施は、ユーザがソースプログラム51aに対してマクロ展開ボタン12を選択することによりステップS2以降の動作が開始する。マクロ展開を実施しない時は全ての処理を終了する。   First, the macro expansion instructing unit 1 determines whether or not the source program 51a has been instructed to perform macro expansion (step S1). The macro expansion is started by the operation after step S2 when the user selects the macro expansion button 12 for the source program 51a. When macro expansion is not performed, all processing is terminated.

次に、マクロ展開処理部2内のバックアップソースプログラム保存部21は、マクロ展開前のソースプログラム51aをバックアップしたバックアップソースプログラム53aを作成し(ステップS2)、バックアップソースプログラム記憶部53に保存する。バックアップソースプログラム53aは、マクロ展開ソースプログラム51bをソースプログラム51aに戻す際に使用する。   Next, the backup source program storage unit 21 in the macro expansion processing unit 2 creates a backup source program 53a that backs up the source program 51a before the macro expansion (step S2), and stores it in the backup source program storage unit 53. The backup source program 53a is used when returning the macro expansion source program 51b to the source program 51a.

次に、マクロ展開処理部2は、プリプロセス処理によりソースプログラム51aのマクロ展開を行い、マクロ展開ソースプログラム51bを作成する(ステップS3)。マクロ展開されるマクロが関数型マクロである場合は、マクロ展開処理部2は、引数を展開した部分に色をつける。このため、マクロ展開ソースプログラム51b内で、色が付けられ引数が展開された部分と、マクロ処理が行われる部分を明確に区別して表示部5に表示することが可能となる。最後に、マクロ展開処理部2は、マクロ展開ソースプログラム51bを表示部5に出力して表示させる(ステップS4)。   Next, the macro expansion processing unit 2 performs macro expansion of the source program 51a by preprocessing, and creates a macro expansion source program 51b (step S3). When the macro to be expanded is a function type macro, the macro expansion processing unit 2 colors the portion where the argument is expanded. For this reason, in the macro development source program 51b, it is possible to clearly distinguish and display on the display unit 5 the part where the color is added and the argument is developed and the part where the macro processing is performed. Finally, the macro expansion processing unit 2 outputs and displays the macro expansion source program 51b on the display unit 5 (step S4).

<ソースプログラム移動指示部3及びソースプログラム移動部4の処理例>
図6は、ソースプログラム移動指示部3及びソースプログラム移動部4のフローチャートである。図6において、ソースプログラム移動指示部3は、ステップS11のソースプログラム51aへの移動判定処理を行い、ソースプログラム移動部4は、ステップS12〜S16のジャンプ処理を行う。
<Processing Example of Source Program Movement Instruction Unit 3 and Source Program Movement Unit 4>
FIG. 6 is a flowchart of the source program transfer instruction unit 3 and the source program transfer unit 4. In FIG. 6, the source program movement instructing unit 3 performs a movement determination process to the source program 51a in step S11, and the source program moving unit 4 performs a jump process in steps S12 to S16.

始めに、ソースプログラム移動指示部3は、ソースプログラム51aへの移動を指示したか否かを判定する(ステップS11)。ソースプログラム51aへの移動は、ユーザが画面表示メニュー11の定義移動ボタン13又は使用箇所移動ボタン14を選択したことに連動して開始する。移動を指示しない時は全ての処理を終了する。   First, the source program movement instruction unit 3 determines whether or not an instruction to move to the source program 51a has been given (step S11). The movement to the source program 51a starts in conjunction with the user selecting the definition movement button 13 or the use location movement button 14 of the screen display menu 11. When no movement is instructed, all processing is terminated.

ステップS11で移動指示が実施されたと判定されると、ソースプログラム移動部4内のバックアップソースプログラム回復部41は、表示しているマクロ展開ソースプログラム51bにバックアップソースプログラム53aを上書き更新する処理を行う(ステップS12)。そして、バックアップソースプログラム削除部42は、バックアップソースプログラム記憶部53からバックアップソースプログラム53aを削除する(ステップS13)。   If it is determined in step S11 that the migration instruction has been performed, the backup source program recovery unit 41 in the source program migration unit 4 performs a process of overwriting and updating the backup source program 53a on the displayed macro expansion source program 51b. (Step S12). Then, the backup source program deletion unit 42 deletes the backup source program 53a from the backup source program storage unit 53 (step S13).

次に、ソースプログラム移動部4は、ソースプログラムの移動箇所を判定する(ステップS14)。画面表示メニュー11の定義移動ボタン13が選択されると、ソースプログラム51a内でユーザが指定したマクロの定義箇所にジャンプする(ステップS15)。また、画面表示メニュー11の使用箇所移動ボタン14が選択されると、ソースプログラム51a内でユーザが指定したマクロの使用箇所にジャンプする(ステップS16)。   Next, the source program moving unit 4 determines the moving location of the source program (step S14). When the definition movement button 13 of the screen display menu 11 is selected, the program jumps to the macro definition location designated by the user in the source program 51a (step S15). When the use location moving button 14 of the screen display menu 11 is selected, the program jumps to the macro use location designated by the user in the source program 51a (step S16).

次に、上述した図5及び図6における各処理ブロックの詳細な内部情報について、図7〜図10を参照して説明する。
図7は、C言語によって記述されるソースプログラム51aのマクロ展開前後における表示例を示す説明図である。図7Aは、マクロ展開前のソースプログラム51aの表示例であり、図7Bは、マクロ展開ソースプログラム51bの表示例である。
Next, detailed internal information of each processing block in FIGS. 5 and 6 will be described with reference to FIGS.
FIG. 7 is an explanatory diagram showing a display example before and after macro expansion of the source program 51a described in the C language. FIG. 7A is a display example of the source program 51a before macro expansion, and FIG. 7B is a display example of the macro expansion source program 51b.

マクロ展開ソースプログラム51bは、図5のステップS3によって使用箇所が展開されたマクロ展開箇所57を含む。また、マクロ展開ソースプログラム51bは、図5のステップS1によって作成されたバックアップソースプログラム記憶部53を含む。そして、マクロ展開ソースプログラム51bは、MACRO1の定義箇所58と、MACRO2の定義箇所59を含む。以下の説明では、2種類のマクロである「MACRO1」と「MACRO2」を定めており、MACRO1,2は、それぞれ定義箇所58,59に定義されている。   The macro expansion source program 51b includes a macro expansion portion 57 where the use portion is expanded in step S3 of FIG. The macro expansion source program 51b includes the backup source program storage unit 53 created in step S1 of FIG. The macro expansion source program 51b includes a MACRO1 definition part 58 and a MACRO2 definition part 59. In the following description, two types of macros “MACRO1” and “MACRO2” are defined, and MACRO1 and MACRO2 are defined in definition locations 58 and 59, respectively.

まず、バックアップソースプログラム保存部21は、マクロ展開前のソースプログラム51aに記述されたファイル名が「xxxx.c」であるファイルをバックアップし、バックアップソースプログラム53aを作成する。このバックアップソースプログラム53aは、ファイル名を「xxxx.c」から「xxxx_bak.c」に変更したものであり、バックアップソースプログラム記憶部53に保存される。その後、マクロ展開処理部2は、ソースプログラム51aのマクロ展開を行ったマクロ展開ソースプログラム51bをソースプログラム記憶部51に上書きする。   First, the backup source program storage unit 21 backs up a file whose file name is “xxxx.c” described in the source program 51a before macro expansion, and creates a backup source program 53a. The backup source program 53 a is obtained by changing the file name from “xxxx.c” to “xxxx_bak.c”, and is stored in the backup source program storage unit 53. Thereafter, the macro expansion processing unit 2 overwrites the source program storage unit 51 with the macro expansion source program 51b obtained by performing the macro expansion of the source program 51a.

図8は、マクロ展開時に作成するテーブル52の内容を示す説明図である。
テーブル52は、展開したマクロの数だけマクロに関する情報を持ち、マクロ展開時に記憶部7に作成される。そして、テーブル52は、MACRO2の使用箇所52aと、展開したマクロ定義のファイル名52bと、ソースプログラム51aのマクロ使用箇所52cを含む。MACRO2の使用箇所52aには、MACRO2のマクロ名、マクロ展開ソースのファイル名、展開行の箇所が記述される。展開したマクロ定義のファイル名52bには、展開したマクロ定義のファイル名、定義箇所が記述される。ソースプログラム51aに記述されるマクロ使用箇所52cには、ソースファイル名及び使用箇所が記述される。
FIG. 8 is an explanatory diagram showing the contents of the table 52 created during macro expansion.
The table 52 has information on the macros as many as the number of expanded macros, and is created in the storage unit 7 when the macros are expanded. The table 52 includes the MACRO2 usage location 52a, the expanded macro definition file name 52b, and the macro usage location 52c of the source program 51a. The MACRO2 usage location 52a describes the MACRO2 macro name, the macro expansion source file name, and the location of the expanded line. The expanded macro definition file name 52b describes the expanded macro definition file name and definition location. In the macro use location 52c described in the source program 51a, the source file name and the use location are described.

テーブル52は、MACRO1の使用箇所52dと、MACRO1を呼び出すMACRO2の定義箇所52eを含む。MACRO1の使用箇所52dには、定義箇所59に記述されたMACRO2から呼ばれるMACRO1のマクロ名、マクロ展開ソースのファイル名、展開行の箇所が記述される。MACRO1の使用箇所52dに記述されるMACRO1は、定義箇所59に記述されたMACRO2から呼び出されている。このため、定義箇所52eに記述される情報は、MACRO1を呼び出しているMACRO2の定義箇所となり、展開したマクロ定義のファイル名52bと同じ情報となる。   The table 52 includes a use location 52d of MACRO1 and a definition location 52e of MACRO2 that calls MACRO1. The MACRO1 use location 52d describes the macro name of the MACRO1 called from the MACRO2 described in the definition location 59, the file name of the macro expansion source, and the location of the expanded line. MACRO1 described in the use location 52d of MACRO1 is called from MACRO2 described in the definition location 59. For this reason, the information described in the definition location 52e is the definition location of MACRO2 that calls MACRO1, and is the same information as the file name 52b of the expanded macro definition.

次に、図6に示したマクロ展開ソースプログラム51bからソースプログラム51aのユーザが指定したマクロに移動する方法について説明する。
ユーザは表示されたマクロ展開ソースプログラム51bから、ソースプログラム51aにおいてマクロが記述される箇所を特定する場合、ソースプログラム移動指示部3とソースプログラム移動部4を用いてジャンプする。このため、ユーザが自分で検索等を用いてソースプログラム51aからマクロを探さなくても、1度のボタン操作を行うだけで指定したマクロがソースプログラム51aに記述された箇所に移動して表示することが可能となる。この移動に際して、ユーザは、マクロ使用箇所、マクロ定義箇所、マクロのネストの途中部分等の任意の箇所を指定することができる。
Next, a method of moving from the macro expansion source program 51b shown in FIG. 6 to the macro designated by the user of the source program 51a will be described.
The user jumps using the source program movement instructing unit 3 and the source program moving unit 4 when specifying the part where the macro is described in the source program 51a from the displayed macro expansion source program 51b. For this reason, even if the user does not search for a macro from the source program 51a by using a search or the like by himself, the designated macro is moved to a location described in the source program 51a and displayed only by performing a single button operation. It becomes possible. In this movement, the user can specify an arbitrary location such as a macro use location, a macro definition location, or a macro nesting portion.

<マクロの使用箇所移動における表示処理の例>
図9は、マクロ展開ソースプログラム51bで指定したマクロの使用箇所へ移動した場合におけるソースプログラム51aの表示例を示す。図9Aは、マクロ展開ソースプログラム51bの表示例であり、図9Bは、使用箇所への移動後のソースプログラム51aの表示例である。
<Example of display processing for moving macro usage location>
FIG. 9 shows a display example of the source program 51a when moving to a macro use location designated by the macro expansion source program 51b. FIG. 9A is a display example of the macro expansion source program 51b, and FIG. 9B is a display example of the source program 51a after moving to the use location.

図9Aと図9Bに示すように、マクロ展開ソースプログラム51bから、ユーザが画面表示メニュー11の使用箇所移動ボタン14を選択すると、マクロ展開ソースプログラム51bからソースプログラム51aが表示される。   As shown in FIGS. 9A and 9B, when the user selects the use location moving button 14 of the screen display menu 11 from the macro expansion source program 51b, the source program 51a is displayed from the macro expansion source program 51b.

ここで、マクロ展開ソースプログラム51bには、ユーザが使用箇所移動を選択するマクロ名60がコメントとして記述される。そして、図9Aに示すように、マクロ展開ソースプログラム51bが表示されると同時に、バックアップソースプログラム53aが作成される。   Here, in the macro expansion source program 51b, a macro name 60 for the user to select use location movement is described as a comment. Then, as shown in FIG. 9A, the backup source program 53a is created at the same time as the macro expansion source program 51b is displayed.

ユーザが画面表示メニュー11の使用箇所移動ボタン14を選択すると、選択したマクロが使用されている箇所に移動したソースプログラム51aが表示される。また、ユーザがマクロのコメント行以外に展開された箇所から使用箇所移動ボタン14を選択すると、ユーザが右クリックで指定したマクロと、テーブル52に記述された内容とを照合して該当するソースプログラム51aのマクロを表示する。   When the user selects the use location moving button 14 of the screen display menu 11, the source program 51a moved to the location where the selected macro is used is displayed. Further, when the user selects the use location movement button 14 from the expanded portion other than the macro comment line, the corresponding source program is checked by comparing the macro specified by the right click with the content described in the table 52. The macro 51a is displayed.

ここで、図9Bに示すソースプログラム51aは、マクロ展開ソースプログラム51bをバックアップソースプログラム53aによって上書きしたものである。そして、図9Aに示すマクロ展開ソースプログラム51bにおいてユーザが選択したマクロ名60の使用箇所の移動先61は、上書きしたソースプログラム51aに表示される。また、上書き処理に際しては、バックアップソースプログラム削除部42は、ファイル名が「xxxx_bak.c」として表されるバックアップソースプログラム53aを削除する。   Here, the source program 51a shown in FIG. 9B is obtained by overwriting the macro expansion source program 51b with the backup source program 53a. Then, the movement destination 61 of the used location of the macro name 60 selected by the user in the macro expansion source program 51b shown in FIG. 9A is displayed in the overwritten source program 51a. In the overwriting process, the backup source program deleting unit 42 deletes the backup source program 53a whose file name is represented as “xxxx_bak.c”.

<マクロの定義箇所移動における表示処理の例>
図10は、マクロ展開ソースプログラム51bで指定したマクロの定義箇所へ移動した場合におけるソースプログラム51aの表示例を示す。図10Aは、マクロ展開ソースプログラム51bの表示例であり、図10Bは、定義箇所への移動後のソースプログラム51aの表示例である。
<Example of display processing when moving macro definition part>
FIG. 10 shows a display example of the source program 51a when moving to a macro definition location designated by the macro expansion source program 51b. FIG. 10A is a display example of the macro expansion source program 51b, and FIG. 10B is a display example of the source program 51a after moving to the definition location.

図10Aと図10Bに示すように、マクロ展開ソースプログラム51bから、ユーザが画面表示メニュー11の定義移動ボタン13を選択すると、マクロ展開ソースプログラム51bからソースプログラム51aが表示される。   As shown in FIGS. 10A and 10B, when the user selects the definition movement button 13 of the screen display menu 11 from the macro expansion source program 51b, the source program 51a is displayed from the macro expansion source program 51b.

ここで、マクロ展開したマクロ展開ソースプログラム51bには、ユーザが定義箇所移動を選択するマクロ名62がコメントとして記述される。そして、図10Aに示すように、マクロ展開ソースプログラム51bが表示されると同時に、バックアップソースプログラム53aが作成されている。   Here, in the macro expansion source program 51b that has been subjected to macro expansion, a macro name 62 that the user selects to move the defined part is described as a comment. Then, as shown in FIG. 10A, the backup source program 53a is created at the same time as the macro expansion source program 51b is displayed.

ユーザが画面表示メニュー11の定義移動ボタン13を選択すると、選択したマクロが定義されている箇所に移動したソースプログラム51aが表示される。また、ユーザがマクロのコメント行以外に展開された箇所から定義移動ボタン13を選択すると、ユーザが右クリックで指定したマクロと、テーブル52に記述された内容とを照合して該当するソースプログラム51aのマクロの定義箇所を表示する。   When the user selects the definition move button 13 of the screen display menu 11, the source program 51a moved to the location where the selected macro is defined is displayed. When the user selects the move definition button 13 from a location other than the macro comment line, the macro specified by the right click and the contents described in the table 52 are collated and the corresponding source program 51a. The definition part of the macro is displayed.

ここで、図10Bに示すソースプログラム51aは、マクロ展開ソースプログラム51bをバックアップソースプログラム53aによって上書きしたものである。そして、図10Aに示すマクロ展開ソースプログラム51bにおいてユーザが選択したマクロ名60の定義箇所の移動先63には、「file2.h」が表示される。また、上書き処理に際しては、バックアップソースプログラム削除部42は、ファイル名が「xxxx_bak.c」として表されるバックアップソースプログラム53aを削除する。   Here, the source program 51a shown in FIG. 10B is obtained by overwriting the macro expansion source program 51b with the backup source program 53a. Then, “file2.h” is displayed in the movement destination 63 of the definition location of the macro name 60 selected by the user in the macro expansion source program 51b shown in FIG. 10A. In the overwriting process, the backup source program deleting unit 42 deletes the backup source program 53a whose file name is represented as “xxxx_bak.c”.

以上説明した一実施の形態例に係るマクロ展開装置10によれば、ソースプログラム51aをマクロ展開してマクロ展開ソースプログラム51bを表示することができる。また、マクロ展開ソースプログラム51bからユーザが指定したマクロの使用箇所又は定義箇所を選択して、ソースプログラム51a内におけるマクロの特定箇所に移動して表示することができる。このため、ユーザのデバッグが容易となり、かつ、ソースプログラム51a及びマクロ展開ソースプログラム51bの紐付けがされる。また、ソースプログラム51aへの移動が容易となり、効率のよいプログラム開発を行うことができる。   According to the macro expansion apparatus 10 according to the embodiment described above, the source program 51a can be macro expanded and the macro expanded source program 51b can be displayed. Further, a macro use location or definition location specified by the user can be selected from the macro expansion source program 51b, and can be moved to a specific location of the macro in the source program 51a and displayed. Therefore, the user can easily debug, and the source program 51a and the macro expansion source program 51b are linked. Further, it is easy to move to the source program 51a, and efficient program development can be performed.

また、マクロ展開ソースプログラム51bには、展開されたマクロが含まれるため、ユーザが編集できないように表示することが望ましい。なお、バックアップソースプログラム53aは、マクロ展開する前のソースプログラム51aをバックアップしたものであるため、同じくユーザが編集できないようにしておく。   Further, since the macro expansion source program 51b includes the expanded macro, it is desirable to display the macro expansion source program 51b so that it cannot be edited by the user. The backup source program 53a is a backup of the source program 51a before the macro expansion, so that it cannot be edited by the user.

本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、さらに、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。また、本書で述べた中間語命令の名称及び書式は一例であり、実装に応じて、名称及び書式の変更、又は情報の追加を行ってもよい。   The present invention is not limited to the above-described embodiments, and includes various modifications. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described. Further, a part of the configuration of one embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of one embodiment. Further, it is possible to add, delete, and replace other configurations for a part of the configuration of each embodiment. Further, the names and formats of the intermediate language instructions described in this document are examples, and the names and formats may be changed or information may be added depending on the implementation.

また、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、又は、ICカード、SDカード、DVD等の記録媒体に置くことができる。また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。   Each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit. Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor. Information such as programs, tables, and files that realize each function can be stored in a recording device such as a memory, a hard disk, or an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, or a DVD. Further, the control lines and information lines indicate what is considered necessary for the explanation, and not all the control lines and information lines on the product are necessarily shown. Actually, it may be considered that almost all the components are connected to each other.

1…マクロ展開指示部、2…マクロ展開処理部、3…ソースプログラム移動指示部、4…ソースプログラム移動部、5…表示部、6…操作部、7…記憶部、10…マクロ展開装置、11…画面表示メニュー、12…マクロ展開ボタン、13…定義移動ボタン、14…使用箇所移動ボタン、21…バックアップソースプログラム保存部、22…プリプロセス制御部、41…バックアップソースプログラム回復部、42…バックアップソースプログラム削除部、43…ソースプログラムジャンプ処理部、51…ソースプログラム記憶部、51a…ソースプログラム、51b…マクロ展開ソースプログラム、52…テーブル、53…バックアップソースプログラム記憶部、53a…バックアップソースプログラム、55…マクロ定義箇所、56…マクロ使用箇所、57…マクロ展開箇所、58…定義箇所、59…定義箇所、60…マクロ名、61…移動先、62…マクロ名、63…移動先
DESCRIPTION OF SYMBOLS 1 ... Macro expansion | deployment instruction | indication part, 2 ... Macro expansion | deployment process part, 3 ... Source program movement instruction | indication part, 4 ... Source program movement part, 5 ... Display part, 6 ... Operation part, 7 ... Memory | storage part, 10 ... Macro expansion | deployment apparatus, DESCRIPTION OF SYMBOLS 11 ... Screen display menu, 12 ... Macro expansion button, 13 ... Definition movement button, 14 ... Usage location movement button, 21 ... Backup source program storage part, 22 ... Pre-process control part, 41 ... Backup source program recovery part, 42 ... Backup source program deletion unit, 43 ... Source program jump processing unit, 51 ... Source program storage unit, 51a ... Source program, 51b ... Macro expansion source program, 52 ... Table, 53 ... Backup source program storage unit, 53a ... Backup source program 55 ... Macro definition part, 56 ... Ma (B) Where it is used, 57 ... macro expansion point, 58 ... definition point, 59 ... definition point, 60 ... macro name, 61 ... destination, 62 ... macro name, 63 ... destination

Claims (7)

ソースプログラムに記述されたマクロを展開する指示を行うマクロ展開指示部と、
前記マクロをソースプログラムに展開したマクロ展開ソースプログラムを作成し、前記マクロ展開ソースプログラムを表示部に表示するマクロ展開処理部と、
前記表示部に表示される前記マクロ展開ソースプログラムに対して、ソースプログラムへの特定箇所への移動を指示するソースプログラム移動指示部と、
指示された前記特定箇所に移動して前記ソースプログラムを前記表示部に表示するソースプログラム移動部と、を備える
マクロ展開装置。
A macro expansion instruction section for instructing expansion of a macro described in the source program;
Creating a macro expansion source program in which the macro is expanded into a source program, and displaying the macro expansion source program on a display unit;
A source program movement instruction unit that instructs the macro expansion source program displayed on the display unit to move to a specific location in the source program;
A macro expansion device comprising: a source program moving unit that moves to the designated specific location and displays the source program on the display unit.
前記ソースプログラム移動指示部は、前記ソースプログラムに記述されている前記マクロの使用箇所、又は前記ソースプログラムに記述されたマクロの定義が記述されている箇所を前記特定箇所とし、前記特定箇所への移動指示を、前記マクロ展開ソースプログラムに表示される選択ボタンの操作によって行う
請求項1記載のマクロ展開装置。
The source program movement instructing unit sets the use location of the macro described in the source program or the location where the definition of the macro described in the source program is described as the specific location, to the specific location. The macro expansion device according to claim 1, wherein the movement instruction is performed by operating a selection button displayed in the macro expansion source program.
前記マクロ展開処理部は、
前記ソースプログラムのバックアップとして作成したバックアップソースプログラムをバックアップソースプログラム記憶部に保存するバックアップソースプログラム保存部と、
プリプロセス処理により前記ソースプログラムをマクロ展開した前記マクロ展開ソースプログラムを前記表示部に出力するプリプロセス制御部と、を備え、
前記ソースプログラム移動部は、
前記バックアップソースプログラム記憶部から読み出した前記バックアップソースプログラムを前記ソースプログラム記憶部に上書きする回復処理を行うバックアップソースプログラム回復部と、
前記ソースプログラム記憶部に上書きした前記バックアップソースプログラムを、前記バックアップソースプログラム記憶部から削除するバックアップソースプログラム削除部と、を備え、
前記ソースプログラム移動指示部によって指示された前記特定箇所への移動指示に基づいて、前記ソースプログラム記憶部から読み出した前記ソースプログラムを表示して前記特定箇所に移動する
請求項2記載のマクロ展開装置。
The macro expansion processing unit
A backup source program storage unit for storing a backup source program created as a backup of the source program in a backup source program storage unit;
A pre-process control unit that outputs the macro-expanded source program obtained by macro-expanding the source program to the display unit by pre-processing,
The source program moving unit is:
A backup source program recovery unit that performs a recovery process of overwriting the backup source program read from the backup source program storage unit on the source program storage unit;
A backup source program deletion unit for deleting the backup source program overwritten on the source program storage unit from the backup source program storage unit,
The macro expansion device according to claim 2, wherein the source program read from the source program storage unit is displayed and moved to the specific location based on an instruction to move to the specific location specified by the source program transfer instruction unit. .
前記マクロ展開処理部は、前記マクロ展開ソースプログラムに展開したマクロの名称をコメントとして挿入し、
前記プリプロセス制御部は、展開した前記マクロのマクロ名、前記マクロの展開箇所、及び前記マクロが定義されている箇所、前記マクロが前記ソースプログラムに記述されている箇所を前記記憶部に作成したテーブルに保存する
請求項3記載のマクロ展開装置。
The macro expansion processing unit inserts the name of the macro expanded in the macro expansion source program as a comment,
The preprocess control unit creates a macro name of the expanded macro, a location where the macro is expanded, a location where the macro is defined, and a location where the macro is described in the source program in the storage unit. The macro expansion device according to claim 3, wherein the macro expansion device is stored in a table.
前記マクロ展開処理部は、展開した前記マクロの引数に色をつけて前記表示部に表示する
請求項4記載のマクロ展開装置。
The macro expansion device according to claim 4, wherein the macro expansion processing unit colors the argument of the expanded macro and displays it on the display unit.
前記マクロ展開指示部は、前記ソースプログラムに記述されている個別のマクロ毎、又は前記ソースプログラムに記述されている全てのマクロを選択して展開することを指示する
請求項5記載のマクロ展開装置。
6. The macro expansion device according to claim 5, wherein the macro expansion instruction unit instructs to select and expand each individual macro described in the source program or all macros described in the source program. .
ソースプログラムに記述されたマクロを展開する指示を行う手順、
前記マクロをソースプログラムに展開したマクロ展開ソースプログラムを作成し、前記マクロ展開ソースプログラムを表示部に表示する手順、
前記表示部に表示される前記マクロ展開ソースプログラムに対して、ソースプログラムへの特定箇所への移動を指示する手順、
指示された前記特定箇所に移動して前記ソースプログラムを前記表示部に表示する手順とを、
コンピュータに実行させるプログラム。
A procedure for instructing to expand macros described in the source program,
Creating a macro expansion source program in which the macro is expanded into a source program, and displaying the macro expansion source program on a display unit;
A procedure for instructing the macro expansion source program displayed on the display unit to move to a specific location in the source program;
A procedure for moving to the designated specific location and displaying the source program on the display unit;
A program to be executed by a computer.
JP2011289186A 2011-12-28 2011-12-28 Macro expansion device and program Pending JP2013137716A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011289186A JP2013137716A (en) 2011-12-28 2011-12-28 Macro expansion device and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011289186A JP2013137716A (en) 2011-12-28 2011-12-28 Macro expansion device and program

Publications (1)

Publication Number Publication Date
JP2013137716A true JP2013137716A (en) 2013-07-11

Family

ID=48913371

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011289186A Pending JP2013137716A (en) 2011-12-28 2011-12-28 Macro expansion device and program

Country Status (1)

Country Link
JP (1) JP2013137716A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139435A (en) * 2018-02-08 2019-08-22 三菱電機株式会社 Source code displaying device, source code displaying method and source code displaying program
CN117111950A (en) * 2023-08-23 2023-11-24 北京云枢创新软件技术有限公司 Macro text unfolding method based on constant macro definition, electronic equipment and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4022A (en) * 1845-05-01 Improvement in machines for hackling and cleaning hemp and flax
JPH03154124A (en) * 1989-11-10 1991-07-02 Sord Comput Corp Text editor processing method for computer source programs
JPH05257702A (en) * 1992-03-10 1993-10-08 Fujitsu Ltd System for preparing macro built-in type intermediate language text file
JPH08286897A (en) * 1995-04-19 1996-11-01 Toshiba Corp Program editing device having hierarchical structure display function
JPH11154093A (en) * 1997-11-21 1999-06-08 Toshiba Corp Program Compiler and Recording Medium Recording Compiler Program
JP2000148508A (en) * 1998-11-11 2000-05-30 Nec Corp Program editor
JP2000215037A (en) * 1999-01-22 2000-08-04 Toshiba Corp Device and method for displaying source code and debugging processor
JP2006146731A (en) * 2004-11-24 2006-06-08 Ricoh Co Ltd Program, storage medium, assembler device, compiler device, simulator device, and emulator device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4022A (en) * 1845-05-01 Improvement in machines for hackling and cleaning hemp and flax
JPH03154124A (en) * 1989-11-10 1991-07-02 Sord Comput Corp Text editor processing method for computer source programs
JPH05257702A (en) * 1992-03-10 1993-10-08 Fujitsu Ltd System for preparing macro built-in type intermediate language text file
JPH08286897A (en) * 1995-04-19 1996-11-01 Toshiba Corp Program editing device having hierarchical structure display function
JPH11154093A (en) * 1997-11-21 1999-06-08 Toshiba Corp Program Compiler and Recording Medium Recording Compiler Program
JP2000148508A (en) * 1998-11-11 2000-05-30 Nec Corp Program editor
JP2000215037A (en) * 1999-01-22 2000-08-04 Toshiba Corp Device and method for displaying source code and debugging processor
JP2006146731A (en) * 2004-11-24 2006-06-08 Ricoh Co Ltd Program, storage medium, assembler device, compiler device, simulator device, and emulator device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019139435A (en) * 2018-02-08 2019-08-22 三菱電機株式会社 Source code displaying device, source code displaying method and source code displaying program
JP7008527B2 (en) 2018-02-08 2022-01-25 三菱電機株式会社 Source code display device, source code display method and source code display program
CN117111950A (en) * 2023-08-23 2023-11-24 北京云枢创新软件技术有限公司 Macro text unfolding method based on constant macro definition, electronic equipment and medium
CN117111950B (en) * 2023-08-23 2024-03-29 北京云枢创新软件技术有限公司 Macro text unfolding method based on constant macro definition, electronic equipment and medium

Similar Documents

Publication Publication Date Title
US5926638A (en) Program debugging system for debugging a program having graphical user interface
US10042861B2 (en) Historical view of open files
US20030149961A1 (en) Apparatus, method, and program for breakpoint setting
JPH05346875A (en) Automation testing system for computer application software
JP4957017B2 (en) Performance tuning method and apparatus, program, and storage medium
US7765535B2 (en) Software development tool program
KR20070058954A (en) Apparatus and method for supporting embedded system prototype development
US10884711B2 (en) Code management system and code management method using a visual programming tool
JP2006119884A (en) Editing apparatus of sequence program
US8473903B2 (en) Code edit apparatus and recording medium
JP6984565B2 (en) Information processing equipment and programs
JP2009104252A (en) Debugging support device and debugging support method
JP2013137716A (en) Macro expansion device and program
JP5785474B2 (en) Program debugging method, debugging apparatus, and debugging support GUI
JP4675639B2 (en) Data processing system, method for displaying customization parameters of application program, and computer program product
JP4983519B2 (en) Development support device and development support program
JP2011227823A (en) Control program creation apparatus and method for driving the same
US20090273605A1 (en) Operation Checking Method in Information System, Operation Checking Program Therefor, Recording Medium, and Operation Checking System
JP7479188B2 (en) DEBUG SUPPORT DEVICE, DEBUG SUPPORT METHOD, AND PROGRAM
JP2009169628A (en) Construction device, construction method and program for monitoring control system
CN109019217B (en) Elevator control software field debugging system
JP2000330821A (en) How to create software for embedded systems
JP2007226739A (en) Software development device and program
JP2004272409A (en) Object temporary fixing device, object temporary fixing method, and object temporary fixing program
JP2000089945A (en) Integrated software development support system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131021

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140519

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140624

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20141021