JP2013137716A - Macro expansion device and program - Google Patents
Macro expansion device and program Download PDFInfo
- 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
Links
Images
Landscapes
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Abstract
【課題】展開したソースプログラムをデバッグ中に、展開したソースプログラムを修正する場合は、最終的にはユーザがソースプログラムの不良箇所を特定して修正する必要がある。しかし、展開したデバッグ用のソースプログラムと展開ソースプログラムの2つの箇所関係をユーザが手動で特定しなければいけない。
【解決手段】ソースプログラムに記述されたマクロを展開する指示を行うマクロ展開指示部1と、マクロをソースプログラム51aに展開したマクロ展開ソースプログラム51bを作成し、マクロ展開ソースプログラム51bを表示部に表示するマクロ展開処理部2と、表示部に表示されるマクロ展開ソースプログラム51bに対して、ソースプログラム51aへの特定箇所への移動を指示するソースプログラム移動指示部3と、指示された特定箇所に移動してソースプログラム51aを表示部に表示するソースプログラム移動部4と、を備える。
【選択図】図5When 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
特許文献1には、C言語を用いて記述されたソースプログラムをマクロ定義の定義内容に従って展開する過程において、マクロ定義の内容を示す文字列配列変数を得た後、展開後のソースプログラムに文字列配列変数を付加する技術が開示されている。そして、ソースプログラムのマクロ使用命令に対して、マクロ定義内容を展開してデバッグするプログラムコンパイラが提供されている。
In
ここで、マクロ展開した後のソースプログラムをデバッグ中に、ユーザが特定した不良箇所を修正する場合を想定する。このとき、特許文献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
本発明はこのような状況に鑑みて成されたものであり、マクロ展開したソースプログラム内に記述されたマクロのコメントから、マクロ展開される前のソースプログラムにおけるマクロの特定箇所に移動して表示する方法を提供するものである。 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.
以下、本発明の一実施の形態例について、添付図面を参照して説明する。本実施の形態例では、ソースプログラムに記述されるマクロを展開して表示部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
次に、マクロ展開装置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
そして、ユーザがソースプログラムのデバッグを行う際には、マクロ展開ソースプログラム内のマクロの不良箇所を特定すると、ソースプログラムに移動して特定されたマクロが表示される。以下の説明では、マクロ展開ソースプログラム内でマクロを指定して、このマクロが記述されているソースプログラムの特定箇所を表示することを、「ジャンプ」と呼ぶ。 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
ソースプログラム記憶部51は、マクロ展開される前のソースプログラム51aを記憶する。そして、ソースプログラム51aがマクロ展開されると、ソースプログラム記憶部51にマクロ展開ソースプログラム51bが上書き保存される。バックアップソースプログラム記憶部53には、バックアップとしてコピーされたマクロ展開される前のソースプログラム51aを記憶する。
The source
また、マクロ展開処理部2は、バックアップソースプログラム保存部21とプリプロセス制御部22を備える。バックアップソースプログラム保存部21は、ソースプログラム記憶部51から読み出したソースプログラム51aをバックアップしたバックアップソースプログラム53aを、バックアップソースプログラム記憶部53に保存する。プリプロセス制御部22は、C言語等でコンパイルを行う前にソースプログラム51aにプリプロセス処理を行って、マクロ展開したマクロ展開ソースプログラム51bをソースプログラム記憶部51に保存する。
The macro
また、ソースプログラム移動部4は、バックアップソースプログラム回復部41と、バックアップソースプログラム削除部42と、ソースプログラムジャンプ処理部43とを備える。バックアップソースプログラム回復部41は、ソースプログラム記憶部51に記憶されているソースプログラム51aに対して、バックアップソースプログラム記憶部53から読み出したバックアップソースプログラム53aを上書きする回復処理を行う。バックアップソースプログラム削除部42は、バックアップソースプログラム記憶部53からマクロ展開ソースプログラム51bを削除する処理を行う。ソースプログラムジャンプ処理部43は、ソースプログラム記憶部51に保存されているソースプログラム51aにアクセスして、マクロの特定箇所にジャンプする処理を行う。
Further, the source
ここで、各処理ブロックの動作を説明する前に、マクロ展開装置10が画面に表示する画面表示メニュー11に含まれる各種のボタンの例を説明する。
Here, before explaining the operation of each processing block, examples of various buttons included in the
図3は、マクロ展開装置10を制御する画面表示メニュー11である。
ユーザがソースプログラム51aを右クリックすると、表示部5に画面表示メニュー11が表示される。なお、右クリックとしたのは一例であり、画面表示メニュー11を出現させる手法は限定されない。そして、ユーザが画面表示メニュー11からマクロ展開ボタン12を選択すると、選択されたマクロ展開ボタン12は反転表示され、プリプロセス制御部22によってマクロ展開が実行される。なお、マクロ展開はソースプログラム51aに含まれる全てのマクロ、又は指定したマクロ毎に展開することが可能である。
FIG. 3 shows a
When the user right-clicks the
その後、マクロ展開ソースプログラム51b内のマクロに対して、ユーザが定義移動ボタン13を選択すると、ソースプログラム51a内のユーザが選択したマクロの定義箇所にジャンプすることができる。一方、ユーザが使用箇所移動ボタン14を選択すると、ソースプログラム51a内のユーザが選択したマクロの使用箇所にジャンプすることができる。また、デバッグにてソースプログラム記憶部51の修正が不要である場合には、ソースプログラム51aのマクロ展開した箇所に戻るという意味で、使用箇所移動ボタン14を選択すればよい。
Thereafter, when the user selects the
ここで、図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
マクロ展開処理部2は、ソースプログラム51aに対してマクロ使用箇所をマクロの実体に置換するプロセスであり、マクロ展開指示部1からマクロ展開の指示を受けると、ソースプログラム記憶部51をマクロ展開して表示する。また、マクロ展開処理部2は、マクロ展開ソースプログラム51bに展開したマクロの名称をコメントとしてソースプログラム51aに挿入する。
The macro
このとき、バックアップソースプログラム保存部21は、マクロ展開をする前のソースプログラム51aをバックアップしたバックアップソースプログラム53aをバックアップソースプログラム記憶部53に保存する。そして、プリプロセス制御部22は、ソースプログラム記憶部51から読み出したソースプログラム51aをマクロ展開したマクロ展開ソースプログラム51bをソースプログラム記憶部51に上書き保存する。
At this time, the backup source
ソースプログラム移動指示部3は、ソースプログラム移動部4の実行を、ユーザが定義移動ボタン13又は使用箇所移動ボタン14等の選択ボタンを選択することによって制御する。ソースプログラム移動部4は、マクロ展開ソースプログラム51bから、ユーザが指定したマクロの定義がされている箇所又はマクロが使用されている箇所を特定箇所とし、この特定箇所にジャンプするプロセスである。ソースプログラム移動部4は、ソースプログラム51aへの移動、バックアップソースプログラム記憶部53に保存したバックアップソースプログラム53aの削除、及びソースプログラム51aに記述されるマクロの特定箇所へジャンプ処理を行う。
The source program
バックアップソースプログラム回復部41は、バックアップソースプログラム記憶部53から読み出したバックアップソースプログラム53aをソースプログラム記憶部51に上書き保存する。バックアップソースプログラム削除部42は、バックアップソースプログラム記憶部53からバックアップソースプログラム53aを削除する。
The backup source
ソースプログラムジャンプ処理部43は、ユーザが指定したソースプログラム51aの特定箇所へ移動して、ソースプログラム51aを表示する。なお、ソースプログラム51aに移動するときにマクロ展開ソースプログラム51bを自動的に削除しているが、マクロ展開ソースプログラム51bを残したままとしてもよい。
The source program
図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
上述したように、ユーザがソースプログラム51aに記述されている特定のマクロを指定して、画面表示メニュー11のマクロ展開ボタン12を選択する。この選択により、マクロ展開処理部2は、指定されたマクロを展開したマクロ展開ソースプログラム51bを表示部5に表示する。
As described above, the user designates a specific macro described in the
一方、ユーザが特定のマクロを指定せずに、マクロ展開ボタン12を選択すると、マクロ展開処理部2は、ソースプログラム51aに記述されている全てのマクロを展開したマクロ展開ソースプログラム51bを表示部5に表示する。その後、ユーザは、マクロ展開ソースプログラム51bを使用してテストとデバッグを行うこととなる。そして、ユーザが特定のマクロを指定して定義移動ボタン13を選択すると、ソースプログラム移動部4は、指定されたマクロがソースプログラム51a内で定義されている箇所に移動して、この指定されたマクロを表示部5に表示する。
On the other hand, when the user selects the
次に、ユーザがテスト・デバッグを行った後に、ソースプログラム51aに戻る方法について説明を行う。
ユーザがマクロ展開ソースプログラム51bに記述されたマクロを指定して定義移動ボタン13を選択すると、ソースプログラム51a内でマクロが定義されているマクロ定義箇所55を表示する。また、ユーザがマクロを指定して使用箇所移動ボタン14を選択すると、ソースプログラム51a内でマクロが使用されているマクロ使用箇所56を表示する。また、ソースプログラム51a内におけるマクロ定義がネスト(入れ子)で記述されている場合であっても、任意のマクロ定義箇所55へジャンプすることも可能である。
Next, a method of returning to the
When the user designates a macro described in the macro
<マクロ展開指示部1及びマクロ展開処理部2の処理例>
図5は、マクロ展開指示部1及びマクロ展開処理部2の処理例を示すフローチャートである。図5において、マクロ展開指示部1は、ステップS1のマクロ展開判定処理を行い、マクロ展開処理部2は、ステップS2〜S4のマクロ展開処理を行う。
<Processing Example of Macro
FIG. 5 is a flowchart showing a processing example of the macro
始めに、マクロ展開指示部1は、ソースプログラム51aに対してマクロ展開の実施を指示したか否かを判定する(ステップS1)。マクロ展開の実施は、ユーザがソースプログラム51aに対してマクロ展開ボタン12を選択することによりステップS2以降の動作が開始する。マクロ展開を実施しない時は全ての処理を終了する。
First, the macro
次に、マクロ展開処理部2内のバックアップソースプログラム保存部21は、マクロ展開前のソースプログラム51aをバックアップしたバックアップソースプログラム53aを作成し(ステップS2)、バックアップソースプログラム記憶部53に保存する。バックアップソースプログラム53aは、マクロ展開ソースプログラム51bをソースプログラム51aに戻す際に使用する。
Next, the backup source
次に、マクロ展開処理部2は、プリプロセス処理によりソースプログラム51aのマクロ展開を行い、マクロ展開ソースプログラム51bを作成する(ステップS3)。マクロ展開されるマクロが関数型マクロである場合は、マクロ展開処理部2は、引数を展開した部分に色をつける。このため、マクロ展開ソースプログラム51b内で、色が付けられ引数が展開された部分と、マクロ処理が行われる部分を明確に区別して表示部5に表示することが可能となる。最後に、マクロ展開処理部2は、マクロ展開ソースプログラム51bを表示部5に出力して表示させる(ステップS4)。
Next, the macro
<ソースプログラム移動指示部3及びソースプログラム移動部4の処理例>
図6は、ソースプログラム移動指示部3及びソースプログラム移動部4のフローチャートである。図6において、ソースプログラム移動指示部3は、ステップS11のソースプログラム51aへの移動判定処理を行い、ソースプログラム移動部4は、ステップS12〜S16のジャンプ処理を行う。
<Processing Example of Source Program
FIG. 6 is a flowchart of the source program
始めに、ソースプログラム移動指示部3は、ソースプログラム51aへの移動を指示したか否かを判定する(ステップS11)。ソースプログラム51aへの移動は、ユーザが画面表示メニュー11の定義移動ボタン13又は使用箇所移動ボタン14を選択したことに連動して開始する。移動を指示しない時は全ての処理を終了する。
First, the source program
ステップ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
次に、ソースプログラム移動部4は、ソースプログラムの移動箇所を判定する(ステップS14)。画面表示メニュー11の定義移動ボタン13が選択されると、ソースプログラム51a内でユーザが指定したマクロの定義箇所にジャンプする(ステップS15)。また、画面表示メニュー11の使用箇所移動ボタン14が選択されると、ソースプログラム51a内でユーザが指定したマクロの使用箇所にジャンプする(ステップS16)。
Next, the source
次に、上述した図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
マクロ展開ソースプログラム51bは、図5のステップS3によって使用箇所が展開されたマクロ展開箇所57を含む。また、マクロ展開ソースプログラム51bは、図5のステップS1によって作成されたバックアップソースプログラム記憶部53を含む。そして、マクロ展開ソースプログラム51bは、MACRO1の定義箇所58と、MACRO2の定義箇所59を含む。以下の説明では、2種類のマクロである「MACRO1」と「MACRO2」を定めており、MACRO1,2は、それぞれ定義箇所58,59に定義されている。
The macro
まず、バックアップソースプログラム保存部21は、マクロ展開前のソースプログラム51aに記述されたファイル名が「xxxx.c」であるファイルをバックアップし、バックアップソースプログラム53aを作成する。このバックアップソースプログラム53aは、ファイル名を「xxxx.c」から「xxxx_bak.c」に変更したものであり、バックアップソースプログラム記憶部53に保存される。その後、マクロ展開処理部2は、ソースプログラム51aのマクロ展開を行ったマクロ展開ソースプログラム51bをソースプログラム記憶部51に上書きする。
First, the backup source
図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
テーブル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
The user jumps using the source program
<マクロの使用箇所移動における表示処理の例>
図9は、マクロ展開ソースプログラム51bで指定したマクロの使用箇所へ移動した場合におけるソースプログラム51aの表示例を示す。図9Aは、マクロ展開ソースプログラム51bの表示例であり、図9Bは、使用箇所への移動後のソースプログラム51aの表示例である。
<Example of display processing for moving macro usage location>
FIG. 9 shows a display example of the
図9Aと図9Bに示すように、マクロ展開ソースプログラム51bから、ユーザが画面表示メニュー11の使用箇所移動ボタン14を選択すると、マクロ展開ソースプログラム51bからソースプログラム51aが表示される。
As shown in FIGS. 9A and 9B, when the user selects the use
ここで、マクロ展開ソースプログラム51bには、ユーザが使用箇所移動を選択するマクロ名60がコメントとして記述される。そして、図9Aに示すように、マクロ展開ソースプログラム51bが表示されると同時に、バックアップソースプログラム53aが作成される。
Here, in the macro
ユーザが画面表示メニュー11の使用箇所移動ボタン14を選択すると、選択したマクロが使用されている箇所に移動したソースプログラム51aが表示される。また、ユーザがマクロのコメント行以外に展開された箇所から使用箇所移動ボタン14を選択すると、ユーザが右クリックで指定したマクロと、テーブル52に記述された内容とを照合して該当するソースプログラム51aのマクロを表示する。
When the user selects the use
ここで、図9Bに示すソースプログラム51aは、マクロ展開ソースプログラム51bをバックアップソースプログラム53aによって上書きしたものである。そして、図9Aに示すマクロ展開ソースプログラム51bにおいてユーザが選択したマクロ名60の使用箇所の移動先61は、上書きしたソースプログラム51aに表示される。また、上書き処理に際しては、バックアップソースプログラム削除部42は、ファイル名が「xxxx_bak.c」として表されるバックアップソースプログラム53aを削除する。
Here, the
<マクロの定義箇所移動における表示処理の例>
図10は、マクロ展開ソースプログラム51bで指定したマクロの定義箇所へ移動した場合におけるソースプログラム51aの表示例を示す。図10Aは、マクロ展開ソースプログラム51bの表示例であり、図10Bは、定義箇所への移動後のソースプログラム51aの表示例である。
<Example of display processing when moving macro definition part>
FIG. 10 shows a display example of the
図10Aと図10Bに示すように、マクロ展開ソースプログラム51bから、ユーザが画面表示メニュー11の定義移動ボタン13を選択すると、マクロ展開ソースプログラム51bからソースプログラム51aが表示される。
As shown in FIGS. 10A and 10B, when the user selects the
ここで、マクロ展開したマクロ展開ソースプログラム51bには、ユーザが定義箇所移動を選択するマクロ名62がコメントとして記述される。そして、図10Aに示すように、マクロ展開ソースプログラム51bが表示されると同時に、バックアップソースプログラム53aが作成されている。
Here, in the macro
ユーザが画面表示メニュー11の定義移動ボタン13を選択すると、選択したマクロが定義されている箇所に移動したソースプログラム51aが表示される。また、ユーザがマクロのコメント行以外に展開された箇所から定義移動ボタン13を選択すると、ユーザが右クリックで指定したマクロと、テーブル52に記述された内容とを照合して該当するソースプログラム51aのマクロの定義箇所を表示する。
When the user selects the
ここで、図10Bに示すソースプログラム51aは、マクロ展開ソースプログラム51bをバックアップソースプログラム53aによって上書きしたものである。そして、図10Aに示すマクロ展開ソースプログラム51bにおいてユーザが選択したマクロ名60の定義箇所の移動先63には、「file2.h」が表示される。また、上書き処理に際しては、バックアップソースプログラム削除部42は、ファイル名が「xxxx_bak.c」として表されるバックアップソースプログラム53aを削除する。
Here, the
以上説明した一実施の形態例に係るマクロ展開装置10によれば、ソースプログラム51aをマクロ展開してマクロ展開ソースプログラム51bを表示することができる。また、マクロ展開ソースプログラム51bからユーザが指定したマクロの使用箇所又は定義箇所を選択して、ソースプログラム51a内におけるマクロの特定箇所に移動して表示することができる。このため、ユーザのデバッグが容易となり、かつ、ソースプログラム51a及びマクロ展開ソースプログラム51bの紐付けがされる。また、ソースプログラム51aへの移動が容易となり、効率のよいプログラム開発を行うことができる。
According to the macro expansion apparatus 10 according to the embodiment described above, the
また、マクロ展開ソースプログラム51bには、展開されたマクロが含まれるため、ユーザが編集できないように表示することが望ましい。なお、バックアップソースプログラム53aは、マクロ展開する前のソースプログラム51aをバックアップしたものであるため、同じくユーザが編集できないようにしておく。
Further, since the macro
本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、さらに、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。また、本書で述べた中間語命令の名称及び書式は一例であり、実装に応じて、名称及び書式の変更、又は情報の追加を行ってもよい。 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
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.
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)
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)
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 |
-
2011
- 2011-12-28 JP JP2011289186A patent/JP2013137716A/en active Pending
Patent Citations (8)
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)
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 |