JP2005018458A - Programming support device and method, and programming support program - Google Patents

Programming support device and method, and programming support program Download PDF

Info

Publication number
JP2005018458A
JP2005018458A JP2003183077A JP2003183077A JP2005018458A JP 2005018458 A JP2005018458 A JP 2005018458A JP 2003183077 A JP2003183077 A JP 2003183077A JP 2003183077 A JP2003183077 A JP 2003183077A JP 2005018458 A JP2005018458 A JP 2005018458A
Authority
JP
Japan
Prior art keywords
function
source
code
program
source program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003183077A
Other languages
Japanese (ja)
Inventor
Yuko Sato
祐子 佐藤
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.)
Toshiba TEC Corp
Original Assignee
Toshiba TEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba TEC Corp filed Critical Toshiba TEC Corp
Priority to JP2003183077A priority Critical patent/JP2005018458A/en
Publication of JP2005018458A publication Critical patent/JP2005018458A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To insert a desired source code into a correct position without designating an insertion position for a source program. <P>SOLUTION: A source code which is described in the same language as a source program and can serve as the argument of a predefined function for the language is stored in advance. During the process of developing the source program, functions that exist in the source program are obtained. Once the function whose argument is the source code is designated from among the group of functions obtained, the function is extracted from the source program and the source code stored in advance as the argument of the function is inserted into the source program. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、プログラムをコンピュータ上で効率よく開発できるように支援するプログラミング支援装置及び方法並びにプログラミング支援プログラムに関する。
【0002】
【従来の技術】
プログラミング作業においては、例えば所定の関数に対する引数として、同一内容のソースコードを何度も記述する作業がしばしば発生する。そこで従来、このような手間を無くすプログラミング支援技術として、利用頻度の高いソースコードを抽出して別途記憶しておき、ソースプログラムの開発工程中にこのソースコードを引用して所望のソースプログラムを開発する技術が知られていた。具体的には、開発工程中のソースプログラムにソースコードを挿入する位置を指定すると、記憶部から所定のソースコードが読み出され、指定された位置にこのソースコードが挿入される。このような技術を利用することによって、同一内容のソースコードを何度も記述する手間を無くすことができる。(例えば、特許文献1参照)。
【0003】
【特許文献1】
特開平11−327886号公報
【0004】
【発明が解決しようとする課題】
しかしながら、従来のこの種のプログラミング支援技術を用いた場合においても、プログラミング作業者は、開発工程中のソースプログラムの記述中から予め記憶しておいたソースコードを挿入する位置を探して指定しなければならなかったので、挿入位置を容易に見つけ出すことができず、かえって効率が悪くなるということがあった。
【0005】
本発明は、このような事情に基づいてなされたもので、その目的とするところは、関数の引数となり得るソースコードであれば、ソースプログラムに対して挿入位置を指定しなくても正しい位置に所望するソースコードを挿入することができ、プログラミング作業者の負担を軽減しつつプログラムを効率よく開発することができるプログラミング支援装置及び方法並びにプログラミング支援プログラムを提供しようとするものである。
【0006】
【課題を解決するための手段】
本発明のプログラミング支援装置は、所定のプログラミング言語によって記述されるソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを記憶するコード記憶手段と、このコード記憶手段に記憶されたソースコードを利用してプログラミングを行なうソースプログラムを選択させるプログラム選択手段と、このプログラム選択手段により選択されたソースプログラムに存在する関数を取得する関数取得手段と、この関数取得手段により取得した関数群の中からソースコードを引数とする関数を指定する関数指定手段と、この関数指定手段により指定された関数をソースプログラムから抽出し、この関数に対する引数としてコード記憶手段により記憶されたソースコードをソースプログラムに挿入するコード挿入手段とを備えたものである。
【0007】
本発明のプログラミング支援方法は、所定のプログラミング言語によって記述されるソースプログラムの開発を支援する方法であって、ソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを予め記憶しておく。そして、ソースコードを利用してプログラミングを行なうソースプログラムを選択させるプログラム選択工程と、選択されたソースプログラムに存在する関数を取得する関数取得工程と、この関数取得工程で取得した関数群の中からソースコードを引数とする関数を指定させる関数指定工程と、この関数指定工程で指定された関数をソースプログラムから抽出し、この関数に対する引数として予め記憶されたソースコードを当該ソースプログラムに挿入するコード挿入工程とを実行するものである。
【0008】
本発明のプログラミング支援プログラムは、所定のプログラミング言語によって記述されるソースプログラムを開発するコンピュータに、ソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを記憶する機能と、ソースコードを利用してプログラミングを行なうソースプログラムを選択させる機能と、選択されたソースプログラムに存在する関数を取得する機能と、取得した関数群の中からソースコードを引数とする関数を指定させる機能と、指定された関数をソースプログラムから抽出し、この関数に対する引数として予め記憶されたソースコードを当該ソースプログラムに挿入する機能とを実現させるものである。
【0009】
【発明の実施の形態】
以下、本発明の実施の形態を図面を用いて説明する。
なお、この実施の形態は、オブジェクト指向プログラミングを実施するコンピュータに本発明のプログラミング支援技術を適用した場合である。因みに、オブジェクト指向プログラミングは、複数のクラスを組み合わせて一つのオブジェクトを開発し、さらに、1つのオブジェクトと他のオブジェクトとを関連付けることによってソースプログラムを開発するプログラミング工程を有するものである。クラスは、引数と呼ばれるデータを受け取り、規則に従った処理を実行して結果を出力するといった手続きの形式である関数をまとめて定義したもので、多くのプログラミング言語では、利用頻度の高い機能が関数として予め用意されている。
【0010】
図1はオブジェクト指向プログラミングを実施するプログラミング装置の要部構成を示すブロック図であり、図中符号1の二点鎖線で囲った枠内は、プログラミング装置本体を示している。プログラミング装置本体1は、コンピュータによって構成されており、プログラミング基本機能部11、記憶部12、入出力インタフェース部13、通信制御部14及びプログラミング支援機能部15が設けられている。
【0011】
プログラミング基本機能部11は、Visual Basic(登録商標),Visual C#,Visual J#等の所定の言語によって記述されるソースプログラムを開発する機能と、開発されたソースプログラムをコンパイルして所期の目的であるプログラムを完成させる機能とを有するものである。プログラミング基本機能部11は、当該プログラミング装置本体1の中枢を担う中央処理装置(CPU)と、オペレーティング・システム(OS),エディタ,コンパイラ等のプログラムを記憶するメモリ等で構成されている。
【0012】
記憶部12は、プログラミング基本機能部11によって開発されている途中のソースプログラムを格納したプログラムファイル121や、プログラミング支援機能部15によって管理されるコードブロックファイル122,編集対象リストファイル123等を記憶保存するもので、例えばハードディスクや光磁気ディスク等の不揮発性の記憶媒体で構成されている。
【0013】
1つのプログラムファイル121には1種類のソースプログラムが格納されており、記憶部12には、開発途中のソースプログラムのプログラムファイル121をまとめて保管するプログラムフォルダ124が形成されている。
【0014】
入出力インタフェース部13は、プログラミング装置本体1に接続された操作部2の操作により入力されるデータ信号をプログラミング基本機能部11に与える機能と、プログラミング基本機能部11から与えられる表示データをプログラミング装置本体1に接続された表示部3に出力する機能とを有するものである。操作部2としては、キーボードやポインティングデバイス等が用いられている。表示部3としては、CRTディスプレイや液晶ディスプレイ等の画面表示器が用いられている。
【0015】
通信制御部14は、LAN(Local Area Network)等の通信媒体を介して外部コンピュータ機器との間で行われるデータ通信を制御するものである。
【0016】
プログラミング支援機能部15は、ファイル管理機能151と、コードブロック登録機能152と、コードブロック挿入機能153とを有するものである。プログラミング支援機能部15は、前記CPUと、プログラミング支援プログラムを格納したメモリ等で構成されている。プログラミング支援プログラムは、通信制御部14に接続された通信媒体を介して有線または無線により外部コンピュータ機器から当該プログラミング装置本体1のメモリにインストールされる。あるいは、CD−ROM,フレキシブルディスク等のコンピュータ読取り可能な記憶媒体に記憶され、ディスクドライブなどの読取り装置を介してプログラミング装置本体1のメモリにインストールされる。
【0017】
ファイル管理機能151は、コードブロックファイル122と編集対象リストファイル123を前記記憶部12に形成し、当該ファイル122,123へのデータの書込み及び当該ファイル122,123からのデータの読出しを行なうもので、プログラミング支援プログラムの一機能である。
【0018】
コードブロックファイル122には、図2に示すように、コードブロック名によって特定されるコードブロックデータが、そのコードブロックデータのプログラム言語を識別する言語データ(C#等)及びそのコードブロックデータの概要を説明するテキストデータとともに書き込まれる。コードブロックデータは、ソースプログラムに記述されるソースコードのうち再利用性の高いソースコードの集合体であり、特に、予め設定された関数の引数となり得るソースコードの集合体がコードブロックデータとして登録される。コードブロックファイル122に登録されたデータは、コンピュータの電源オフ時も消去されることなく保存される。
【0019】
編集対象リストファイル123には、図3に示すように、1からの連続番号である順序データに対応して、前記コードブロックデータを引数として使用する関数の関数名と、そのコードブロック名とが書き込まれる。
【0020】
コードブロック登録機能152は、図4の流れ図に示す手順に従い、任意のコードブロックデータをコードブロック名データ,言語データ及び説明データとともにコードブロックファイル122に登録する機能を実現するもので、プログラミング支援プログラムの一機能である。
【0021】
すなわち、操作部2の操作によりコードブロック登録業務が選択され、その実行が指令されると、プログラミング基本機能部11は、プログラミング支援機能部15に対してコードブロック登録業務の開始を指令する。この指令を受けて、プログラミング支援機能部15は、コードブロック登録機能152を動作させて、図4の処理を開始する。
【0022】
先ず、プログラミング支援機能部15は、ST(ステップ)1として例えば図5に示すレイアウトのコードブロック登録ダイアログボックス6を表示部3に表示させる。このダイアログボックス6には、少なくともコードブロック名データの入力エリア61、説明データの入力エリア62及びコードブロックデータの入力エリア63と、Visual Basic(登録商標),Visual C#,Visual J#及びAll languageの4種類のプログラミング言語の中からいずれか1種類を選択可能な言語選択エリア64と、コードブロックデータの登録を指示するOKボタン65及び登録中止を指示するキャンセルボタン66とが形成されている。そして、プログラミング作業者が操作部2を操作することによって、各入力エリア61,62,63にそれぞれ所望するコードブロック名データ,説明データ,コードブロックデータをテキストデータとして入力できるようになっている。また、言語選択エリア64のなかからいずれか1種類の言語データを選択できるようになっている。さらに、OKボタン65及びキャンセルボタン66を操作できるようになっている。なお、言語選択エリア64では、デフォルトとして例えばAll languageが予め選択されている。デフォルトとして選択される言語は、All languageに限定されるものではなく、Visual C#,Visual J#またはVisual Basic(登録商標)のいずれかであってもよい。
【0023】
この状態で、プログラミング支援機能部15は、ST2としてキャンセルボタン66が操作されるか、ST3としてOKボタン65が操作されるのを待機する。ここで、キャンセルボタン66が操作されたことを検知した場合には、プログラミング支援機能部15は、ST9として表示部3のコードブロック登録ダイアログボックス6を消去して、この処理を終了する。
【0024】
ST3にてOKボタン65が操作されたことを検知した場合には、プログラミング支援機能部15は、ST4として入力エリア61にコードブロック名データが入力されていること、ST5として入力エリア62に説明データが入力されていること、ST6として入力エリア63のコードブロックデータが入力されていること、ST7として言語選択エリア64にていずれか1種類のプログラミング言語が選択されていることを確認する。そして、各入力エリア61,62,63にそれぞれ該当するデータが格納されていること及び言語選択エリア64にていずれか1種類のプログラミング言語が選択されていることを確認したならば、プログラミング支援機能部15は、ST8としてその各入力エリア61,62,63にそれぞれ入力されたコードブロック名データ,説明データ及びコードブロックデータと、言語選択エリア64にて選択されているプログラミング言語の識別データとを対応付けてコードブロックファイル122の空エリアに書込み、登録する。しかる後、プログラミング支援機能部15は、ST9として表示部3のコードブロック登録ダイアログボックス6を消去して、この処理を終了する。
【0025】
なお、少なくとも一つの入力エリア61,62,63にデータが入力されていないか、プログラミング言語が選択されていない場合には、OKボタン65の操作を無効にして、再度OKボタン65が操作されるか、キャンセルボタン66が操作されるのを待機する。
【0026】
コードブロック挿入機能153は、図6〜図8の流れ図に示す手順に従い、開発途中であるソースプログラムに、コードブロックデータとして予めコードブロックファイル122に登録されているソースコードを挿入するもので、プログラミング支援プログラムの一機能である。
【0027】
すなわち、操作部2の操作によりコードブロック挿入業務が選択され、その実行が指令されると、プログラミング基本機能部11は、プログラミング支援機能部15に対してコードブロック挿入業務の開始を指令する。この指令を受けて、プログラミング支援機能部15は、コードブロック挿入機能153を動作させて、図6の処理を開始する。
【0028】
先ず、プログラミング支援機能部15は、ST11として例えば図9に示すレイアウトのブロック挿入ウィザードダイアログボックス7のコードブロックリストパネル70を表示部3に表示させる。このコードブロックリストパネル70には、少なくともコードブロックリスト表示エリア71と、挿入ボタン72と、終了ボタン73とが設けられている。また、コードブロックリストパネル70を選択するためのコードブロックリストタブ74に隣接して、当該コードブロックリストパネル70の裏側に隠れたクラスツリーパネル80を選択するためのクラスツリータブ81が設けられている。そしてプログラミング支援機能部15は、コードブロックファイル122に記憶されているコードブロック名データ,説明データ及びプログラミング言語の識別データを読込み、そのリストをコードブロックリスト表示エリア71に表示させる。
【0029】
この状態で、プログラミング支援機能部15は、ST12として終了ボタン73が操作されるか、ST13として挿入ボタン72が操作されるか、ST14としてクラスツリータブ81が選択されるのを待機する。ここで、終了ボタン73が操作されたことを検知した場合には、プログラミング支援機能部15は、ST24として表示部3のブロック挿入ウィザードダイアログボックス7を消去して、この処理を終了する。
【0030】
ST13にて挿入ボタン72が操作されたことを検知した場合には、プログラミング支援機能部15は、ST15としてリスト表示エリア71に表示されているコードブロックリストのコードブロック名の中からいずれか1つのコードブロック名が選択されているか確認する。ここで、コードブロック名が選択されていない場合には、プログラミング支援機能部15は挿入ボタン72の操作を無視し、再び終了ボタン73または挿入ボタン72が操作されるか、クラスツリータブ81が選択されるのを待機する。
【0031】
これに対し、操作部2の操作により1つのコードブロック名が選択されていた場合には、プログラミング支援機能部15は、ST16としてポインタ位置挿入処理を実行する。この挿入処理は、選択されたコードブロック名によって特定されるコードブロックデータの言語がプログラミング基本機能部11にて開発途中のソースプログラムの言語と一致するとき、当該コードブロックデータをコードブロックファイル122から読出し、操作部2によって操作されるポインタが示すソースプログラムの位置に挿入する処理である。そして、プログラミング支援機能部15は、この挿入処理を終了すると、再び終了ボタン73または挿入ボタン72が操作されるか、クラスツリータブ81が選択されるのを待機する。
【0032】
ST14にてクラスツリータブ81が選択されたことを検知した場合には、プログラミング支援機能部15は、ST17としてブロック挿入ウィザードダイアログボックス7の内容を例えば図10に示すレイアウトのクラスツリーパネル80に切換える。このクラスツリーパネル80には、少なくともプログラム名表示エリア82と、クラス名表示エリア83と、関数名表示エリア84と、編集ボタン85と、終了ボタン86とが設けられている。また、クラスツリータブ81に隣接して、当該クラスツリーパネル80の裏側に隠れたコードブロックリストパネル70を選択するためのコードブロックリストタブ74が設けられている。そしてプログラミング支援機能部15は、プログラムフォルダ124に保存されているプログラムファイル121に格納されているプログラムの名称(プログラム名)をプログラム表示エリア82に選択可能に表示させる(プログラム選択手段)。また、プログラム名表示エリア82に表示されたプログラム名の中から1つのプログラム名が選択されると、そのプログラム名のソースプログラムを構成する各クラスのクラス名をクラス名表示エリア83に選択可能に表示させる。さらに、クラス名表示エリア83に表示されたクラス名の中から1つのクラス名が選択されると、そのクラス名のクラスに定義されたすべての関数を取得し(関数取得手段)、その関数名を関数名表示エリア84に表示させる。
【0033】
この状態で、プログラミング支援機能部15は、ST18として終了ボタン86が操作されるか、ST19として編集ボタン85が操作されるか、ST20としてコードブロックリストタブ74が選択されるのを待機する。ここで、終了ボタン86が操作されたことを検知した場合には、プログラミング支援機能部15は、ST24として表示部3のブロック挿入ウィザードダイアログボックス7を消去して、この処理を終了する。
【0034】
ST19にて編集ボタン85が操作されたことを検知した場合には、プログラミング支援機能部15は、ST21としてプログラム名表示エリア82に表示されているプログラム名の1つが選択されていること、及びST22としてクラス名表示エリア83に表示されているクラス名の1つが選択されていることを確認する。ここで、プログラム名及びクラス名の少なくとも一方が選択されていない場合には、プログラミング支援機能部15は編集ボタン85の操作を無視し、再び終了ボタン86または編集ボタン85が操作されるか、コードブロックリストタブ74が選択されるのを待機する。
【0035】
プログラム名とクラス名が選択されていることを確認した場合には、プログラミング支援機能部15は、ST23として後述する関数挿入処理を実行する。そして、この関数挿入処理を終了したならば、プログラミング支援機能部15は、再び終了ボタン86または編集ボタン85が操作されるか、コードブロックリストタブ74が選択されるのを待機する。
【0036】
ST20にてコードブロックリストタブ74が選択されたことを検知した場合には、プログラミング支援機能部15はST11の処理に戻り、ブロック挿入ウィザードダイアログボックス7の内容をコードブロックリストパネル70に切換える。そして、終了ボタン73または挿入ボタン72が操作されるか、クラスツリータブ81が選択されるのを待機する。
【0037】
図7は、図6中ST23の関数挿入処理の手順を具体的に示す流れ図である。すなわちプログラミング支援機能部15は、関数挿入処理に入ると、先ず、ST31として例えば図11に示すレイアウトの編集ダイアログボックス9を表示部3に表示する。この編集ダイアログボックス9には、少なくともクラス名表示エリア91、コードブロック名表示エリア92、説明データ表示エリア93、関数名表示エリア94、関数名とコードブロック名とからなる編集対象リストの表示エリア95、追加ボタン96、OKボタン97及びキャンセルボタン98が設けられている。また、編集対象リスト表示エリア95には、アップボタン951,ダウンボタン952及び削除ボタン953のリスト編集ボタンが設けられている。そしてプログラミング支援機能部15は、クラスツリーパネル80にて選択されたクラス名をクラス名表示エリア91に表示させる。また、その選択されたクラス名のクラスに定義されたすべての関数名を関数名表示エリア94に選択可能に表示させる(関数指定手段)。さらに、コードブロックファイル122に登録されている各コードブロックデータのコードブロック名をコードブロック名表示エリア92にプルダウン表示可能とし、デフォルトとして先頭のコードブロック名を表示させる。そして、このコードブロック名表示エリア92に表示されたコードブロック名のコードブロックデータに対応する説明データを説明データ表示エリア93に表示させる。
【0038】
次に、プログラミング支援機能部15は、ST32としてコードブロック名表示エリア92にプルダウン表示されるコードブロック名のなかからいずれか1つのコードブロック名が選択されるか、ST33として追加ボタン96が操作されるか、ST34としてリスト編集ボタン951〜953が操作されるか、ST35としてOKボタン97が操作されるか、ST36としてキャンセルボタン98が操作されるのを待機する。
【0039】
ここで、コードブロック名が選択されたことを検知した場合には、プログラミング支援機能部15は、ST37としてその選択されたコードブロック名に対応する説明データをコードブロックファイル122から読出し、説明データ表示エリア93に表示させる。しかる後、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0040】
ST33にて追加ボタン96が操作されたことを検知した場合には、プログラミング支援機能部15は、ST38として関数名表示エリア94に表示されている関数名の中からいずれか1つの関数名が選択されているか否かを判断する。そして選択されていない場合には、追加ボタン96の操作を無視して、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0041】
これに対し、いずれか1つの関数名が選択されていた場合には、プログラミング支援機能部15は、ST39としてその選択された関数名とコードブロック名とを編集対象リストファイル123に格納する。このとき、編集対象リストファイル123の空いている順序データのなかで、最小の順序データに対応させて関数名とコードブロック名とを格納する(蓄積手段)。しかる後、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0042】
ST34にてリスト編集ボタン151〜153が操作されたことを検知した場合には、プログラミング支援機能部15は、ST40(図8)として編集対象リスト表示エリア95に表示されている編集対象データの中からいずれか1つのデータが選択されているか否かを判断する。そして選択されていない場合には、リスト編集ボタン151〜153の操作を無視して、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0043】
これに対し、いずれか1つの編集対象データ(関数名,コードブロック名)が選択されていた場合には、プログラミング支援機能部15は、ST41として操作されたリスト編集ボタンを判別する。ここで、操作ボタンがアップボタン951であった場合には、プログラミング支援機能部15は、ST42として選択された編集対象データが編集対象リストファイル123の先頭に位置するようにシフトするとともに、編集対象リスト表示エリア95のリスト表示を更新する(蓄積順序変更手段)。また、操作ボタンがダウンボタン952であった場合には、プログラミング支援機能部15は、ST43として選択された編集対象データが編集対象リストファイル123の最後尾に位置するようにシフトするとともに、編集対象リスト表示エリア95のリスト表示を更新する(蓄積順序変更手段)。また、操作ボタンが削除ボタン953であった場合には、プログラミング支援機能部15は、ST44として選択された編集対象データを編集対象リストファイル123から削除するとともに編集対象リスト表示エリア95のリスト表示を更新する。その後、プログラミング支援機能部15は、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0044】
ST35にてOKボタン35が操作されたことを検知した場合には、プログラミング支援機能部15は、ST45として編集対象リストファイル123に編集対象データが格納されているか否かを判断する。そして編集対象データが格納されていない場合には、OKボタンの操作を無視して、コードブロック名の選択若しくは各ボタン951〜953,96,97,98の操作待機状態に戻る。
【0045】
これに対し、編集対象データが格納されている場合には、プログラミング支援機能部15は、ST46としてクラスツリーパネル80のプログラム名表示エリア82上で選択されたプログラム名のソースプログラムに対し、その編集対象データの関数名によって特定される関数の引数記述領域に、コードブロック名によって特定されるコードブロックデータを挿入する。具体的には、先ず、編集対象リストファイル123から先頭の編集対象データを読み出す。次に、この読み出した編集対象データのコードブロック名によって特定されるコードブロックデータの言語が、当該ソースプログラムの言語と一致するかどうか調べる。そして言語が一致する場合には、当該コードブロックデータをコードブロックファイル122から読み出すとともに、当該編集対象データの関数名によって特定される関数を当該ソースプログラムから抽出し、この関数の引数記述領域に当該コードブロックデータを挿入する(コード挿入手段)。言語が一致しない場合には、コードブロックデータを挿入しない。以後、編集対象リストファイル123から編集対象データを読み出す毎に、上記処理を繰返す。
【0046】
こうして、編集対象リストファイル123に格納された全ての編集対象データについて上記処理を実行したならば、プログラミング支援機能部15は、ST47として編集対象リストファイル123をクリアする。また、ST48として編集ダイアログボックス9を消去したならば、この関数挿入処理を終了する。ここに、編集ダイアログボックス9のOKボタン97は、挿入指示手段として機能する。
【0047】
ST36にてキャンセルボタン98が操作されたことを検知した場合には、プログラミング支援機能部15は、その時点で編集対象リストファイル123をクリアするとともに編集ダイアログボックス9を消去して、この関数挿入処理を終了する。
【0048】
このように構成された本実施の形態においては、プログラミング作業者は、例えばソースプログラムを開発している段階で、関数の引数等として再利用性のあるソースコードを発見すると、それをコードブロックデータとしてコードブロックファイル122に適時登録する。
【0049】
すなわちプログラミング作業者は、操作部2を操作してプログラミング装置本体1に対しコードブロック登録業務の実行を指令する。すると、表示部3に、図5に示すコードブロック登録ダイアログボックス6が表示されるので、プログラミング作業者は、操作部2を操作してこのダイアログボックス6の入力エリア61〜63に、それぞれ所望するコードブロック名,説明及びコードブロックの各データを入力する。また、言語選択エリア44の中から当該コードブロックデータの言語を指定する。しかる後、OKボタン65を操作する。こうすることにより、当該コードブロックデータが説明データ,コードブロック名データ及び言語データとともにコードブロックファイル122に登録される。
【0050】
しかしてプログラミング作業者は、ソースプログラムを開発している最中に、コードブロックファイル122に登録されているコードブロックデータ(ソースコード)を利用できると判断すると、操作部2を操作してコードブロック挿入業務の実行を指令する。そうすると、表示部3に、図9に示す挿入ウィザードダイアログボックス7のコードブロックリストパネル70が表示されるので、プログラミング作業者は、ソースプログラムにコードブロックデータを関数指定により挿入するか、マニュアル指定により挿入するかを決める。マニュアル指定により挿入対象のソースプログラムを選択後、このソースプログラムの挿入位置をマウスポインタで指示する。しかる後、コードブロックリスト表示エリア71からその位置に挿入するコードブロックデータのコードブロック名を選択し、挿入ボタン72を操作する。こうすることにより、選択されたコードブロック名のコードブロックデータが当該ソースプログラムのマウスポインタによって指示された位置に挿入される。
【0051】
これに対し、関数指定により挿入する場合には、プログラミング作業者は、クラスツリータブ81を操作する。すると、図10に示す如く、ブロック挿入ウィザードダイアログボックス7の内容がクラスツリーパネル80に切換わり、開発中のソースプログラムのプログラム名リストがプログラム名表示エリア82に表示されるので、プログラミング作業者は、操作部2を操作してコードブロックデータ挿入対象プログラムのプログラム名を選択する。すると、このプログラム名が設定されたソースプログラムを構成するクラスのクラス名リストがクラス名表示エリア83に表示されるので、プログラミング作業者は、操作部2を操作してコードブロックデータ挿入対象クラスのクラス名を選択する。すると、このクラス名のクラス内部に記述されている関数の関数名リストが関数名表示エリア84に表示されるので、当該コードブロックデータを引数とする関数があることを確認する。そして、確認したならば編集ボタン85を操作する。
【0052】
これにより、表示部3には、図11に示す編集ダイアログボックス9が表示される。そこで、プログラミング作業者は、コードブロック名表示エリア92から挿入するコードブロックデータのコードブロック名を選択する。また、関数名表示エリア94から当該コードブロックデータを引数として記述する関数の関数名を1つ選択する。そして、追加ボタン96を操作する。すると、当該関数名とコードブロック名とが編集対象リストファイル123の1番目に格納され、その内容が編集対象リスト表示エリア95に表示される。
【0053】
ここで、同一のコードブロックデータを他の関数の引数としても用いる場合には、プログラミング作業者は、関数名表示エリア94から該当する関数名を選択し、追加ボタン96を操作する。これにより、この関数名と当該コードブロック名とが編集対象リストファイル123の2番目に格納され、その内容が編集対象リスト表示エリア95に表示される。
【0054】
なお、他のコードブロックデータも挿入する場合には、プログラミング作業者は、コードブロック名の選択操作と関数名の選択操作とを繰返せばよい。
【0055】
例えば、今、図11に示すように、関数名「Page_Load」の関数に対してコードブロック名「DBAccess04」のコードブロックデータを挿入すること、及び関数名「OnInit」の関数に対しても同じコードブロックデータを挿入することが指示されたとする。また、挿入対象として選択されたソースプログラムを図12に示す内容のものとする。
【0056】
この状態で、プログラミング作業者が編集ダイアログボックス9のOKボタン97を操作すると、ソースプログラム中の1行目の関数「Page_Load」に対する引数記述領域(2行目の“{”から4行目の“}”までの領域)と、5行目の関数「OnInit」に対する引数記述領域(6行目の“{”から最下行の“}”までの領域)とに、コードブロック名「DBAccess04」のコードブロックデータ100が挿入され、ソースプログラムは、図13に示す内容のものとなる。
【0057】
このように本実施の形態によれば、関数の引数として再利用性のあるソースコードを予め登録しておくことによって、ソースプログラムに対して挿入位置を指定しなくても当該ソースコードを正しい位置に挿入することができる。したがって、プログラミング作業者の負担になることなく同じ内容のソースコードを何度も記述する手間を不要にできるので、プログラムをより一層効率よく開発することができるようになる。
【0058】
なお、前記実施の形態ではオブジェクト指向プログラミングの支援技術として本発明を説明したが、オブジェクト指向でないプログラム開発の支援技術にも本発明は適用できるものである。
【0059】
また、前記実施の形態では、コードブロック登録機能152をプログラミング支援プログラムの一機能として説明したが、プログラミング支援プログラムとは別のプログラムによって機能されるものであってもよい。
【0060】
【発明の効果】
以上詳述したように本発明によれば、関数の引数となり得るソースコードであれば、ソースプログラムに対して挿入位置を指定しなくても正しい位置に所望するソースコードを挿入することができ、プログラミング作業者の負担を軽減しつつプログラムを効率よく開発することができるプログラミング支援装置及び方法並びにプログラミング支援プログラムを提供できる。
【図面の簡単な説明】
【図1】本発明の一実施の形態であるプログラミング装置の要部構成を示すブロック図。
【図2】同プログラミング装置の記憶部に形成されるコードブロックファイルのデータ構造を示す模式図。
【図3】同プログラミング装置の記憶部に形成される編集対象リストファイルのデータ構造を示す模式図。
【図4】同プログラミング装置のプログラミング支援機能部が制御するコードブロック登録機能の主要な処理手順を示す流れ図。
【図5】同プログラミング装置の表示部に表示されるコードブロック登録ダイアログボックスの一例を示す模式図。
【図6】同プログラミング装置のプログラミング支援機能部が制御するコードブロック挿入機能の主要な処理手順を示す流れ図。
【図7】図6における関数挿入処理を具体的に示す流れ図。
【図8】図7におけるリスト編集ボタン入力後の処理を具体的に示す流れ図。
【図9】同プログラミング装置の表示部に表示されるブロック挿入ウイザードのコードブロックパネルの一例を示す模式図。
【図10】同プログラミング装置の表示部に表示されるブロック挿入ウイザードのクラスツリーパネルの一例を示す模式図。
【図11】同プログラミング装置の表示部に表示されるクラスツリー編集ダイアログボックスの一例を示す模式図。
【図12】コードブロックデータ挿入前のソースプログラムの一例を示す図。
【図13】コードブロックデータ挿入後のソースプログラムの一例を示す図。
【符号の説明】
1…プログラミング装置本体、2…操作部、3…表示部、11…プログラミング基本機能部、12…記憶部、121…プログラムファイル、122…コードブロックファイル、123…編集対象リストファイル、13…入出力インタフェース部、14…通信制御部、15…プログラミング支援機能部、151…ファイル管理機能、152…コードブロック登録機能、153…コードブロック挿入機能。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programming support apparatus and method and a programming support program for supporting a program so that it can be efficiently developed on a computer.
[0002]
[Prior art]
In a programming operation, for example, an operation for describing a source code having the same content many times as an argument for a predetermined function often occurs. Therefore, conventionally, as a programming support technology that eliminates such troubles, source code that is frequently used is extracted and stored separately, and this source code is cited during development of the source program to develop a desired source program. The technology to do was known. Specifically, when a position where the source code is inserted into the source program in the development process is designated, a predetermined source code is read from the storage unit, and this source code is inserted at the designated position. By using such a technique, it is possible to eliminate the trouble of repeatedly writing the same source code. (For example, refer to Patent Document 1).
[0003]
[Patent Document 1]
JP-A-11-327886
[0004]
[Problems to be solved by the invention]
However, even in the case of using this type of conventional programming support technology, the programming worker must search for and specify the position to insert the stored source code from the description of the source program during the development process. Since it had to be done, the insertion position could not be easily found, and the efficiency was rather reduced.
[0005]
The present invention has been made based on such circumstances, and the purpose of the present invention is to place the source code in the correct position without specifying the insertion position for the source program as long as the source code can be an argument of the function. It is an object of the present invention to provide a programming support apparatus and method and a programming support program that can insert a desired source code and can efficiently develop a program while reducing the burden on a programming operator.
[0006]
[Means for Solving the Problems]
The programming support apparatus of the present invention includes a code storage means for storing source code that is described in the same language as a source program described in a predetermined programming language and that can be an argument of a function prepared in advance for the programming language. A program selection means for selecting a source program to be programmed using the source code stored in the code storage means, a function acquisition means for acquiring a function existing in the source program selected by the program selection means, A function designating unit that specifies a function that takes a source code as an argument from the function group obtained by the function obtaining unit, and a function that is designated by the function designating unit is extracted from the source program and stored as an argument to the function. Source code stored by means The de is obtained and a code insertion means for inserting in the source program.
[0007]
The programming support method of the present invention is a method for supporting the development of a source program described in a predetermined programming language, which is described in the same language as the source program and has functions prepared in advance for the programming language. Source code that can be an argument is stored in advance. Then, a program selection step for selecting a source program to be programmed using the source code, a function acquisition step for acquiring a function existing in the selected source program, and a function group acquired in the function acquisition step A function designating step for designating a function having a source code as an argument, and a code for extracting a function designated in the function designating step from a source program and inserting a source code stored in advance as an argument for the function into the source program And an insertion process.
[0008]
The programming support program of the present invention is a source that can be described in the same language as the source program in a computer that develops a source program described in a predetermined programming language and can be an argument of a function prepared in advance for the programming language. A function for storing code, a function for selecting a source program to be programmed using the source code, a function for acquiring a function existing in the selected source program, and an argument of the source code from the acquired function group And a function for extracting the designated function from the source program and inserting a source code stored in advance as an argument for the function into the source program.
[0009]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
In this embodiment, the programming support technology of the present invention is applied to a computer that performs object-oriented programming. Incidentally, object-oriented programming has a programming step of developing a source program by developing a single object by combining a plurality of classes and further associating one object with another object. A class is a collection of functions that are in the form of procedures that receive data called arguments, execute processing according to rules, and output the results. In many programming languages, functions that are frequently used are defined. It is prepared in advance as a function.
[0010]
FIG. 1 is a block diagram showing a configuration of a main part of a programming apparatus that performs object-oriented programming. In the figure, a frame surrounded by a two-dot chain line of reference numeral 1 shows a programming apparatus main body. The programming device main body 1 is configured by a computer, and includes a programming basic function unit 11, a storage unit 12, an input / output interface unit 13, a communication control unit 14, and a programming support function unit 15.
[0011]
The basic programming function unit 11 is a function for developing a source program described in a predetermined language such as Visual Basic (registered trademark), Visual C #, Visual J #, and the like. And a function for completing a target program. The basic programming function unit 11 includes a central processing unit (CPU) that plays a central role in the programming device main body 1 and a memory that stores programs such as an operating system (OS), an editor, and a compiler.
[0012]
The storage unit 12 stores and saves a program file 121 storing a source program being developed by the basic programming function unit 11, a code block file 122 managed by the programming support function unit 15, an editing target list file 123, and the like. For example, a non-volatile storage medium such as a hard disk or a magneto-optical disk is used.
[0013]
One program file 121 stores one type of source program, and the storage unit 12 has a program folder 124 that collectively stores the program files 121 of the source programs being developed.
[0014]
The input / output interface unit 13 has a function of supplying a data signal input by operating the operation unit 2 connected to the programming device main body 1 to the programming basic function unit 11 and display data provided from the programming basic function unit 11 as a programming device. It has a function of outputting to the display unit 3 connected to the main body 1. As the operation unit 2, a keyboard, a pointing device, or the like is used. As the display unit 3, a screen display such as a CRT display or a liquid crystal display is used.
[0015]
The communication control unit 14 controls data communication performed with an external computer device via a communication medium such as a LAN (Local Area Network).
[0016]
The programming support function unit 15 has a file management function 151, a code block registration function 152, and a code block insertion function 153. The programming support function unit 15 includes the CPU and a memory storing a programming support program. The programming support program is installed in the memory of the programming device main body 1 from an external computer device by wire or wirelessly via a communication medium connected to the communication control unit 14. Alternatively, the program is stored in a computer-readable storage medium such as a CD-ROM or a flexible disk, and is installed in the memory of the programming apparatus main body 1 via a reader such as a disk drive.
[0017]
The file management function 151 forms a code block file 122 and an edit target list file 123 in the storage unit 12 and writes data to the files 122 and 123 and reads data from the files 122 and 123. This is a function of a programming support program.
[0018]
In the code block file 122, as shown in FIG. 2, the code block data specified by the code block name includes language data (C #, etc.) for identifying the program language of the code block data and an outline of the code block data. Is written together with text data explaining the above. Code block data is a collection of highly reusable source code among source codes described in a source program, and in particular, a collection of source code that can be an argument of a preset function is registered as code block data. Is done. The data registered in the code block file 122 is saved without being erased even when the computer is turned off.
[0019]
In the editing target list file 123, as shown in FIG. 3, the function name of the function that uses the code block data as an argument and the code block name are associated with the sequential data starting from 1. Written.
[0020]
The code block registration function 152 realizes a function of registering arbitrary code block data in the code block file 122 together with code block name data, language data, and explanation data according to the procedure shown in the flowchart of FIG. It is one function.
[0021]
That is, when a code block registration job is selected by operating the operation unit 2 and its execution is instructed, the programming basic function unit 11 instructs the programming support function unit 15 to start the code block registration job. In response to this instruction, the programming support function unit 15 operates the code block registration function 152 and starts the processing of FIG.
[0022]
First, the programming support function unit 15 causes the display unit 3 to display, for example, a code block registration dialog box 6 having a layout shown in FIG. This dialog box 6 includes at least a code block name data input area 61, an explanation data input area 62, and a code block data input area 63, Visual Basic (registered trademark), Visual C #, Visual J #, and All language. A language selection area 64 in which any one of the four programming languages can be selected, an OK button 65 for instructing registration of code block data, and a cancel button 66 for instructing cancellation of registration are formed. Then, by operating the operation unit 2 by the programming operator, desired code block name data, description data, and code block data can be input as text data in the input areas 61, 62, and 63, respectively. In addition, any one type of language data can be selected from the language selection area 64. Further, an OK button 65 and a cancel button 66 can be operated. In the language selection area 64, for example, All language is selected in advance as a default. The language selected as the default is not limited to All language, and may be any of Visual C #, Visual J #, or Visual Basic (registered trademark).
[0023]
In this state, the programming support function unit 15 waits for the cancel button 66 to be operated as ST2 or the OK button 65 to be operated as ST3. If it is detected that the cancel button 66 has been operated, the programming support function unit 15 deletes the code block registration dialog box 6 of the display unit 3 as ST9 and ends this process.
[0024]
When it is detected that the OK button 65 is operated in ST3, the programming support function unit 15 confirms that code block name data is input to the input area 61 as ST4, and explanation data to the input area 62 as ST5. , That the code block data of the input area 63 is input as ST6, and that one of the programming languages is selected in the language selection area 64 as ST7. If it is confirmed that the corresponding data is stored in each of the input areas 61, 62, and 63 and that any one programming language is selected in the language selection area 64, the programming support function The unit 15 receives the code block name data, the description data, and the code block data input to the input areas 61, 62, and 63 as ST8, and the identification data of the programming language selected in the language selection area 64, respectively. The code block file 122 is written and registered in association with the empty area. Thereafter, the programming support function unit 15 deletes the code block registration dialog box 6 of the display unit 3 as ST9 and ends this processing.
[0025]
If no data is input in at least one input area 61, 62, 63 or no programming language is selected, the operation of the OK button 65 is invalidated and the OK button 65 is operated again. Or it waits for the cancel button 66 to be operated.
[0026]
The code block insertion function 153 inserts source code registered in the code block file 122 in advance as code block data into a source program under development according to the procedure shown in the flowcharts of FIGS. This is a function of the support program.
[0027]
That is, when a code block insertion job is selected by the operation of the operation unit 2 and its execution is instructed, the programming basic function unit 11 commands the programming support function unit 15 to start the code block insertion job. In response to this instruction, the programming support function unit 15 operates the code block insertion function 153 to start the processing of FIG.
[0028]
First, the programming support function unit 15 causes the display unit 3 to display the code block list panel 70 of the block insertion wizard dialog box 7 having the layout shown in FIG. The code block list panel 70 is provided with at least a code block list display area 71, an insert button 72, and an end button 73. A class tree tab 81 for selecting a class tree panel 80 hidden behind the code block list panel 70 is provided adjacent to the code block list tab 74 for selecting the code block list panel 70. Yes. The programming support function unit 15 reads the code block name data, the description data, and the programming language identification data stored in the code block file 122 and displays the list in the code block list display area 71.
[0029]
In this state, the programming support function unit 15 waits until the end button 73 is operated as ST12, the insert button 72 is operated as ST13, or the class tree tab 81 is selected as ST14. If it is detected that the end button 73 has been operated, the programming support function unit 15 deletes the block insertion wizard dialog box 7 on the display unit 3 in ST24 and ends this process.
[0030]
When detecting that the insert button 72 is operated in ST13, the programming support function unit 15 selects any one of the code block names in the code block list displayed in the list display area 71 as ST15. Check if the code block name is selected. Here, when the code block name is not selected, the programming support function unit 15 ignores the operation of the insert button 72 and selects the end button 73 or the insert button 72 again or selects the class tree tab 81. Wait to be done.
[0031]
On the other hand, when one code block name is selected by the operation of the operation unit 2, the programming support function unit 15 executes a pointer position insertion process as ST16. When the language of the code block data specified by the selected code block name matches the language of the source program being developed in the programming basic function unit 11, the insertion processing is executed from the code block file 122. This is a process of reading and inserting at the position of the source program indicated by the pointer operated by the operation unit 2. The programming support function unit 15 waits until the end button 73 or the insert button 72 is operated again or the class tree tab 81 is selected when this insertion process is completed.
[0032]
When it is detected in ST14 that the class tree tab 81 has been selected, the programming support function unit 15 switches the contents of the block insertion wizard dialog box 7 to a class tree panel 80 having the layout shown in FIG. 10, for example, in ST17. . The class tree panel 80 includes at least a program name display area 82, a class name display area 83, a function name display area 84, an edit button 85, and an end button 86. In addition, a code block list tab 74 for selecting the code block list panel 70 hidden behind the class tree panel 80 is provided adjacent to the class tree tab 81. The programming support function unit 15 displays the program name (program name) stored in the program file 121 stored in the program folder 124 in the program display area 82 so as to be selectable (program selection means). Further, when one program name is selected from the program names displayed in the program name display area 82, the class name of each class constituting the source program of the program name can be selected in the class name display area 83. Display. Further, when one class name is selected from the class names displayed in the class name display area 83, all functions defined in the class with the class name are acquired (function acquisition means), and the function name is acquired. Is displayed in the function name display area 84.
[0033]
In this state, the programming support function unit 15 waits until the end button 86 is operated as ST18, the edit button 85 is operated as ST19, or the code block list tab 74 is selected as ST20. If it is detected that the end button 86 has been operated, the programming support function unit 15 erases the block insertion wizard dialog box 7 on the display unit 3 in ST24 and ends this process.
[0034]
When it is detected in ST19 that the edit button 85 has been operated, the programming support function unit 15 selects one of the program names displayed in the program name display area 82 as ST21, and ST22. It is confirmed that one of the class names displayed in the class name display area 83 is selected. Here, when at least one of the program name and the class name is not selected, the programming support function unit 15 ignores the operation of the edit button 85 and either the end button 86 or the edit button 85 is operated again, or the code Wait for the block list tab 74 to be selected.
[0035]
When it is confirmed that the program name and the class name are selected, the programming support function unit 15 executes a function insertion process described later as ST23. When the function insertion process is completed, the programming support function unit 15 waits until the end button 86 or the edit button 85 is operated again or the code block list tab 74 is selected.
[0036]
If it is detected in ST20 that the code block list tab 74 has been selected, the programming support function unit 15 returns to ST11 and switches the contents of the block insertion wizard dialog box 7 to the code block list panel 70. Then, it waits until the end button 73 or the insert button 72 is operated or the class tree tab 81 is selected.
[0037]
FIG. 7 is a flowchart specifically showing the procedure of the function insertion process of ST23 in FIG. That is, when entering the function insertion process, the programming support function unit 15 first displays, for example, the layout editing dialog box 9 shown in FIG. The edit dialog box 9 includes at least a class name display area 91, a code block name display area 92, an explanation data display area 93, a function name display area 94, and an edit target list display area 95 including a function name and a code block name. An add button 96, an OK button 97, and a cancel button 98 are provided. In addition, the edit target list display area 95 is provided with list edit buttons such as an up button 951, a down button 952, and a delete button 953. The programming support function unit 15 displays the class name selected on the class tree panel 80 in the class name display area 91. Further, all the function names defined in the class of the selected class name are displayed in the function name display area 94 so as to be selectable (function specifying means). Further, the code block name of each code block data registered in the code block file 122 can be pulled down in the code block name display area 92, and the head code block name is displayed as a default. Then, explanation data corresponding to the code block data of the code block name displayed in the code block name display area 92 is displayed in the explanation data display area 93.
[0038]
Next, the programming support function unit 15 selects one of the code block names from the code block name displayed as a pull-down display in the code block name display area 92 as ST32, or operates the add button 96 as ST33. The process waits until the list edit buttons 951 to 953 are operated as ST34, the OK button 97 is operated as ST35, or the cancel button 98 is operated as ST36.
[0039]
If it is detected that a code block name has been selected, the programming support function unit 15 reads out the explanation data corresponding to the selected code block name from the code block file 122 in ST37 and displays the explanation data. It is displayed in the area 93. Thereafter, the code block name selection or the operation standby state of each button 951 to 953, 96, 97, 98 is returned.
[0040]
If it is detected in ST33 that the add button 96 has been operated, the programming support function unit 15 selects any one function name from the function names displayed in the function name display area 94 as ST38. It is judged whether it is done. If it is not selected, the operation of the add button 96 is ignored, and the code block name selection or the operation standby state of the buttons 951 to 953, 96, 97, 98 is returned.
[0041]
On the other hand, if any one function name is selected, the programming support function unit 15 stores the selected function name and code block name in the editing target list file 123 as ST39. At this time, the function name and the code block name are stored in correspondence with the minimum order data among the free order data in the edit target list file 123 (accumulating means). Thereafter, the code block name selection or the operation standby state of each button 951 to 953, 96, 97, 98 is returned.
[0042]
When it is detected in ST34 that the list edit buttons 151 to 153 have been operated, the programming support function unit 15 selects among the edit target data displayed in the edit target list display area 95 as ST40 (FIG. 8). It is determined whether any one of the data is selected. If not selected, the operation of the list edit buttons 151 to 153 is ignored, and the code block name selection or the operation standby state of each button 951 to 953, 96, 97, 98 is returned.
[0043]
On the other hand, when any one of the data to be edited (function name, code block name) is selected, the programming support function unit 15 determines the list edit button operated as ST41. Here, when the operation button is the up button 951, the programming support function unit 15 shifts the editing target data selected as ST42 so that it is positioned at the top of the editing target list file 123, and edits the editing target data. The list display in the list display area 95 is updated (accumulation order changing means). When the operation button is the down button 952, the programming support function unit 15 shifts the editing target data selected as ST43 so that it is located at the end of the editing target list file 123 and edits the editing target data. The list display in the list display area 95 is updated (accumulation order changing means). If the operation button is the delete button 953, the programming support function unit 15 deletes the edit target data selected as ST44 from the edit target list file 123 and displays the list in the edit target list display area 95. Update. Thereafter, the programming support function unit 15 returns to the state of selecting a code block name or waiting for the operation of the buttons 951 to 953, 96, 97, 98.
[0044]
When it is detected in ST35 that the OK button 35 has been operated, the programming support function unit 15 determines whether or not editing target data is stored in the editing target list file 123 in ST45. If the data to be edited is not stored, the operation of the OK button is ignored, and the code block name selection or the operation standby state of each button 951 to 953, 96, 97, 98 is returned.
[0045]
On the other hand, when the data to be edited is stored, the programming support function unit 15 edits the source program having the program name selected on the program name display area 82 of the class tree panel 80 as ST46. The code block data specified by the code block name is inserted into the argument description area of the function specified by the function name of the target data. Specifically, first, the first edit target data is read from the edit target list file 123. Next, it is checked whether or not the language of the code block data specified by the read code block name of the data to be edited matches the language of the source program. If the languages match, the code block data is read from the code block file 122, the function specified by the function name of the data to be edited is extracted from the source program, and the argument description area of the function Code block data is inserted (code insertion means). If the language does not match, the code block data is not inserted. Thereafter, the above processing is repeated every time the edit target data is read from the edit target list file 123.
[0046]
When the above processing is executed for all the editing target data stored in the editing target list file 123, the programming support function unit 15 clears the editing target list file 123 as ST47. If the edit dialog box 9 is deleted in ST48, the function insertion process is terminated. Here, the OK button 97 in the edit dialog box 9 functions as an insertion instruction means.
[0047]
If it is detected in ST36 that the cancel button 98 has been operated, the programming support function unit 15 clears the editing target list file 123 at that time and deletes the editing dialog box 9 to perform this function insertion processing. Exit.
[0048]
In the present embodiment configured as described above, when a programming operator finds a reusable source code as a function argument or the like, for example, in the stage of developing a source program, it is converted into code block data. Are registered in the code block file 122 as appropriate.
[0049]
That is, the programming operator operates the operation unit 2 to instruct the programming device main body 1 to execute the code block registration work. Then, since the code block registration dialog box 6 shown in FIG. 5 is displayed on the display unit 3, the programming operator operates the operation unit 2 to enter desired areas in the input areas 61 to 63 of the dialog box 6, respectively. Enter the code block name, description, and code block data. Further, the language of the code block data is designated from the language selection area 44. Thereafter, the OK button 65 is operated. Thus, the code block data is registered in the code block file 122 together with the explanation data, the code block name data, and the language data.
[0050]
When the programming operator determines that the code block data (source code) registered in the code block file 122 can be used during the development of the source program, the programming operator operates the operation unit 2 to operate the code block. Directs execution of the insert job. Then, since the code block list panel 70 of the insertion wizard dialog box 7 shown in FIG. 9 is displayed on the display unit 3, the programming operator inserts code block data into the source program by function designation or by manual designation. Decide whether to insert. After selecting the source program to be inserted by manual designation, the insertion position of this source program is indicated by the mouse pointer. Thereafter, the code block name of the code block data to be inserted at that position is selected from the code block list display area 71 and the insert button 72 is operated. By doing so, the code block data of the selected code block name is inserted at the position designated by the mouse pointer of the source program.
[0051]
On the other hand, when inserting by function specification, the programming operator operates the class tree tab 81. Then, as shown in FIG. 10, the contents of the block insertion wizard dialog box 7 are switched to the class tree panel 80, and the program name list of the source program under development is displayed in the program name display area 82. Then, the operation unit 2 is operated to select the program name of the code block data insertion target program. Then, since a class name list of classes constituting the source program to which the program name is set is displayed in the class name display area 83, the programming operator operates the operation unit 2 to select the code block data insertion target class. Select a class name. Then, since the function name list of the function described in the class of this class name is displayed in the function name display area 84, it is confirmed that there is a function having the code block data as an argument. Then, if confirmed, the edit button 85 is operated.
[0052]
As a result, an edit dialog box 9 shown in FIG. Therefore, the programming operator selects the code block name of the code block data to be inserted from the code block name display area 92. Further, one function name of the function describing the code block data as an argument is selected from the function name display area 94. Then, the add button 96 is operated. Then, the function name and code block name are stored first in the editing target list file 123, and the contents are displayed in the editing target list display area 95.
[0053]
Here, when using the same code block data as an argument of another function, the programming operator selects the corresponding function name from the function name display area 94 and operates the add button 96. As a result, the function name and the code block name are stored second in the editing target list file 123, and the contents are displayed in the editing target list display area 95.
[0054]
When other code block data is also inserted, the programming operator may repeat the code block name selection operation and the function name selection operation.
[0055]
For example, as shown in FIG. 11, the code block data with the code block name “DBAccess04” is inserted into the function with the function name “Page_Load”, and the same code is applied to the function with the function name “OnInit”. Assume that an instruction to insert block data is given. The source program selected as the insertion target is assumed to have the contents shown in FIG.
[0056]
When the programming operator operates the OK button 97 in the edit dialog box 9 in this state, an argument description area (“{” to “4” on the second line) for the function “Page_Load” on the first line in the source program is displayed. } ”) And the argument description area for the function“ OnInit ”on the fifth line (the area from“ {”to“} ”on the bottom line) on the sixth line, the code of the code block name“ DBAccess04 ” The block data 100 is inserted, and the source program has the contents shown in FIG.
[0057]
As described above, according to the present embodiment, by registering reusable source code as a function argument in advance, the source code can be placed in the correct position without specifying the insertion position for the source program. Can be inserted into. Therefore, it is not necessary to write the source code having the same contents over and over without burdening the programming operator, so that the program can be developed more efficiently.
[0058]
In the above embodiment, the present invention has been described as an object-oriented programming support technique. However, the present invention can also be applied to a non-object-oriented program development support technique.
[0059]
In the above embodiment, the code block registration function 152 has been described as one function of the programming support program. However, the code block registration function 152 may be functioned by a program different from the programming support program.
[0060]
【The invention's effect】
As described above in detail, according to the present invention, if the source code can be a function argument, the desired source code can be inserted at the correct position without specifying the insertion position for the source program. It is possible to provide a programming support apparatus and method and a programming support program that can efficiently develop a program while reducing the burden on a programming operator.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a main configuration of a programming device according to an embodiment of the present invention.
FIG. 2 is a schematic diagram showing a data structure of a code block file formed in a storage unit of the programming device.
FIG. 3 is a schematic diagram showing a data structure of an editing target list file formed in a storage unit of the programming device.
FIG. 4 is a flowchart showing a main processing procedure of a code block registration function controlled by a programming support function unit of the programming apparatus.
FIG. 5 is a schematic diagram showing an example of a code block registration dialog box displayed on the display unit of the programming device.
FIG. 6 is a flowchart showing a main processing procedure of a code block insertion function controlled by a programming support function unit of the programming apparatus.
7 is a flowchart specifically showing function insertion processing in FIG. 6. FIG.
8 is a flowchart specifically showing processing after a list edit button is input in FIG. 7;
FIG. 9 is a schematic diagram showing an example of a code block panel of a block insertion wizard displayed on the display unit of the programming device.
FIG. 10 is a schematic diagram showing an example of a class tree panel of a block insertion wizard displayed on the display unit of the programming device.
FIG. 11 is a schematic diagram showing an example of a class tree editing dialog box displayed on the display unit of the programming device.
FIG. 12 is a diagram showing an example of a source program before code block data is inserted.
FIG. 13 is a diagram showing an example of a source program after insertion of code block data.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Programming device main body, 2 ... Operation part, 3 ... Display part, 11 ... Programming basic function part, 12 ... Memory | storage part, 121 ... Program file, 122 ... Code block file, 123 ... Editing object list file, 13 ... Input / output Interface unit, 14 ... communication control unit, 15 ... programming support function unit, 151 ... file management function, 152 ... code block registration function, 153 ... code block insertion function.

Claims (5)

所定のプログラミング言語によって記述されるソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを記憶するコード記憶手段と、
このコード記憶手段に記憶されたソースコードを利用してプログラミングを行なうソースプログラムを選択させるプログラム選択手段と、
このプログラム選択手段により選択されたソースプログラムに存在する関数を取得する関数取得手段と、
この関数取得手段により取得した関数群の中から前記ソースコードを引数とする関数を指定させる関数指定手段と、
この関数指定手段により指定された関数を前記ソースプログラムから抽出し、この関数に対する引数として前記コード記憶手段により記憶されたソースコードを前記ソースプログラムに挿入するコード挿入手段と、
を具備したことを特徴とするプログラミング支援装置。
Code storage means for storing source code described in the same language as the source program described in a predetermined programming language and capable of being an argument of a function prepared in advance for the programming language;
Program selection means for selecting a source program to be programmed using the source code stored in the code storage means;
Function acquisition means for acquiring a function existing in the source program selected by the program selection means;
A function designating unit for designating a function having the source code as an argument from the function group obtained by the function obtaining unit;
Code insertion means for extracting the function designated by the function designation means from the source program and inserting the source code stored by the code storage means as an argument to the function into the source program;
A programming support apparatus comprising:
前記コード挿入手段は、前記関数指定手段により関数が指定される毎にその関数を前記ソースコードの識別名とともに蓄積する蓄積手段と、挿入指示手段と、この挿入指示手段により前記ソースコードの挿入が指示されると、蓄積された識別名によって識別されるソースコードを前記コード記憶手段から順次読出すとともに、その識別名に対応する関数を前記ソースプログラムから抽出し、この関数に対する引数として前記コード記憶手段から読み出したソースコードを前記ソースプログラムに挿入する手段とからなることを特徴とする請求項1記載のプログラミング支援装置。The code insertion means includes a storage means for storing the function together with an identification name of the source code every time a function is designated by the function designation means, an insertion instruction means, and the insertion instruction means inserts the source code. When instructed, the source code identified by the accumulated identification name is sequentially read out from the code storage means, and a function corresponding to the identification name is extracted from the source program, and the code storage is used as an argument for the function. 2. A programming support apparatus according to claim 1, further comprising means for inserting source code read from said means into said source program. 前記コード挿入手段は、前記蓄積手段により蓄積される関数と識別名の蓄積順序を変更する蓄積順序変更手段をさらに具備したことを特徴とする請求項2記載のプログラミング支援装置。3. The programming support apparatus according to claim 2, wherein the code insertion means further comprises storage order changing means for changing a storage order of functions and identification names stored by the storage means. 所定のプログラミング言語によって記述されるソースプログラムの開発を支援する方法であって、
前記ソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを予め記憶しておき、
前記ソースコードを利用してプログラミングを行なうソースプログラムを選択させるプログラム選択工程と、
選択されたソースプログラムに存在する関数を取得する関数取得工程と、
この関数取得工程で取得した関数群の中から前記ソースコードを引数とする関数を指定させる関数指定工程と、
この関数指定工程で指定された関数を前記ソースプログラムから抽出し、この関数に対する引数として予め記憶された前記ソースコードを当該ソースプログラムに挿入するコード挿入工程と、
を実行することを特徴とするプログラミング支援方法。
A method for supporting the development of a source program written in a predetermined programming language,
A source code that is described in the same language as the source program and can be an argument of a function prepared in advance for the programming language is stored in advance.
A program selection step of selecting a source program to be programmed using the source code;
A function acquisition step of acquiring a function existing in the selected source program;
A function designating step for designating a function having the source code as an argument from the function group obtained in the function obtaining step;
A code insertion step of extracting the function designated in the function designation step from the source program and inserting the source code stored in advance as an argument to the function into the source program;
A programming support method comprising:
所定のプログラミング言語によって記述されるソースプログラムを開発するコンピュータに、
前記ソースプログラムと同一の言語で記述され、当該プログラミング言語に対して予め用意された関数の引数となり得るソースコードを記憶する機能と、
前記ソースコードを利用してプログラミングを行なうソースプログラムを選択させる機能と、
選択されたソースプログラムに存在する関数を取得する機能と、
取得した関数群の中から前記ソースコードを引数とする関数を指定させる機能と、
指定された関数を前記ソースプログラムから抽出し、この関数に対する引数として予め記憶された前記ソースコードを当該ソースプログラムに挿入する機能と、
を実現させることを特徴とするプログラミング支援プログラム。
To a computer that develops a source program written in a predetermined programming language,
A function for storing source code that is described in the same language as the source program and can be an argument of a function prepared in advance for the programming language;
A function of selecting a source program to be programmed using the source code;
A function to obtain a function existing in the selected source program;
A function to specify a function having the source code as an argument from the obtained function group;
A function of extracting a specified function from the source program and inserting the source code stored in advance as an argument to the function into the source program;
A programming support program characterized by realizing
JP2003183077A 2003-06-26 2003-06-26 Programming support device and method, and programming support program Pending JP2005018458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003183077A JP2005018458A (en) 2003-06-26 2003-06-26 Programming support device and method, and programming support program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003183077A JP2005018458A (en) 2003-06-26 2003-06-26 Programming support device and method, and programming support program

Publications (1)

Publication Number Publication Date
JP2005018458A true JP2005018458A (en) 2005-01-20

Family

ID=34183280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003183077A Pending JP2005018458A (en) 2003-06-26 2003-06-26 Programming support device and method, and programming support program

Country Status (1)

Country Link
JP (1) JP2005018458A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101462062B1 (en) * 2013-05-03 2014-11-17 에스케이 텔레콤주식회사 Apparatus for Providing Content Aggregation, Computer-Readable Recording Medium with Program Therefore

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101462062B1 (en) * 2013-05-03 2014-11-17 에스케이 텔레콤주식회사 Apparatus for Providing Content Aggregation, Computer-Readable Recording Medium with Program Therefore

Similar Documents

Publication Publication Date Title
JP4796297B2 (en) Web page authoring apparatus, web page authoring method and program
JP2017156953A (en) Automatic installation system, management device, information processing device, management device control method, information processing device control method and program
US6922807B1 (en) Object editing apparatus and method, and recording medium storing computer-readable program
JP2007115131A (en) Information processor and its control method, information processing system, computer program, and storage medium
JP2005018458A (en) Programming support device and method, and programming support program
JP2001014152A (en) Method and device for data processing, and storage medium
JP2006195964A (en) Information processor, information processing method, and control program
JP2007115132A (en) Information processor and its control method, information processing system, computer program and storage medium
JP2005018459A (en) Programming supporting device, its method and programming support program
JPH09237181A (en) Application developing device and application developing method
JP2000181650A (en) Data processor, driver installing method for data processor and storage medium with readable program by computer stored therein
JP2005025263A (en) Programming support device, method and program
JP3458421B2 (en) Document processing system
JP6905111B2 (en) Systems including management devices and information processing devices, information processing devices, their control methods, and programs
JP2000194514A (en) Document processor and storage medium
JP2004078374A (en) Information processing apparatus, business form processing method, computer-readable storage medium, and program
JP2000172681A (en) Document processor, data processing method for the same and computer-readable storage medium with program stored therein
JP3019730B2 (en) Maintenance information management device
JP2000163231A (en) Data processor, driver processing method for data processor and storage medium with program readable by computer stored therein
JPH0816555A (en) Device and method for processing document
JP2000011194A (en) Device for editing graphic and method for processing graphic data of the same and storage medium for storing computer readable program
JPH10133862A (en) Information processor and information processing method
JP2007164321A (en) Document editing device, document editing method, storage medium and program
JP5003237B2 (en) Manual revision program
JP2005165456A (en) Device and program for shaping display log

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070828

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080226