JP2004139313A - Source code display system and program - Google Patents

Source code display system and program Download PDF

Info

Publication number
JP2004139313A
JP2004139313A JP2002302814A JP2002302814A JP2004139313A JP 2004139313 A JP2004139313 A JP 2004139313A JP 2002302814 A JP2002302814 A JP 2002302814A JP 2002302814 A JP2002302814 A JP 2002302814A JP 2004139313 A JP2004139313 A JP 2004139313A
Authority
JP
Japan
Prior art keywords
source code
program
display
information
execution
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
JP2002302814A
Other languages
Japanese (ja)
Inventor
Tomohiro Shudo
首藤 智大
Shigeru Tago
多胡 滋
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 Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co 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 Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2002302814A priority Critical patent/JP2004139313A/en
Publication of JP2004139313A publication Critical patent/JP2004139313A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To display a source code of an executive program or information related to the source code in association with operation of the executive program for supporting learning of meaning and the like of the executive program. <P>SOLUTION: A source code display system is provided with an information acquisition means and a display means. The information acquisition means determines whether a display control command is described or not in the program in an operation condition of the source code display objective program, temporarily stops operation of the program if the display control command is described, recognizes the described display control command in a stopped condition, and acquires the source code of the corresponding executive program or its related information from a source code file or a related information file in association with the recognized display control command. The display means displays the acquired source code or the related information. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、プログラムのソースコード表示システムに関し、特にプログラムを実行しながらソースコードまたは関連情報を表示するソースコード表示システムに関するものである。
【0002】
【従来の技術】
コンピュータのプログラミングの学習時などにおいては、プログラムのサンプルコードを表示し、実際にそれを動かしてみて理解を深める、というのが一般的である。また、コンパイルや実行の指示をコマンドラインから行うのではなくて、グラフィカル・ユーザー・インタフェースで行うことができ、学習者の手助けとなるツールは存在する。
【0003】
一方、プログラムを実行させながら、その実行状態を表示する機能を持つシステムとしては、デバッガが一般的に使われている。これは、開発者が作成したプログラムコードにバグがないかを検証するために使われるツールである(例えば、特許文献1参照)。その使用形態としては、ソースコードを表示した上で、操作者がそのコード中のどのポイントでどのような情報を表示するのか指定することによって、そのソースコードを実行しながらその動的な情報(変数の値の変化など)を表示して、プログラムコードの健全性をチェックしている(例えば、特許文献2参照)。
【0004】
【特許文献1】
特開平10−207740号
【0005】
【特許文献2】
特開2002−196950号
【0006】
【発明が解決しようとする課題】
実行中のプログラムの記述を理解する場合、そのソースコードを解読し、ある処理とそれに対応するソースコードを自ら適切に把握し、ソースコードをたどっていく作業の必要が生じる。また、その処理が複数のプログラムからなる処理の場合は、複数のソースコード間で的確に処理手順を追っていくことになる。
そこで、プログラミングの学習時において、サンプルプログラム提供者がソースコードに関連するさまざまな情報をプログラムの実行に連動して伝達することが可能な手段またはツールが存在すれば、サンプルプログラムの学習者はそのソースコードの意味や関連情報を容易に理解することが可能となる。
これに対し、上記特許文献1,2で開示されたデバッガを用いることが考えられるが、デバッガによりブレークポイントを指定して実行状態の情報を取得する場合には、前提条件として、操作者がブレークポイントの適切な指定位置の情報を予め把握している必要がある。
すなわち、あるプログラムの詳細を理解するためには、プログラムの実行を実現しているソースコードおよびその記述箇所を正確に把握しておく必要があり、初心者等においては利用できないという問題がある。
【0007】
本発明は、実行プログラムのソースコードあるいはソースコードに関連する情報を、実行プログラムの実行時に連動して表示し、実行プログラムの意味等の学習を支援することができるソースコード表示システム及びプログラムを提供することを目的とする。
【0008】
【課題を解決するための手段】
上記目的を達成するために、本発明は、ソースコード表示対象の実行プログラムの実行状態で、当該実行プログラム内に表示制御コマンドが記述されているか否かを判定し、記述されていたならば、当該実行プログラムの実行を一時停止し、停止状態において、記述された表示制御コマンドを識別し、識別した表示制御コマンドに応じて、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得する情報取得手段と、取得したソースコードまたは関連情報の一部または全部を表示する表示手段とを備えることを特徴とする。
そして、前記情報取得手段は、実行プログラム内でソースコードまたは関連情報を表示したい箇所に記述された1行の表示制御コマンドを識別し、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得することを特徴とする。
また、前記情報取得手段は、実行プログラム内でソースコードまたは関連情報を表示したい範囲の開始位置と終了位置に記述された表示制御コマンドを識別し、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルおよび関連情報ファイルから取得することを特徴とする。
また、前記情報取得手段は、実行プログラムのソースコードに記述している変数の値をさらに取得し、前記表示手段に表示させることを特徴とする。
【0009】
本発明に係るソースコード表示プログラムは、ソースコード表示対象の実行プログラムの実行状態で、当該実行プログラム内に表示制御コマンドが記述されているか否かを判定し、記述されていたならば、当該実行プログラムの実行を一時停止し、停止状態において、記述された表示制御コマンドを識別し、識別した表示制御コマンドに応じて、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得するステップと、取得したソースコードまたは関連情報の一部または全部を表示するステップとを備えることを特徴とする。
このような構成によって、プログラムを実行しながら、それを実行するために必要とされるソースコードまたはソースコードの一部、ソースコードに関連する情報、ソースコードで利用されている変数の値の表示が可能となる。
また、それら各情報の表示によって、プログラムの実行に関する情報を容易に取得することが可能となる。
【0010】
【発明の実施の形態】
以下、図面と共に本発明の実施の形態を詳細に説明する。
図1は、本発明に係るソースコード表示システムの実施に形態を示すシステム構成図である。
図1において、101は本システムを稼動する際に、ソースコードおよびそれに関連する情報を表示する対象となる実行プログラムのファイルである。
102は実行プログラムファイル101中の実行プログラムを作成するために使用したソースコードのファイルであり、本システムから参照できる場所に存在する。
103はソースコードファイル102中のソースコードの説明文等、ソースコードに関連する表示情報を記述した表示情報リソースファイルである。
104は実行プログラムファイル101中の実行プログラムに埋め込まれた本システム用コマンドの処理を行う機能情報を保持している情報表示制御用コマンドライブラリである。
105はソースコードファイル102中のソースコードで使用されている変数の値を時系列に格納しておく変数値格納用テーブルである。
106は本システムの演算処理部であり、プログラム実行部107と表示情報制御部108とからなる。
【0011】
プログラム実行部107は、実行プログラムファイル101中の実行プログラムを実行するプログラム実行機能、実行過程において本システム用コマンド(後述する)が出現した場合は情報表示制御用コマンドライブラリ104からそのコマンドを呼び出す情報表示制御用コマンド呼び出し機能、実行プログラムファイル101中の実行プログラムの実行状態の表示を表示情報制御部108に依頼する機能、情報表示制御用コマンドライブラリ104から返ってきた処理内容を表示情報制御部108に転送する表示情報生成処理依頼機能を備えている。
【0012】
表示情報制御部108は、プログラム実行部107から送信された処理命令をもとに、ソースコードファイル102の内容(ソースコード)または表示情報リソースファイル103内のメッセージリソースまたは変数値格納用テーブル105にある変数の情報から表示情報を生成する機能、生成した情報の表示を出力機器(ディスプレイなど)に指示する機能、実行プログラムファイル101の実行プログラムの実行状態の表示を出力機器(ディスプレイなど)に指示する機能を備えている。
【0013】
109は表示情報制御部108から送信された表示情報を表示する機能を持つディスプレイ装置である。
110は実行プログラムファイル101中の実行プログラム実行においてデータベースが必要な場合に使用する実行プログラム用データベースであり、データベースが必要でない場合には不要である。
【0014】
図2(a)は、変数値格納用テーブル105に保存されるデータの構造例を示す図である。
図2(a)において、201の行はステップ位置を表わす数値を表わしている。ここで、ステップ位置とは、実行プログラムの実行を一時停止させる位置のことである。ステップ位置を表わす数値は、実行プログラムを始動してからカウントが開始され、実行プログラムの実行を一時停止するごとに、1ずつ増加される数値である。また、実行プログラムが一時停止される箇所は、ソースコード内で本システム制御用コマンドが記述された箇所である。
202の変数名とは、実行プログラムのソースコード内で使用されている変数のうち、変数値の監視を指示された変数の名前であり、202が示す箇所より下のセルにその変数名(index,amount,dayなど)が格納される。格納される順序は、ソースコード内でその変数の初出箇所が早い順である。
203はステップ位置の順に変数の値が格納されるエリアであり、あるステップ位置で存在しない変数の場合、例えばステップ1の変数dayの場合は符合204で示すようにNULLになる。
【0015】
図2(b)は、ソースコードの説明文などメッセージ表示エリア305(図3)に表示する文字列を格納する表示情報リソースファイルの構造例を示す図である。
図2(b)において、206はソースコードの説明文などを識別するためのキーである。
207は実際にメッセージ表示エリア305(図3)に表示される文字列である。
説明文のキー206とそれに対応する説明文の文字列207とで、「キー=表示文字列」という形式で記述しておく。
【0016】
図2(c)は、本システムの制御用コマンドを実行プログラムのソースコードに記述した例を示す図である。
図2(c)において、208は変数値の表示を行いたい変数を指定するコマンドである。本コマンドによるシステム動作例は図7で詳しく述べる。
209は本システムの制御用コマンドのラインコマンドの例である。本コマンドによるシステム動作例は図5で詳しく述べる。
210および211は本システムの制御用コマンドのブロックコマンドの例である。ソースコードのある部分を、対になる開始コマンド210と終了コマンド211で囲むことによって使用する。本コマンドによるシステム動作例は図6で詳しく述べる。
【0017】
図3はディスプレイ装置109の画面例を示す図である。
図3において、301は本システムの表示画面の枠である。
302は実行中のプログラムに関連する情報を表示する枠である。
303は実行中のプログラムのソースコードのファイル名である。
304はソースコードのファイル名303に表示したソースコードの内容を表示するソースコード表示エリアであり、そのデータは、ソースコードファイル102の内容である。
【0018】
305はソースコード表示エリア304に表示されたソースコードに対応する説明文等のソースコードに関連する情報を表示するメッセージ表示エリアであり、そのデータは表示情報リソースファイル103に記述されている内容である。306はソースコードで使用されている変数値のうち、ソースコード内で指定のあった変数の値を時系列に表示する変数値表示エリアであり、そのデータは変数値格納用テーブル105に格納されている情報である。
307は一時停止していた実行プログラムの処理を再開し、次のステップ位置で処理を一時停止する命令を行うユーザー・インタフェースであり、このボタンを押すことによって情報の表示枠302またはメッセージ表示エリア305または変数値表示エリア306に表示される情報が次のステップ位置までの情報に更新される。
308は処理を終了させるためのボタンである。
【0019】
図4は、本実施形態の処理の概要を示すフローチャートである。
以下、本フローチャートに従い、本実施形態の概要について説明する。
まず、プログラム実行部107は、ステップ401において、ソースコードを表示したい対象となるプログラム(実行プログラムファイル101中の実行プログラム)の実行を開始する。
次に、ステップ402において、ソースコード中に情報表示制御用コマンドが記述されている限り、以下に示すステップ403からステップ407までの処理を繰り返し実行する。
【0020】
まず、ステップ403において、次の情報表示制御用コマンドまでプログラムの処理を実行する。
次に、プログラム実行部107は、ステップ404において情報表示制御用コマンドの識別を行い、次にステップ405において情報表示制御用コマンドライブラリ104から識別した情報表示制御用コマンドの呼び出しを行い、コマンドに対応する適切な処理内容の情報を取得し、それを表示情報制御部108へ転送する。
ここで、転送される情報には、生成する表示情報の種別とともに表示するリソースを指示する情報等が含まれている。また、プログラム実行部107は、ここで実行中のプログラムを一時停止する。
【0021】
ステップ406において、表示情報制御部108は転送された情報をもとに表示する情報の種別、表示するリソースを判別して、表示情報の生成を行う。表示情報の生成についての詳細は、図5、図6、図7に後述する。
次に、ステップ407において、ステップ406において生成された表示情報をディスプレイ装置109に表示する。表示の後、次のステップ位置へ処理を進めるボタン307が、本システムの利用者によって押されると、次の処理へ進む。
最後に、ステップ408において、対象プログラムが終了するまで実行する。
【0022】
図5は、図4のステップ406の表示情報の生成に対し、ソースコード中のある1行に対する説明文を表示するラインコマンド209に対する処理の流れを示すフローチャートである。
以下、本フローチャートに従い、ラインコマンドに対する処理の詳細を説明する。
まず、ステップ501において、プログラム実行部107は実行中のプログラムのプログラム名および実行中の行番号およびコマンドの引数情報を表示情報制御用コマンドとともに表示情報制御部108に転送する。ここで、コマンドの引数情報とは、表示する説明文を表示情報リソースファイル103から検索するキー等を含むものである。
表示情報制御部108はソースコードファイル102より、送られた実行中のファイル名と同名のファイルを取得する。
【0023】
次に、ステップ502において、表示情報制御部108はステップ501にて取得したソースコードファイルから、プログラム実行部107から送信された行番号の前後数行(例えば10行)のソースコードを文字列として取得する。
次に、ステップ503において、表示情報制御部108はステップ501にて取得した本コマンドの引数情報をもとに表示情報リソースファイル103から該当するソースコード説明文を取得する。
次に、ステップ504において、表示情報制御部108はステップ501にて取得したソースコードのファイル名を図3の303のようにディスプレイ装置109に表示する。
次に、ステップ505において、表示情報制御部108はステップ502にて取得したソースコードの一部またはソースコード全てを、ソースコード表示エリア304に表示する。
最後に、ステップ506において、表示情報制御部108はステップ503にて取得したソースコード説明文を、メッセージ表示エリア305に表示する。
【0024】
図6は、図4のステップ406の表示情報の生成に対し、実行プログラムの実行中にデータベース110へアクセスするデータベース処理の前後をブロックコマンド210および211で囲むことによって、そのデータベース処理の前後におけるデータベース情報を取得するブロックコマンドに対する処理の流れを示すフローチャートである。
以下、本フローチャートに従い、ブロックコマンドに対する処理の詳細を説明する。
まず、ステップ601において、ブロックコマンドの開始用コマンド210の箇所を処理する時点で、プログラム実行部107はデータベース処理前の情報をデータベース110から取得する。
次に、ステップ602において、ブロックコマンドの開始用コマンド210と終了用コマンド211で囲まれた箇所に記述されているデータベース処理等を実行する。
【0025】
次に、ステップ603において、ステップ602によるデータベース処理後の情報をデータベース110から取得する。
次に、ステップ604において、ステップ601とステップ603で取得したデータベース処理前後の情報を、ソースコードに関連する情報としてメッセージエリア305に表示するために、表示情報制御部108にこれら情報の表示処理をするように指示する。また、同時にステップ501と同様の手順にて、ソースコードの情報を取得する。
最後に、ステップ605において、ステップ504およびステップ505における手順と同様にして、ソースコードのファイル名およびソースコードを、ソースコードファイル名欄303およびソースコード表示エリア304にそれぞれ表示する。
【0026】
図7は、実行プログラムの一時中断時に、変数値表示エリア306に指定された変数の値を時系列に表示する処理の流れを示すフローチャートである。
以下、本フローチャートに従い、変数値表示処理の詳細を説明する。
まず、ステップ701において、変数宣言時に変数指定コマンド208によって、変数の監視を指定しているかどうかチェックする。もし、変数の監視の指定が行われていれば、ステップ702を実行する。
ステップ702において、プログラム実行部107は表示情報制御部108に変数を変数値格納用テーブル105に格納するように指示する。表示情報制御部108は渡された変数を変数値格納用テーブル105に格納する。
ステップ703において、実行プログラムが本システムの他の制御用コマンドによって一時中断するたびに、ステップ704からステップ706の処理を実行する。
ステップ704において、プログラム実行部107は変数が変数値格納用テーブル105に登録されているかどうかチェックする。登録されている場合は、ステップ705を実行する。
【0027】
ステップ705において、変数の値を変数値格納用テーブル105に格納することを、プログラム実行部107が表示情報制御部108に指示し、それを表示情報制御部108が実行する。
ステップ706において、表示情報制御部108は変数値格納用テーブル105の内容を変数値表示エリア306に表示する。
ステップ707において、プログラム実行時に変数が消滅される。
ステップ708において、消滅された変数を変数値格納用テーブル105から削除するように、プログラム実行部107が表示情報制御部108に指示し、それを表示情報制御部108が実行する。
【0028】
以上のように本実施形態によれば、学習対象となる実行プログラムを実行した際に、その動作を実現するために利用されているプログラムのソースコードおよびその一部、またはそのソースコードに関連する情報を、実行手順に沿って容易に閲覧することが可能となる。
従って、例えば、本機能を実現するプログラム(プログラム実行部107と表示情報制御部108)および関連するテーブル105やライブラリ104と、サンプルプログラム(ソースコードを学習するプログラム)をCD−ROM等の媒体に格納して配布、またはネットワーク経由で有償で配布し、ユーザが所有するコンピュータ上で両プログラムを実行することにより、サンプルプログラムの機能を動かしながら、その実装方法の修得、理解を容易、かつ効率的に支援することが可能になる。
【0029】
なお、本機能を実現するプログラム(プログラム実行部107と表示情報制御部108)および関連するテーブル105やライブラリ104が既に存在する環境であれば、実行プログラムファイル101およびそのソースコードファイル102、表示情報リソースファイル103のみをCD−ROM等でユーザに提供し、実行プログラムの学習を支援することができる。
【0030】
【発明の効果】
以上の説明から明らかなように、本発明によれば、ソースコードあるいはソースコードに関連する情報をプログラムの実行時に連動して表示し、実行プログラムの意味等の学習を支援することができる。
【図面の簡単な説明】
【図1】本発明に係るソースコード表示システムの実施の形態を示すシステム構成図である。
【図2】変数値格納用テーブルのデータ構造、表示情報リソースファイルのデータ例、ソースコードの実装例を示す図である。
【図3】ソースコードおよび関連情報の表示画面の例を示す図である。
【図4】実施形態における処理の概要を示すフローチャートである。
【図5】ラインコマンドに対する処理の詳細を示すフローチャートである。
【図6】ブロックコマンドに対する処理の詳細を示すフローチャートである。
【図7】変数値を表示する処理のフローチャートである。
【符号の説明】
101…実行プログラムファイル、102…ソースコードファイル、103…表示情報リソースファイル、104…情報表示制御用コマンドライブラリ、105…変数値格納用テーブル、106…演算制御部、107…プログラム実行部、108…表示情報制御部、109…ディスプレイ装置、208…変数指定コマンド、209…ラインコマンド、210…ブロック開始コマンド、211…ブロック終了コマンド。
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a source code display system for a program, and more particularly to a source code display system that displays a source code or related information while executing the program.
[0002]
[Prior art]
When learning computer programming, it is common to display sample code of a program and actually run it to deepen understanding. In addition, there are tools that can help the learner, because the instructions for compiling and executing can be given from a graphical user interface instead of from the command line.
[0003]
On the other hand, a debugger is generally used as a system having a function of displaying the execution state while executing a program. This is a tool used to verify whether a program code created by a developer has a bug (for example, see Patent Document 1). As a usage form, after displaying the source code, the operator designates what information is displayed at which point in the code, so that the dynamic information ( A change in the value of a variable is displayed to check the soundness of the program code (for example, see Patent Document 2).
[0004]
[Patent Document 1]
JP-A-10-207740 [0005]
[Patent Document 2]
JP-A-2002-196950 [0006]
[Problems to be solved by the invention]
In order to understand the description of the program being executed, it is necessary to decode the source code, appropriately grasp a certain process and the corresponding source code, and follow the source code. If the process is a process consisting of a plurality of programs, the processing procedure must be accurately followed between a plurality of source codes.
Therefore, when learning programming, if there is a means or tool that allows the sample program provider to transmit various information related to the source code in conjunction with the execution of the program, the sample program learner will The meaning of the source code and related information can be easily understood.
On the other hand, it is conceivable to use the debuggers disclosed in Patent Documents 1 and 2 described above. However, when a breakpoint is designated by the debugger and the execution state information is acquired, as a precondition, the It is necessary to know the information of the appropriate designated position of the point in advance.
That is, in order to understand the details of a certain program, it is necessary to accurately grasp the source code that realizes the execution of the program and its description location, and there is a problem that it cannot be used by a beginner or the like.
[0007]
The present invention provides a source code display system and a program that can display the source code of an execution program or information related to the source code in conjunction with the execution of the execution program and support learning of the meaning of the execution program. The purpose is to do.
[0008]
[Means for Solving the Problems]
In order to achieve the above object, the present invention determines whether or not a display control command is described in the execution state of an execution program of a source code display target, and if the execution control program is described, The execution of the execution program is temporarily stopped, and in the stopped state, the display control command described is identified. According to the identified display control command, the source code or the related information of the execution program corresponding thereto is stored in the source code file or the related information. It is characterized by comprising information acquisition means for acquiring from an information file, and display means for displaying a part or all of the acquired source code or related information.
The information acquisition means identifies a one-line display control command described in a place where the source code or the related information is to be displayed in the execution program, and stores the corresponding source code or the related information of the execution program in the source code file. Alternatively, it is obtained from a related information file.
Further, the information acquiring means identifies a display control command described at a start position and an end position of a range in which a source code or related information is to be displayed in the execution program, and determines a corresponding source code or related information of the execution program. It is obtained from a source code file and a related information file.
Further, the information acquisition means further acquires a value of a variable described in a source code of the execution program, and causes the display means to display the acquired value.
[0009]
The source code display program according to the present invention determines whether or not a display control command is described in the execution program in the execution state of the execution program for which the source code is to be displayed. Suspends the execution of the program, identifies the described display control command in the stopped state, and, according to the identified display control command, stores the corresponding source code or related information of the execution program in a source code file or a related information file. And displaying a part or all of the acquired source code or related information.
With such a configuration, while the program is being executed, display of source code or a part of the source code required for executing the program, information related to the source code, and values of variables used in the source code are displayed. Becomes possible.
In addition, by displaying the information, it is possible to easily obtain information on the execution of the program.
[0010]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a system configuration diagram showing an embodiment of a source code display system according to the present invention.
In FIG. 1, reference numeral 101 denotes a file of an execution program for displaying a source code and information related thereto when the system is operated.
Reference numeral 102 denotes a source code file used to create an execution program in the execution program file 101, which exists in a location that can be referenced from the present system.
Reference numeral 103 denotes a display information resource file in which display information related to the source code such as a description of the source code in the source code file 102 is described.
Reference numeral 104 denotes a command library for information display control that holds function information for processing the command for the present system embedded in the execution program in the execution program file 101.
Reference numeral 105 denotes a variable value storage table that stores the values of variables used in the source code in the source code file 102 in chronological order.
An arithmetic processing unit 106 of the present system includes a program execution unit 107 and a display information control unit 108.
[0011]
The program execution unit 107 has a program execution function of executing an execution program in the execution program file 101, and information for calling the command from the information display control command library 104 when a command for this system (described later) appears in the execution process. A display control command calling function, a function for requesting the display information control unit 108 to display the execution state of the execution program in the execution program file 101, and a processing content returned from the information display control command library 104 to the display information control unit 108. And a display information generation processing request function for transferring the information to the server.
[0012]
The display information control unit 108 stores the content (source code) of the source code file 102 or the message resource or the variable value storage table 105 in the display information resource file 103 based on the processing instruction transmitted from the program execution unit 107. A function of generating display information from information of a certain variable, a function of instructing an output device (such as a display) to display the generated information, and an instruction of displaying an execution state of an execution program of an execution program file 101 to an output device (such as a display). It has the function to do.
[0013]
A display device 109 has a function of displaying the display information transmitted from the display information control unit 108.
Reference numeral 110 denotes an execution program database used when a database is necessary for executing the execution program in the execution program file 101, and is unnecessary when the database is not required.
[0014]
FIG. 2A is a diagram illustrating an example of the structure of data stored in the variable value storage table 105.
In FIG. 2A, a row 201 represents a numerical value representing a step position. Here, the step position is a position at which the execution of the execution program is temporarily stopped. The numerical value representing the step position is a numerical value that starts counting after the execution of the execution program and is incremented by one each time the execution of the execution program is temporarily stopped. Further, the place where the execution program is temporarily stopped is a place where the present system control command is described in the source code.
The variable name of 202 is the name of the variable instructed to monitor the variable value among the variables used in the source code of the execution program, and the variable name (index) is stored in a cell below the location indicated by 202. , Amount, day, etc.) are stored. The variables are stored in the order in which the first occurrence of the variable in the source code is earlier.
Numeral 203 denotes an area in which the values of the variables are stored in the order of the step positions. In the case of a variable that does not exist at a certain step position, for example, in the case of the variable "day" in step 1, the area becomes NULL as indicated by reference numeral 204.
[0015]
FIG. 2B is a diagram showing an example of the structure of a display information resource file that stores a character string to be displayed in the message display area 305 (FIG. 3) such as a description of a source code.
In FIG. 2B, reference numeral 206 denotes a key for identifying a description of a source code or the like.
207 is a character string actually displayed in the message display area 305 (FIG. 3).
The key 206 of the description and the character string 207 of the description corresponding thereto are described in a format of “key = display character string”.
[0016]
FIG. 2C is a diagram showing an example in which a control command of the present system is described in a source code of an execution program.
In FIG. 2C, a command 208 is used to specify a variable whose value is to be displayed. An example of a system operation according to this command will be described in detail with reference to FIG.
Reference numeral 209 denotes an example of a line command of a control command of the present system. An example of a system operation according to this command will be described in detail with reference to FIG.
210 and 211 are examples of block commands of control commands of the present system. A portion of the source code is used by surrounding it with a start command 210 and an end command 211 that form a pair. An example of a system operation according to this command will be described in detail with reference to FIG.
[0017]
FIG. 3 is a diagram illustrating an example of a screen of the display device 109.
In FIG. 3, reference numeral 301 denotes a frame of a display screen of the present system.
Reference numeral 302 denotes a frame for displaying information related to the program being executed.
Reference numeral 303 denotes a file name of a source code of the program being executed.
Reference numeral 304 denotes a source code display area for displaying the contents of the source code displayed in the source code file name 303, and its data is the contents of the source code file 102.
[0018]
Reference numeral 305 denotes a message display area for displaying information related to the source code such as an explanatory note corresponding to the source code displayed in the source code display area 304. The data is the content described in the display information resource file 103. is there. Reference numeral 306 denotes a variable value display area for displaying, in chronological order, values of variables designated in the source code among variable values used in the source code, and the data is stored in the variable value storage table 105. Information.
Reference numeral 307 denotes a user interface for resuming the processing of the execution program which has been paused and for giving an instruction to pause the processing at the next step position. When this button is pressed, an information display frame 302 or a message display area 305 is displayed. Alternatively, the information displayed in the variable value display area 306 is updated to the information up to the next step position.
A button 308 is used to end the processing.
[0019]
FIG. 4 is a flowchart showing an outline of the processing of this embodiment.
Hereinafter, an outline of the present embodiment will be described with reference to the flowchart.
First, in step 401, the program execution unit 107 starts executing a program (an execution program in the execution program file 101) for which a source code is to be displayed.
Next, in step 402, the following steps 403 to 407 are repeatedly executed as long as the information display control command is described in the source code.
[0020]
First, in step 403, the program processing is executed until the next information display control command.
Next, the program execution unit 107 identifies the information display control command in Step 404, and then calls the identified information display control command from the information display control command library 104 in Step 405, and responds to the command. The information of the appropriate processing content to be obtained is obtained and transferred to the display information control unit 108.
Here, the information to be transferred includes information indicating a resource to be displayed together with the type of display information to be generated, and the like. The program executing unit 107 temporarily stops the program being executed here.
[0021]
In step 406, the display information control unit 108 determines the type of information to be displayed and the resource to be displayed based on the transferred information, and generates display information. Details of generation of display information will be described later with reference to FIGS. 5, 6, and 7.
Next, in step 407, the display information generated in step 406 is displayed on the display device 109. After the display, when the button 307 for proceeding to the next step position is pressed by the user of the present system, the process proceeds to the next process.
Finally, in step 408, the process is executed until the target program ends.
[0022]
FIG. 5 is a flowchart showing the flow of processing for a line command 209 for displaying an explanatory note for a certain line in the source code in response to the generation of the display information in step 406 in FIG.
Hereinafter, the processing for the line command will be described in detail with reference to this flowchart.
First, in step 501, the program execution unit 107 transfers the program name of the program being executed, the line number being executed, and the argument information of the command to the display information control unit 108 together with the display information control command. Here, the argument information of the command includes a key or the like for retrieving a description to be displayed from the display information resource file 103.
The display information control unit 108 acquires, from the source code file 102, a file having the same name as the transmitted file name being executed.
[0023]
Next, in step 502, the display information control unit 108 uses the source code file acquired in step 501 as a character string with several lines (for example, 10 lines) of source code before and after the line number transmitted from the program execution unit 107. get.
Next, in step 503, the display information control unit 108 acquires a corresponding source code description from the display information resource file 103 based on the argument information of the command acquired in step 501.
Next, in step 504, the display information control unit 108 displays the file name of the source code acquired in step 501 on the display device 109 as indicated by 303 in FIG.
Next, in step 505, the display information control unit 108 displays a part or all of the source code acquired in step 502 in the source code display area 304.
Finally, in step 506, the display information control unit 108 displays the source code explanation acquired in step 503 in the message display area 305.
[0024]
FIG. 6 is a block diagram showing an example of the display information generation in step 406 in FIG. 4 in which block commands 210 and 211 surround the database processing for accessing the database 110 during execution of the execution program. It is a flowchart which shows the flow of a process with respect to the block command which acquires information.
Hereinafter, details of the processing for the block command will be described with reference to this flowchart.
First, in step 601, at the time of processing the location of the block command start command 210, the program execution unit 107 acquires information before database processing from the database 110.
Next, in step 602, a database process or the like described in a portion surrounded by the block command start command 210 and the end command 211 is executed.
[0025]
Next, in step 603, information after the database processing in step 602 is obtained from the database 110.
Next, in step 604, the display information control unit 108 performs display processing of the information before and after the database processing acquired in step 601 and step 603 in order to display the information before and after the database processing in the message area 305 as information related to the source code. To do so. At the same time, the source code information is acquired in the same procedure as in step 501.
Finally, in step 605, the file name and the source code of the source code are displayed in the source code file name column 303 and the source code display area 304 in the same manner as in the procedure in steps 504 and 505.
[0026]
FIG. 7 is a flowchart showing the flow of processing for displaying the values of the variables specified in the variable value display area 306 in a time-series manner when the execution program is temporarily suspended.
Hereinafter, the variable value display processing will be described in detail with reference to this flowchart.
First, in step 701, it is checked whether or not monitoring of a variable is designated by the variable designation command 208 when a variable is declared. If the monitoring of the variable has been designated, step 702 is executed.
In step 702, the program execution unit 107 instructs the display information control unit 108 to store variables in the variable value storage table 105. The display information control unit 108 stores the passed variable in the variable value storage table 105.
In step 703, each time the execution program is temporarily interrupted by another control command of the present system, the processing of steps 704 to 706 is executed.
In step 704, the program execution unit 107 checks whether the variable is registered in the variable value storage table 105. If registered, step 705 is executed.
[0027]
In step 705, the program execution unit 107 instructs the display information control unit 108 to store the value of the variable in the variable value storage table 105, and the display information control unit 108 executes the instruction.
In step 706, the display information control unit 108 displays the contents of the variable value storage table 105 in the variable value display area 306.
In step 707, the variables are deleted when the program is executed.
In step 708, the program execution unit 107 instructs the display information control unit 108 to delete the deleted variable from the variable value storage table 105, and the display information control unit 108 executes the instruction.
[0028]
As described above, according to the present embodiment, when the execution program to be learned is executed, the source code of the program used to realize the operation and a part thereof, or the source code related to the source code is used. Information can be easily browsed according to the execution procedure.
Therefore, for example, a program for realizing this function (the program execution unit 107 and the display information control unit 108), the related table 105 and the library 104, and a sample program (a program for learning the source code) are stored in a medium such as a CD-ROM. By storing and distributing, or distributing for a fee via a network, and executing both programs on the user's own computer, it is easy and efficient to learn how to implement the sample program while operating the functions of the sample program. It will be possible to assist.
[0029]
In an environment where a program for realizing this function (the program execution unit 107 and the display information control unit 108) and the related table 105 and library 104 already exist, the execution program file 101 and its source code file 102, display information By providing only the resource file 103 to the user on a CD-ROM or the like, learning of the execution program can be supported.
[0030]
【The invention's effect】
As is clear from the above description, according to the present invention, the source code or the information related to the source code is displayed in conjunction with the execution of the program, and the learning of the meaning of the execution program can be supported.
[Brief description of the drawings]
FIG. 1 is a system configuration diagram showing an embodiment of a source code display system according to the present invention.
FIG. 2 is a diagram showing a data structure of a variable value storage table, a data example of a display information resource file, and a source code implementation example.
FIG. 3 is a diagram showing an example of a display screen of a source code and related information.
FIG. 4 is a flowchart illustrating an outline of a process according to the embodiment.
FIG. 5 is a flowchart showing details of processing for a line command.
FIG. 6 is a flowchart showing details of processing for a block command.
FIG. 7 is a flowchart of a process for displaying a variable value.
[Explanation of symbols]
101: execution program file, 102: source code file, 103: display information resource file, 104: command library for information display control, 105: table for storing variable values, 106: arithmetic control unit, 107: program execution unit, 108 ... Display information control unit, 109: display device, 208: variable designation command, 209: line command, 210: block start command, 211: block end command.

Claims (5)

実行プログラムのソースコードを表示するソースコード表示システムであって、
ソースコード表示対象の実行プログラムの実行状態で、当該実行プログラム内に表示制御コマンドが記述されているか否かを判定し、当該コマンドが記述されていたならば、当該実行プログラムの実行を一時停止し、停止状態において、記述された表示制御コマンドを識別し、識別した表示制御コマンドに応じて、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得する情報取得手段と、
取得したソースコードまたは関連情報の一部または全部を表示する表示手段とを備えることを特徴とするソースコード表示システム。
A source code display system for displaying a source code of an execution program,
In the execution state of the execution program for which the source code is to be displayed, it is determined whether a display control command is described in the execution program. If the command is described, the execution of the execution program is temporarily stopped. Information acquisition means for identifying the described display control command in the stopped state, and acquiring the source code or related information of the corresponding execution program from the source code file or the related information file in accordance with the identified display control command; ,
Display means for displaying part or all of the acquired source code or related information.
前記情報取得手段は、実行プログラム内でソースコードまたは関連情報を表示したい箇所に記述された1行の表示制御コマンドを識別し、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得することを特徴とする請求項1に記載のソースコード表示システム。The information acquisition means identifies a one-line display control command described in a place where the source code or related information is to be displayed in the execution program, and stores the corresponding source code or related information of the execution program in a source code file or a related code. The source code display system according to claim 1, wherein the source code is obtained from an information file. 前記情報取得手段は、実行プログラム内でソースコードまたは関連情報を表示したい範囲の開始位置と終了位置に記述された表示制御コマンドを識別し、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルおよび関連情報ファイルから取得することを特徴とする請求項1に記載のソースコード表示システム。The information obtaining means identifies a display control command described at a start position and an end position of a range in which the source code or related information is to be displayed in the execution program, and stores the corresponding source code or related information of the execution program in the source code. The source code display system according to claim 1, wherein the source code is obtained from a file and a related information file. 前記情報取得手段は、実行プログラムのソースコードに記述している変数の値をさらに取得し、前記表示手段に表示させることを特徴とする請求項1または2に記載のソースコード表示システム。The source code display system according to claim 1, wherein the information acquisition unit further acquires a value of a variable described in a source code of the execution program and causes the display unit to display the acquired value. 実行プログラムのソースコードを表示するソースコード表示プログラムであって、
ソースコード表示対象の実行プログラムの実行状態で、当該実行プログラム内に表示制御コマンドが記述されているか否かを判定し、記述されていたならば、当該実行プログラムの実行を一時停止し、停止状態において、記述された表示制御コマンドを識別し、識別した表示制御コマンドに応じて、対応する当該実行プログラムのソースコードまたは関連情報をソースコードファイルまたは関連情報ファイルから取得するステップと、
取得したソースコードまたは関連情報の一部または全部を表示するステップとを備えることを特徴とするコンピュータが実行可能なソースコード表示プログラム。
A source code display program for displaying a source code of an execution program,
In the execution state of the execution program for which the source code is to be displayed, it is determined whether or not a display control command is described in the execution program. In the, identifying the described display control command, according to the identified display control command, obtaining the corresponding source code or related information of the execution program from the source code file or related information file,
Displaying a part or all of the acquired source code or related information. A computer-executable source code display program.
JP2002302814A 2002-10-17 2002-10-17 Source code display system and program Pending JP2004139313A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002302814A JP2004139313A (en) 2002-10-17 2002-10-17 Source code display system and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002302814A JP2004139313A (en) 2002-10-17 2002-10-17 Source code display system and program

Publications (1)

Publication Number Publication Date
JP2004139313A true JP2004139313A (en) 2004-05-13

Family

ID=32450775

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002302814A Pending JP2004139313A (en) 2002-10-17 2002-10-17 Source code display system and program

Country Status (1)

Country Link
JP (1) JP2004139313A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006350676A (en) * 2005-06-16 2006-12-28 Hitachi Software Eng Co Ltd Program debugging method of built-in system
JP2007004516A (en) * 2005-06-24 2007-01-11 Hitachi Software Eng Co Ltd Program debugging method of built-in system
CN1315041C (en) * 2004-12-29 2007-05-09 华为技术有限公司 A method and system for improving the comprehensibility of program operation information

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1315041C (en) * 2004-12-29 2007-05-09 华为技术有限公司 A method and system for improving the comprehensibility of program operation information
JP2006350676A (en) * 2005-06-16 2006-12-28 Hitachi Software Eng Co Ltd Program debugging method of built-in system
JP2007004516A (en) * 2005-06-24 2007-01-11 Hitachi Software Eng Co Ltd Program debugging method of built-in system

Similar Documents

Publication Publication Date Title
US5317688A (en) Software agent used to provide instruction to a user for a plurality of computer applications
US6003143A (en) Tool and method for diagnosing and correcting errors in a computer program
CN100486068C (en) Computer-based test method and system for extending test driver functionality using plug-ins
US20060053372A1 (en) Systems and methods for teaching a person to interact with a computer program having a graphical user interface
US7426717B1 (en) System and method for debugging files in a runtime environment
WO2020134633A1 (en) Development method and device for application program, and integrated development tool
CN105683908A (en) Context-aware user interface section
JP4877068B2 (en) Software development support program, software development support method
JP2004139313A (en) Source code display system and program
CN114327416A (en) Interface synchronization method and device applied to development branch and electronic equipment
JPH07219807A (en) Programmable controller system
JP4889593B2 (en) Configuration management system
EP0352908A2 (en) Computing system and method used to provide instruction to a user for a plurality of computer applications
JP2004287869A (en) Program execution monitoring device and method
JPH08263130A (en) Simulation method
JP2007004516A (en) Program debugging method of built-in system
JP4590907B2 (en) Software development support device and software development support program
JPH0950388A (en) Database application software verification device
JPH1153219A (en) Software verifying device
JP2009075724A (en) Management apparatus, management system, management program, and management method
JP2006350676A (en) Program debugging method of built-in system
JPH10214204A (en) Debugger
JPS63223931A (en) Logic diagram execution route output processing system
JP2000353112A (en) Method and system for debugging intermediate language level
JP2013235381A (en) Data editing apparatus and data editing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070502

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070702

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070725