JPH03223930A - Support system for generation of source - Google Patents

Support system for generation of source

Info

Publication number
JPH03223930A
JPH03223930A JP1852590A JP1852590A JPH03223930A JP H03223930 A JPH03223930 A JP H03223930A JP 1852590 A JP1852590 A JP 1852590A JP 1852590 A JP1852590 A JP 1852590A JP H03223930 A JPH03223930 A JP H03223930A
Authority
JP
Japan
Prior art keywords
chart
source code
source
skeleton
change
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
JP1852590A
Other languages
Japanese (ja)
Inventor
Kazuhiko Senda
仙田 和彦
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 Corp
Original Assignee
Toshiba 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 Corp filed Critical Toshiba Corp
Priority to JP1852590A priority Critical patent/JPH03223930A/en
Publication of JPH03223930A publication Critical patent/JPH03223930A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE:To effectively produce a source code after the change of a chart by reflecting the information on an existing source code corresponding to an unchanged control structure part to the corresponding structure of a skelton obtained after the change of the chart. CONSTITUTION:When a changed chart is inputted to a source generating means 12, a skelton is produced in response to the changed chart. This skelton has its control structure including a part equal to an existing source code corresponding to an unchanged chart. In addition, a newly added structure may possibly be included in the skelton together with a structure included in the existing source code. Thus a source generation support means 15 sorts these structures based on the skelton obtained after the change of a chart and the existing source code. Then the means 15 reflects the detailed information on the corresponding structure part of the existing source code to an unchanged structure part. Thus a source code is effectively produced in response to the change of a program.

Description

【発明の詳細な説明】 [発明の目的コ (産業上の利用分野) この発明は、作成すべきプログラムの処理の流れを示す
チャートをソースコードに変換してプログラム(ソース
プログラム)を作成するシステムに係り、特にプログラ
ム変更(チャート変更)が発生した場合にチャートから
効率よくソースコ−ド(ソースプログラム)を生成する
のに好適なソース生成支援システムに関する。
[Detailed Description of the Invention] [Purpose of the Invention (Industrial Application Field) This invention provides a system for creating a program (source program) by converting a chart showing the processing flow of a program to be created into source code. In particular, the present invention relates to a source generation support system suitable for efficiently generating source code (source program) from a chart when a program change (chart change) occurs.

(従来の技術) 一般に、プログラムを新規作成する場合には、そのプロ
グラムの処理の流れを示すチャートを、所望の言語で記
述されたソースコードに変換するツール(ソース生成手
段)を使って、チャートから対応するプログラムのソー
スコードの骨格を成すテンプレートソース(以下、スケ
ルトンと称する)を自動生成する。このスケルトンは、
対応するプログラムの制御構造を示すもので、プログラ
ムの構造や制御を示すif、while、および、構造
に対応した注釈文としてのコメント(このようなコメン
トを、プログラムにおける通常の文の説明用のコメント
と区別するために、構造コメントと呼ぶ)などで構成さ
れており、変数宣言や処理文(条件式、代入文など)を
含まない。上記したスケルトンを自動生成すると、この
スケルトンに変数宣言や処理文を手作業で反映すること
で、目的とするプログラムのソースコードを作成する。
(Prior Art) Generally, when creating a new program, a chart showing the process flow of the program is converted using a tool (source generation means) that converts it into source code written in a desired language. A template source (hereinafter referred to as a skeleton) that forms the skeleton of the source code of the corresponding program is automatically generated from the source code. This skeleton is
It indicates the control structure of the corresponding program, including if and while indicating the structure and control of the program, and comments as annotation statements corresponding to the structure (such comments are used as comments for explaining normal statements in the program). It consists of comments (called "structural comments" to distinguish them from the "comments"), and does not include variable declarations or processing statements (conditional expressions, assignment statements, etc.). Once the above-mentioned skeleton is automatically generated, the source code of the target program is created by manually reflecting variable declarations and processing statements in this skeleton.

さて従来は、作成したプログラムに変更の必要性が生じ
た場合には、対応する既存のチャートを編集してチャー
ト変更を行う。次にソース生成手段を用いて、変更後の
チャートから新たなスケルトンを自動生成する。そして
、新たなスケルトンに変数宣言や処理文を手作業で反映
することで、変更後のプログラムのソースコードを作成
する。
Conventionally, when a created program needs to be changed, the corresponding existing chart is edited and the chart is changed. Next, a new skeleton is automatically generated from the changed chart using the source generation means. Then, by manually reflecting the variable declarations and processing statements in the new skeleton, the source code of the modified program is created.

しかし、チャート変更後に、その変更したチャートから
スケルトンを自動生成すると、変更がなかったソースコ
ード部分(変数宣言や処理文など)まで失われて、再び
変数宣言や処理文などを手作業で再入力しなければなら
ず、しかも変更がなかった箇所についても再試験が必要
になるという問題がある。そして、これらの再入力、再
試験に費やす時間は、プログラム変更の回を増す度に増
えていく。
However, if you automatically generate a skeleton from the changed chart after changing the chart, the source code parts that have not changed (variable declarations, processing statements, etc.) will be lost, and you will have to manually re-enter the variable declarations and processing statements. However, there is a problem in that re-examination is required even for parts that have not been changed. The time spent re-entering and re-testing increases each time the program is changed.

(発明が解決しようとする課題) 上記したように従来は、プログラムの変更が発生した場
合に、チャートを変更し、この変更したチャートを用い
てスケルトンを自動生成すると、変更がなかったソース
コード部分まで失われるために、スケルトンからソース
コードを生成する際に、再び変数宣言や処理文などを手
作業で再入力しなければならず、該当箇所の再試験も必
要となるという問題があった。
(Problem to be Solved by the Invention) As described above, conventionally, when a program change occurs, if a chart is changed and a skeleton is automatically generated using this changed chart, parts of the source code that have not changed are When generating source code from the skeleton, variable declarations, processing statements, etc. must be manually re-entered, and the relevant parts must be retested.

この発明は上記事情に鑑みてなされたものでその目的は
、プログラム変更が発生した場合に、変更のない既存ソ
ースコード部分を利用して変更後のチャートから変更後
のソースコードを効率よく生成できるソース生成支援シ
ステムを提供することにある。
This invention was made in view of the above circumstances, and its purpose is to efficiently generate a changed source code from a changed chart by using the existing source code portion that has not been changed when a program change occurs. The purpose is to provide a source generation support system.

[発明の構成コ (課題を解決するための手段) この発明は、作成すべきプログラムの処理の流れを示す
チャートをもとに、ソースコードの骨格を成すテンプレ
ートソース(スケルトン)を生成するソース生成手段と
、プログラム変更のためのチャート変更後に、この変更
されたチャートに対応してソース生成手段により生成さ
れる新たなスケルトンと変更前のチャートに対応する既
存のソースコードをもとに構造コメントを含めて相違点
(変更箇所)のない制御構造を検出し、上記新たなスケ
ルトンの該当制御構造に既存ソースコードの該当制御構
造中の情報を反映させてチャート変更後のソースコード
を生成するソース生成支援手段とを設けたことを特徴と
する。また、この発明は、上記したソース生成支援手段
を、既存のソースコードから同ソースコードに対応する
スケルトンを生成(再生)する手段と、この生成したス
ケルトンと上記変更されたチャートに対応する新たなス
ケルトンとを比較する手段とを用いて構成し、両スケル
トンの比較結果により上記した相違点のない制御構造を
検出するようにしている。
[Structure of the Invention (Means for Solving the Problem) This invention is a source generation method that generates a template source (skeleton) that forms the backbone of a source code based on a chart showing the flow of processing of a program to be created. After the chart is changed for program change, a new skeleton is generated by the source generation means corresponding to the changed chart, and structural comments are added based on the existing source code corresponding to the chart before the change. Source generation that detects a control structure that does not have any differences (changes), and reflects the information in the corresponding control structure of the existing source code to the corresponding control structure of the new skeleton to generate the source code after the chart has been changed. It is characterized by providing support means. The present invention also provides a means for generating (reproducing) a skeleton corresponding to an existing source code from an existing source code, and a new method corresponding to the generated skeleton and the above-mentioned changed chart. A control structure having no differences as described above is detected based on the comparison result of both skeletons.

(作用) 上記の構成によれば、プログラム変更のために変更され
たチャート(変更後チャート)をソース生成手段に入力
することにより、変更後チャートに対応するチャート変
更後スケルトン(テンプレートソース)が生成される。
(Operation) According to the above configuration, by inputting a chart changed due to a program change (changed chart) to the source generation means, a chart changed skeleton (template source) corresponding to the changed chart is generated. be done.

このチャート変更後スケルトンには、その制御構造に関
して、変更前のチャートに対応する既存のソースコード
と同一部分を成す構造(未変更の構造)が存在する。
Regarding its control structure, this skeleton after chart change has a structure (unchanged structure) that is the same part as the existing source code corresponding to the chart before change.

また新たに追加された構造も存在する可能性もある。更
に、既存のソースコードにのみ存在する構造、即ちチャ
ート変更により削除された構造もあり得る。そこで、チ
ャート変更後スケルトンと既存のソースコードをもとに
、ソース生成支援手段により上記のような分類をし、未
変更の構造部分には、既存ソースコードの該当する構造
部分の詳細情報を反映させてチャート変更後のソースコ
ードを生成することにより、未変更構造部分にも手作業
で詳細情報を編集入力していた従来システムに比べて、
プログラム変更に伴うソースコードの生成が効率的に行
える。
There is also a possibility that there are newly added structures. Furthermore, there may be structures that exist only in existing source code, ie, structures that have been deleted due to chart changes. Therefore, based on the skeleton after changing the chart and the existing source code, the source generation support means is used to classify it as described above, and the unchanged structural parts are reflected in the detailed information of the corresponding structural parts of the existing source code. By doing so and generating the source code after changing the chart, compared to the conventional system where detailed information was manually edited and entered even in the unchanged structure part,
Source code can be efficiently generated in response to program changes.

(実施例) 以下、この発明の一実施例を図面を参照して説明する。(Example) An embodiment of the present invention will be described below with reference to the drawings.

第1図はプログラム変更のために変更が施されたチャー
ト(チャート情報)から既存のソースコードを利用して
新たなソースコードを生成するためのソース生成支援シ
ステムのブロック構成図、第2図はチャートからソース
コードを生成するためのソース生成システムのブロック
構成図である。
Figure 1 is a block diagram of a source generation support system that uses existing source code to generate new source code from charts (chart information) that have been changed due to program changes, and Figure 2 is FIG. 1 is a block configuration diagram of a source generation system for generating source code from a chart.

第2図において、21は新規に作成すべきプログラムの
処理の流れを示すチャートの情報(チャート情報)、2
2はチャート情報21をプログラム作成者の指定する言
語で記述されたソースコードに変換するツールとしての
ソース生成手段である。
In FIG. 2, 21 is chart information (chart information) indicating the process flow of a newly created program;
Reference numeral 2 denotes a source generation means as a tool for converting chart information 21 into source code written in a language specified by a program creator.

チャート情報21は、変数aの値が上限値RH以上であ
るか否かの条件判定によりリミットフラグ1 imi 
tをオン(“]”に設定)する処理手順を含むC言語の
プログラムのチャートを示すものとする。このチャート
の一部を第3図に示す。チャート情報21を用いてプロ
グラムを新規作成するには、まずチャート情報21を第
2図のシステムのソース生成手段22に入力し、同ソー
ス生成手段22を用いることでスケルトン(テンプレー
トソース)23を自動生成する。
The chart information 21 sets a limit flag 1 imi based on a conditional determination as to whether the value of the variable a is greater than or equal to the upper limit value RH.
Assume that a chart of a C language program including a processing procedure for turning on (setting t to "]") is shown. A part of this chart is shown in FIG. To create a new program using the chart information 21, first input the chart information 21 into the source generation means 22 of the system shown in FIG. generate.

スケルトン23は対応するプログラムの制御構造を表わ
すもので、第4図にその一部を示すように、if文の制
御構造“1f()fl if文の構造を示す説明文としての構造コメント(符号
41で示される点線枠で囲まれた“/**レンジオーバ
**/“の部分)、および処理文(代人文)の構造を示
す説明文としての構造コメント(符号42で示される点
線枠で囲まれた“/**フラグオン**/”の部分)は
含むものの、変数宣言や処理文(ここでは、条件式“a
>=RH”代入文“1 imi t=1” )などの詳
細情報は含まない。C言語での制御構造(構造文)とし
ては、上記のif文の他に、while文、for文、
s w i t c h −c a s e文、do−
while文、goto、break、continu
e文などがある。例えばif文であれば、if()。
The skeleton 23 represents the control structure of the corresponding program, and as shown in part in FIG. The "/**Range Over**/" part surrounded by the dotted line frame indicated by 41, and the structural comment as an explanatory text indicating the structure of the processed sentence (proxy human text) (the part indicated by the dotted line frame indicated by 42) The enclosed "/**flag on**/" part) is included, but variable declarations and processing statements (here, the conditional expression "a") are included.
>=RH" assignment statement "1 imit=1"). In addition to the above if statement, control structures (structural statements) in the C language include while statements, for statements,
switch -c a se sentence, do-
while statement, goto, break, continue
There are e-sentences, etc. For example, for an if statement, if().

elseなどがそれぞれ構造の一部を表わす。また (
)″を用いて複数の文を表現する場合には、  (″お
よび“)“が構造の一部となる。また本実施例では、上
記の各構造文に加えて、関数呼出し、代人文(フローチ
ャートで処理として1つのボックスで表わす範囲)も1
つの構造として扱うようにしている。なお第4図では、
スケルトン情報の行No、が5から始まっているが、こ
れはスケルトン23の一部しか示されていないためであ
り、一般には1から始まる。
Else etc. each represent a part of the structure. Also (
)” to express multiple sentences, (″ and “)” become part of the structure. In addition, in this embodiment, in addition to each of the above-mentioned structural statements, function calls and proxy statements (range represented by one box as a process in a flowchart) are also included.
I try to treat it as one structure. In addition, in Figure 4,
The row number of the skeleton information starts from 5, but this is because only a part of the skeleton 23 is shown, and generally starts from 1.

さて、C言語等においては、コメントは一般に“/*“
と“*/”とで囲むことにより記述される。そこで本実
施例では、構造コメント、即ちプログラムの制御構造に
対応した注釈文としてのコメントを、プログラムにおけ
る通常の文の説明用のコメントと区別するために、コメ
ント(実コメント)の先頭と末尾に(/*および*/の
*とは別に)*を付すようにしている。このコメントの
先頭と末尾に付された*はプログラム処理上では、コメ
ントの一部として扱われ、したがって上記の例では、“
*レンジオーバ*“と“*フラグオン*″とがコメント
として扱われ、C言語の文法上での問題はない。
Now, in C language etc., comments are generally "/*"
It is written by surrounding it with "*/". Therefore, in this embodiment, in order to distinguish structural comments, that is, comments that serve as annotation sentences corresponding to the control structure of a program, from comments that explain normal statements in a program, (separately from /* and */). The * added at the beginning and end of this comment are treated as part of the comment during program processing, so in the above example, “
*Range over*" and "*Flag on*" are treated as comments, and there is no problem with the syntax of the C language.

プログラム作成者は、ソース生成手段22を用いてチャ
ート情報21からスケルトン23を生成すると、編集手
段24を操作して、スケルトン23に対し 0 て宣言文、処理文などの詳細情報を手作業で編集する処
理を施し、目的とするソースコード(ソースプログラム
)25を完成する。ここでは、第4図に示すスケルトン
23に、第5図に示すように条件式“a>−RH”およ
び代入文“11m1t−1;  (符号51.52で示
される点線枠で囲まれた部分)を手作業で追加すること
により、ソースコード25が生成される。
After generating the skeleton 23 from the chart information 21 using the source generation means 22, the program creator operates the editing means 24 to manually edit detailed information such as declaration statements and processing statements for the skeleton 23. The target source code (source program) 25 is completed. Here, in the skeleton 23 shown in FIG. 4, the conditional expression "a>-RH" and the assignment statement "11m1t-1; ) is manually added to generate the source code 25.

上記のようにしてソースコード25を生成した後にプロ
グラム変更の必要性が生じると、プログラム作成者はチ
ャート変更(ステップの追加、削除)を行って変更後の
チャート情報(チャート変更後チャート情報)11(第
1図参照)を編集する。
When it becomes necessary to change the program after generating the source code 25 as described above, the program creator changes the chart (adding or deleting steps) and changes the chart information (chart information after chart change) 11. (See Figure 1).

このチャート変更後チャート情報11は、第3図に示す
チャート(のレンジオーバの条件判定ステップの直前)
に、第6図に示すように、符号61で示される点線枠で
囲まれたテスト実行の有無の条件判定ステップを追加し
てチャート変更を行うことにより得られたものとする。
This chart change chart information 11 is the chart shown in FIG. 3 (immediately before the step of determining the range over condition)
As shown in FIG. 6, it is assumed that the chart is obtained by adding a step of determining whether or not to execute a test, which is surrounded by a dotted line frame indicated by reference numeral 61, and changing the chart.

このチャート変更後チャート情報11を、第1図に示す
ソース生成支援1 ツールIO内のソース生成手段12(第2図のソース生
成手段22に相当)に入力することで、チャート変更後
チャート情報11からスケルトン(チャート変更後スケ
ルトン)13を自動生成する。このチャート変更後スケ
ルトン13は、第7図に示すように、チャート変更箇所
(追加したテスト実行の有無の条件判定ステップ)に対
応するif文の制御構造“if()+  1“および同
if文の説明文としての構造コメント“/**テスト実
行**/”(符号71.72で示される点線枠で囲まれ
た部分)が第4図のスケルトン23に追加された形とな
っている。
By inputting the chart information 11 after chart change into the source generation means 12 (corresponding to the source generation means 22 in FIG. 2) in the source generation support 1 tool IO shown in FIG. A skeleton (skeleton after chart change) 13 is automatically generated from. As shown in FIG. 7, the skeleton 13 after the chart change includes the control structure "if()+1" of the if statement corresponding to the chart change part (the step of determining the condition for whether or not to execute the added test) and the if statement. A structural comment "/**Test execution**/" (the part surrounded by the dotted line frame indicated by reference numerals 71 and 72) as an explanatory text has been added to the skeleton 23 in FIG.

さて従来は、上記したようにチャート変更後チャート情
報11から第7図に示すチャート変更後スケルトン13
を自動生成すると、このチャート変更後スケルトン13
に対して宣言文、処理文などを手作業で編集することに
より、チャート変更後チャート情報11に対応する新た
なソースコードを作成していた。しかし、この方式では
、変更前のチャート情報21に対応するソースコード2
5(これを、2 便宜上、既存ソースコード14と呼ぶ)のうち、変更の
なかった部分(ここでは、レンジオーバの条件判定ステ
ップに対応する条件式“a>−RH”およびフラグオン
の処理ステップの代入文”l imi t=1 ;”)
までが失われてしまう。
Now, conventionally, as described above, from the chart change chart information 11 to the chart change skeleton 13 shown in FIG.
When automatically generated, skeleton 13 after changing this chart
By manually editing declaration statements, processing statements, etc., a new source code corresponding to the chart information 11 after chart change was created. However, in this method, the source code 2 corresponding to the chart information 21 before the change is
5 (this will be referred to as the existing source code 14 for convenience), the parts that have not changed (here, the conditional expression "a>-RH" corresponding to the range over condition determination step and the flag-on processing step) are unchanged. Assignment statement “l imi t=1 ;”)
up to and including is lost.

そのためプログラム作成者は、先に述べたスケルトン2
3からソースコード25を作成する場合と同様にして、
上記した失われた部分を再入力しなければならず、煩雑
であった。そこで本実施例では、第1図に示すソース生
成支援ツールIOの中心を成すソース生成支援手段15
を用い、変更のなかった箇所を失うことなくチャート変
更後のソースコードを生成できるようにしている。この
ソース生成支援手段■5によるソースコード生成処理を
、第8図のフローチャートを参照して以下に説明する。
Therefore, the program creator needs to use the skeleton 2 mentioned earlier.
In the same way as when creating source code 25 from 3,
The lost portions mentioned above had to be re-entered, which was cumbersome. Therefore, in this embodiment, the source generation support means 15, which forms the center of the source generation support tool IO shown in FIG.
, it is possible to generate source code after chart changes without losing any parts that have not changed. The source code generation process by the source generation support means (5) will be explained below with reference to the flowchart of FIG.

まずソース生成支援手段15は、第8図ステップS1に
示すように、既存ソースコード14(第5図参照)を入
力して構造解析を行い、言語が持つ構造文(if文、w
hile文等)とチャート情報から生成された構造コメ
ントにより、既存ソー3 スコード14に対応するスケルトン16を再生する。
First, as shown in step S1 in FIG. 8, the source generation support means 15 inputs the existing source code 14 (see FIG. 5), performs structural analysis, and analyzes the structure sentences (if statements, w
A skeleton 16 corresponding to the existing source 3 code 14 is reproduced using the structure comment generated from the file (file statement, etc.) and chart information.

言換えれば、ソース生成支援手段15は、既存ソースコ
ード14から言語が持つ構造文の条件式、関数呼出し文
中の引数、通常のコメント(構造コメントを除くコメン
ト、即ち“/**   **/”の形態をとらないコメ
ント)、宣言文のある行(変数型言行)、更には代入文
のある行(ここでは、条件式“a>−RH”および代入
文“1 fmi を−1;”)を取除くことにより、既
存ソースコード14に対応する(ソース生成手段■2ま
たは22により作成されたような)スケルトン1Bを再
生する。
In other words, the source generation support means 15 extracts from the existing source code 14 conditional expressions of structural statements of the language, arguments in function call statements, and normal comments (comments other than structural comments, that is, "/** **/" ), lines with declaration statements (variable type lines), and lines with assignment statements (here, the conditional expression "a>-RH" and the assignment statement "1 fmi -1;") By removing , the skeleton 1B (as created by the source generation means 2 or 22) corresponding to the existing source code 14 is reproduced.

ソース生成手段12または22のソース生成処理でスケ
ルトンを生成する方法は、前記したスケルトン23(第
4図参照)の生成例から明らかなように予め定められて
いる。したがって、スケルトン(条件式、関数呼出し文
中の引数、通常のコメント等を含まないソースコード)
に手作業で実行文を補って完成されたソースコード(こ
こでは既存ソースコード14)であっても、同コードか
ら(ソース生成手段12または22により作成されたよ
うな)ス4 ケルトン(ここではスケルトン1B)を容易に再生する
ことができる。このようにして、ソース生成支援手段1
5の構造解析処理により再生されるスケルトン(再生ス
ケルトン)16は、既存ソースコド14がソースコード
(初回ソースコード)25に一致する本実施例では、第
4図に示されるスケルトン23に一致する。なお、プロ
グラムの解析方法はコンパイラの技術等で周知であるこ
とから、説明を省略する。
The method of generating a skeleton in the source generation process of the source generation means 12 or 22 is predetermined, as is clear from the above-described example of generation of the skeleton 23 (see FIG. 4). Therefore, the skeleton (source code that does not include conditional expressions, arguments in function calls, normal comments, etc.)
Even if the source code (here, the existing source code 14) is completed by manually adding executable statements to the source code, a skeleton (as created by the source generation means 12 or 22) from the same code (here, the existing source code 14) Skeleton 1B) can be easily reproduced. In this way, source generation support means 1
In this embodiment, where the existing source code 14 matches the source code (initial source code) 25, the skeleton (reproduced skeleton) 16 reproduced by the structure analysis process in step 5 matches the skeleton 23 shown in FIG. Note that the program analysis method is well known in compiler technology and the like, so the explanation will be omitted.

ソース生成支援手段15はスケルトン16を再生すると
、第9図に示すように、同スケルトン(再生スケルトン
)1Bが置かれるスケルトン部91と、このスケルトン
部91(上のスケルトン16)の各構造が既存ソースコ
ード14のどの部分に対応するかを示す情報が設定され
るソースコード対応部92を含んだソースコード作業フ
ァイル17を作成する(第8図ステップS2)。なお、
第9図の例では、ソースコードの各行が1つの構造を示
しているが、複数行が1つの構造を示すこともある。
When the source generation support means 15 reproduces the skeleton 16, as shown in FIG. A source code work file 17 is created that includes a source code correspondence section 92 in which information indicating which part of the source code 14 corresponds is set (step S2 in FIG. 8). In addition,
In the example of FIG. 9, each line of the source code represents one structure, but multiple lines may represent one structure.

次にソース生成支援手段15は、ソース生成手 5 段12によって作成されたチャート変更後スケルトン1
3(第7図参照)と、第8図ステップS2で作成したソ
ースコード作業ファイル17のスケルトン部91の内容
、即ち再生スケルトン16(第9図参照)とを、文字列
比較技術を用いて比較し、チャート変更後スケルトン1
3に存在する文字列で再生スケルトン16にも存在する
共通文字列(即ち変更されなかった部分)と、チャート
変更後スケルトン13にのみ存在する文字列(即ち追加
部分)と、再生スケルトン16にのみ存在する文字列(
即ち削除部分)とを検出する(第8図ステップ3)。な
お、チャート変更後スケルトン13および再生スケルト
ン1Bに共通に存在する文字列(第1の文字列と呼ぶ)
であっても、その第1の文字列を含む同文字列より長い
第2の文字列がチャート変更後スケルトン13および再
生スケルトン16に共通に存在する場合には、第1の文
字列は共通文字列として検出されず、結局節1の文字列
を含む最も長い第2の文字列が共通文字列として検出さ
れる。例えば、第7図に示すチャート変更後スケルトン
13および6 第9図に示す再生スケルトン16の場合では、チャート
変更後スケルトン13上の“1f()(/**テスト実
行**/”に含まれる“1f()(/**”と再生スケ
ルトン16上の“1f()(/**レンジオーバ**/
#に含まれる“if()  (/**”とは一致する。
Next, the source generation support means 15 generates the chart modified skeleton 1 created by the source generation means 5 stage 12.
3 (see FIG. 7) and the contents of the skeleton section 91 of the source code work file 17 created in step S2 of FIG. Then, after changing the chart, skeleton 1
Common character strings that exist in 3 and also exist in the reproduction skeleton 16 (i.e., the part that was not changed), character strings that exist only in the skeleton 13 after the chart change (i.e., the added part), and character strings that exist only in the reproduction skeleton 16 after the chart change Existing string (
That is, the deleted portion) is detected (step 3 in FIG. 8). Note that the character string that exists in common in the chart-changed skeleton 13 and the reproduced skeleton 1B (referred to as the first character string)
However, if a second character string that includes the first character string and is longer than the same character string exists in common in the chart-changed skeleton 13 and the regenerated skeleton 16, the first character string is a common character. The second character string, which is the longest and includes the character string of clause 1, is detected as a common character string. For example, in the case of the skeletons 13 and 16 after the chart change shown in FIG. 7 and the reproduced skeleton 16 shown in FIG. “1f()(/**” and “1f()(/**range over**/” on the playback skeleton 16
“if() (/**” included in # matches.

しかし、この−散文字列“if ()f/**”を含む
文字列″i f ()  (/**レンジオーバ**/
/**フラグオン**/)   も両スケルトン13.
18に共通に存在するため、後者の文字列が共通文字列
として検出される。勿論、上記した後者の文字列を含む
更に長い文字列が両スケルトン13.1.6に存在する
ならば、その文字列が共通文字列となる。
However, this - a string "if () (/** range over**/
/**Flag on**/) Both skeletons 13.
18, the latter character string is detected as a common character string. Of course, if a longer character string including the latter character string described above exists in both skeletons 13.1.6, that character string becomes the common character string.

以上のことから明らかなように、本実施例では、“if
 ()  (/**レンジオーバ**/”と“/**フ
ラグオン**/”と“)″との3つの構造から成る文字
列が共通文字列として検出される。またチャート変更後
スケルトン13上の’i f ()  (/**テスト
実行**/” と同スケルトン13上の“/**フラグ
オン**) “の次7 の文字“)  とが、チャート変更後スケルトン13に
のみ存在する文字列(文字)として検出される(第7図
および第9図参照)。
As is clear from the above, in this embodiment, “if
A string consisting of three structures: () (/**range over**/”, “/**flag on**/” and “)” is detected as a common string. Also, after changing the chart, skeleton 13 The above 'if () (/**Test execution**/'' and the 7th character after "/**Flag on**)" on the same skeleton 13 only exist in skeleton 13 after changing the chart. (See Figures 7 and 9).

さて、第8図ステップS3で用いられる文字列比較技術
は、米国AT&Tベル研究所で開発されたUNIXの“
diff”コマンド等で周知の技術である。ソース生成
支援手段15は、このような文字列比較技術を用いて上
記の検出を行うことで、チャート変更後スケルトン13
が元のスケルトン、すなわち再生スケルトン16(ここ
ではスケルトン23に一致)に対してどの部分が変更に
なっているかの相違点を示す相違点情報テーブル18を
作成する(第8図ステップS4)。この相違点情報テー
ブル18は、第10図に示すように、チャート変更後ス
ケルトン13が置かれるスケルトン部101と、同スケ
ルトン部101(上のチャート変更後スケルトン13)
の各構造が既存ソースコード14のどの部分に対応して
いるか或は対応部分がないかを示す情報が設定されるソ
ースコード対応部102とを含む。この相違点情報テー
ブル18内のスケルト8 ン部101の具体的な生成方法について以下に説明する
Now, the string comparison technology used in step S3 in Figure 8 is the UNIX "
This is a well-known technique such as "diff" command.The source generation support means 15 performs the above detection using such a character string comparison technique, thereby generating the skeleton 13 after chart change.
creates a difference information table 18 indicating which parts have been changed with respect to the original skeleton, that is, the reproduced skeleton 16 (corresponding to the skeleton 23 here) (step S4 in FIG. 8). As shown in FIG. 10, this difference information table 18 includes a skeleton part 101 in which the skeleton 13 after the chart change is placed, and the same skeleton part 101 (the skeleton 13 after the chart change above).
The source code corresponding section 102 is set with information indicating which part of the existing source code 14 each structure corresponds to or whether there is no corresponding part. A specific method for generating the skeleton section 101 in the difference information table 18 will be described below.

まず、第10図において符号104で示される行阻7〜
9の文字列、即ち“i f ()  (/**レンジオ
ーバ**/2と“/**フラグオン**”と“) との
3つの構造から成る文字列のように、チャート変更後ス
ケルトン13上に存在する文字列が再生スケルトン1B
(第9図参照)上にもある場合には、その文字列に対応
するソースコード作業ファイル17内ソースコード対応
部92の内容を例えば行単位で相違点情報テーブル18
のソースコード対応部102にコピーする。次に、第1
0図において符号108で示される行No、 6の文字
列″1f()(/**テスト実行**/”、または符号
103で示される行No、 10文字“)”のように、
チャート変更後スケルトン18にしかない文字列(文字
)の場合には、その文字列(文字)に対応するソースコ
ード対応部102の領域(開始行、終了行)に、未対応
を示す特定データ、例えば“−1″を設定する。最後に
、再生スケルトン16には存在するが、9 チャート変更後スケルトン13には存在しない文字列(
文字)、即ち元のチャートから削除された文字列(文字
)については(本実施例では、このケースはない)、相
違点情報テーブル18のソースコード対応部102には
反映しない。
First, in FIG.
9, that is, a string consisting of three structures: “if () (/**range over**/2, “/**flag on**” and “), the skeleton after changing the chart. The string existing on 13 is the reproduction skeleton 1B
(See FIG. 9) If the character string is also found above, the contents of the source code correspondence part 92 in the source code work file 17 corresponding to that character string are displayed in the difference information table 18, for example, line by line.
Copy it to the source code corresponding section 102 of. Next, the first
In Figure 0, the character string "1f()()(/**Test Execution**/") in line number 6, indicated by the code 108, or the line number, 10 characters, indicated by the code 103, "1f()()",
In the case of a character string (character) that is only available in the skeleton 18 after changing the chart, specific data indicating uncorrespondence, such as Set “-1”. Finally, a character string that exists in the reproduction skeleton 16 but does not exist in the skeleton 13 after changing the chart (
Characters), that is, character strings (characters) deleted from the original chart (this is not the case in this embodiment), are not reflected in the source code correspondence section 102 of the difference information table 18.

ソース生成支援手段15は相違点情報テーブル18を作
成すると、同テーブル18内のソースコード対応部10
2の情報に従って、同テーブル18内のスケルトン部1
01に置かれているチャート変更後スケルトン13(第
10図参照)および既存ソースコード14(第5図参照
)をもとに、チャート変更後のソースコード19を作成
する(第8図ステップS5)。このソースフ−119作
成の具体的動作は次の通りである。
When the source generation support means 15 creates the difference information table 18, the source code correspondence section 10 in the same table 18
2, skeleton part 1 in the same table 18
Based on the chart-changed skeleton 13 (see Fig. 10) and the existing source code 14 (see Fig. 5) placed in 01, the source code 19 after the chart change is created (step S5 in Fig. 8). . The specific operation of creating this source file 119 is as follows.

まずソース生成支援手段15は、相違点情報テーブル1
8内のソースコード対応部102を先頭から順に参照す
る。もし未対応を示すデータ −1”を検出した場合に
は、スケルトン部101に置かれているチャート変更後
スケルトン13内の該当行(行範囲)の構造は追加され
たものとして、ソー0 ス生成支援手段15は上記チャート変更後スケルトン1
3内の該当行(行範囲)の情報をそのままチャート変更
後ソースコード(ソースコードファイル)19に書出す
。これに対して、ソースコード対応部102中で“−1
″以外のデータを検出した場合には、そのデータの示す
行(行範囲)と対を成すチャート変更後スケルトン13
内の行(行範囲)の構造は変更が無かったもの(即ち追
加されたものでない)として、ソース生成支援手段15
は検出したデータの示す行(行範囲)の既存ソースコー
ド14(第5図参照)の情報を、チャート変更後スケル
トン18内の対応する行(行範囲)の構造に代えてチャ
ート変更後ソースコード19に書出す。これは結局、チ
ャート変更後スケルトン13の構造中に、既存ソースコ
ード14の対応行(行範囲)の構造情報以外の部分(構
造文の条件式、関数呼出し文中の引数、通常のコメント
変数宣言行、代入交付などの詳細情報)を(手作業によ
る編集処理を行うことなく)自動的に反映したことにな
る。
First, the source generation support means 15 generates the difference information table 1.
The source code correspondence section 102 in 8 is sequentially referred to from the beginning. If data "-1" indicating unsupported data is detected, the structure of the corresponding row (row range) in the skeleton 13 after the chart change placed in the skeleton section 101 is assumed to have been added, and the source 0 source is generated. Support means 15 is skeleton 1 after changing the above chart.
The information of the corresponding line (line range) in 3 is written as it is to the source code after chart change (source code file) 19. In contrast, “−1” in the source code correspondence unit 102
If data other than `` is detected, the skeleton 13 after chart change that is paired with the row (row range) indicated by the data is detected.
The source generation support means 15 assumes that the structure of the lines (line range) within is unchanged (that is, not added).
The information in the existing source code 14 (see Figure 5) of the row (row range) indicated by the detected data is replaced with the structure of the corresponding row (row range) in the skeleton 18 after the chart change. I will write it on the 19th. After all, in the structure of the skeleton 13 after changing the chart, parts other than the structural information of the corresponding line (line range) of the existing source code 14 (conditional expressions in structure statements, arguments in function call statements, normal comment variable declaration lines) , detailed information such as assignment and issuance) will be automatically reflected (without manual editing).

以上のことから、本実施例では第11図に示1 すようなチャート変更後ソースコード19が作成される
。即ち、第10図に示すスケルトン部101上のチャー
ト変更後スケルトン13の行陽、6および行No、 1
0はいずれも既存ソースコード14(第5図参照)に対
応行がなく、追加行であるために、このチャート変更後
スケルトン13の行Nα6および行No。
From the above, in this embodiment, the chart-modified source code 19 as shown in FIG. 11 is created. That is, after the chart change on the skeleton section 101 shown in FIG. 10, the row yang, 6, and row no.
0 has no corresponding line in the existing source code 14 (see FIG. 5) and is an additional line, so the line Nα6 and the line No. of the skeleton 13 after the chart change.

10のスケルトン情報がそのままソースコード19に書
出される。またスケルトン部101上のチャート変更後
スケルトン13の行NO,7〜9は、それぞれ既存ソー
スコード14の行No、 5〜7に対応しているため、
同ソースコード14の行N095〜7の情報(第5図参
照)がソースコード19(の第11図において符号11
1で示される点線枠で囲まれた部分)に書出される。こ
のように、チャートの未変更部分に対しては、既存ソー
スコード14の対応部分が反映されるため、条件式(こ
こでは“a>−RH”)や代入文(ここでは“11m1
t−1;“)などの詳細情報を手作業で編集入力する必
要がなく、特に追加箇所が少ないチャート変更の場合に
は効果が著しい。なお、チャート追加が行われた箇所2 (追加行)の詳細情報設定部分(第11図において符号
112て示される点線枠で囲まれた部分)に対してだけ
は、従来と同様に手作業での編集入力が行われ、チャー
ト変更後のソースコード19が完成する。
The skeleton information of 10 is written as is to the source code 19. Also, lines Nos. 7 to 9 of the skeleton 13 after the chart change on the skeleton part 101 correspond to lines Nos. 5 to 7 of the existing source code 14, respectively.
The information in lines N095 to 7 of the source code 14 (see Figure 5) is code 11 in Figure 11 of the source code 19 (see Figure 5).
(the area surrounded by the dotted line frame indicated by 1). In this way, the corresponding part of the existing source code 14 is reflected in the unchanged part of the chart, so the conditional expression (here "a>-RH") and assignment statement (here "11m1
There is no need to manually edit and input detailed information such as t-1; "), and this is particularly effective when changing a chart with only a few additions. Note that the chart has been added to part 2 (additional line). Only the detailed information setting part (the part surrounded by the dotted line frame indicated by reference numeral 112 in FIG. 11) is manually edited and inputted as before, and the source code 19 after the chart change is is completed.

以上は、C言語で記述されたソースコードの生成支援処
理を例に説明したが、本発明は制御構造を持つ各種の言
語系(FORTRAN、PL/M、BASIC,Pa5
calなど)におけるソースコードの生成支援に応用可
能である。
The above has been explained using the source code generation support process written in C language as an example, but the present invention can also be applied to various languages with control structures (FORTRAN, PL/M, BASIC, Pa5).
It can be applied to support source code generation for programs such as CAL, etc.

また前記実施例では、既存ソースコード14が、ソース
生成手段22によってチャー1・情報21から作成され
たスケルトン23に手作業で編集を行って作成されたソ
ースコード25であるものとして説明したがこれに限る
ものではなく、例えば第2図に示すソース生成支援ツー
ル10によって生成されたチャート変更後ソースコード
19であってもよい。即ち本発明は、ソース生成支援ツ
ール10によってチャート変更後ソースコードI9を生
成した後に、再びプログラム変更が発生した場合には、
上記のソ3 −スコード(初回ソースコード)25またはチャート変
更後ソースコード19のいずれも、既存ソースコード1
4として利用することができる。
Furthermore, in the embodiment described above, the existing source code 14 was explained as the source code 25 created by manually editing the skeleton 23 created from the chart 1 and information 21 by the source generation means 22. For example, the chart-modified source code 19 generated by the source generation support tool 10 shown in FIG. 2 may be used. That is, in the present invention, when a program change occurs again after the source code I9 after chart change is generated by the source generation support tool 10,
Either the source code 25 (initial source code) or the source code 19 after chart change is the existing source code 1.
It can be used as 4.

また、前記実施例では、チャート変更後スケルトン13
と再生スケルトン16(ソースコード作業ファイル17
のスケルトン部91の内容)とを比較して追加、削除お
よび未変更構造を検出するのに、通常の文字列比較技術
により構造を意識せずに行う場合について説明したが、
1構造毎あるいは行毎に文字列比較を行うようにしても
よい。また、詳細情報を文字列比較の対象としないよう
にするならば、再生スケルトン16を生成することは必
ずしも必要でなく、チャート変更後スケルトン13と既
存ソースコード14とを比較することにより追加、削除
および未変更構造を検出することも可能である。
In addition, in the above embodiment, the skeleton 13 after chart change
and playback skeleton 16 (source code work file 17
The description has been made of a case in which ordinary character string comparison techniques are used to detect additions, deletions, and unchanged structures by comparing the contents of the skeleton part 91 of the text without being aware of the structure.
String comparison may be performed for each structure or for each line. Furthermore, if detailed information is not to be subjected to character string comparison, it is not necessarily necessary to generate the playback skeleton 16, and additions and deletions can be made by comparing the skeleton 13 after changing the chart and the existing source code 14. and it is also possible to detect unchanged structures.

[発明の効果コ 以上詳述したようにこの発明によれば、プログラム変更
が発生した場合に、変更後のチャートから生成されるチ
ャート変更後スケルトン(テンプ4 レートソース)と既存ソースコードとをもとに変更のな
かった制御構造部分を検出し、この変更のなかった制御
構造部分に対応する既存ソースコードの情報をチャート
変更後スケルトンの該当構造に反映する構成としたこと
により、チャート変更後スケルトンからチャート変更後
のソースコードを効率的に生成することができる。
[Effects of the Invention] As detailed above, according to the present invention, when a program change occurs, the chart-changed skeleton (Template 4 rate source) generated from the chart after the change and the existing source code can be combined. By detecting the control structure parts that have not been changed, and reflecting the existing source code information corresponding to the control structure parts that have not been changed in the corresponding structure of the skeleton after the chart change, the skeleton after the chart change It is possible to efficiently generate source code after chart changes.

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

第1図は変更が施されたチャートから既存のソースコー
ドを利用して新たなソースコードを生成するためのソー
ス生成支援システムの一実施例を示すブロック構成図、
第2図はチャートからソースコードを生成するだめの一
般的なソース生成システムのブロック構成図、第3図は
第2図のチャート情報21によって示されるチャートの
具体例を示す図、第4図は第3図のチャートに対応する
スケルトン(テンプレートソース)を示す図、第5図は
第4図のスケルトンを用いて生成されるソースコードを
示す図、第6図は第1図のチャート変更後チャート情報
11によって示される(第3図の 5 チャートに対する)変更後チャートの具体例を示す図、
第7図は第6図の変更後チャートに対応するスケルトン
、第8図は第1図に示すソース生成支援手段の動作を説
明するためのフローチャート、第9図は上記ソース生成
支援手段によって作成されるソースコード作業ファイル
の具体例を示す図、第10図は上記ソース生成支援手段
によって作成される相違点情報テーブルの具体例を示す
図、第11図は上記ソース生成支援手段によって作成さ
れるチャート変更後のソースコードの具体例を示す図で
ある。 10・・・ソース生成支援ツール、11・・・チャート
変更後チャート情報、12.22・・・ソース生成手段
、13・・・チャート変更後スケルトン、14・・・既
存ソースコード、15・・・ソース生成支援手段、1B
・・・再生スケルトン、17・・・ソースコード作業フ
ァイル、18・・・相違点情報テーブル、19・・・チ
ャート変更後ソースコード、21・・・チャート情報、
23・・・スケルトン、24・・・編集手段、25・・
・ソースコード。
FIG. 1 is a block diagram showing an embodiment of a source generation support system for generating new source code from a changed chart using existing source code;
Figure 2 is a block diagram of a general source generation system for generating source code from charts, Figure 3 is a diagram showing a specific example of the chart indicated by the chart information 21 in Figure 2, and Figure 4 is a block diagram of a general source generation system for generating source code from charts. Figure 5 shows the skeleton (template source) corresponding to the chart in Figure 3, Figure 5 shows the source code generated using the skeleton in Figure 4, Figure 6 shows the chart after changing the chart in Figure 1. A diagram showing a specific example of the changed chart (for the 5 chart in FIG. 3) indicated by information 11,
FIG. 7 is a skeleton corresponding to the changed chart in FIG. 6, FIG. 8 is a flowchart for explaining the operation of the source generation support means shown in FIG. 1, and FIG. 9 is a skeleton corresponding to the changed chart in FIG. FIG. 10 is a diagram showing a specific example of a difference information table created by the source generation support means, and FIG. 11 is a chart created by the source generation support means. It is a figure which shows the specific example of the source code after a change. 10... Source generation support tool, 11... Chart information after chart change, 12.22... Source generation means, 13... Skeleton after chart change, 14... Existing source code, 15... Source generation support means, 1B
... Reproduction skeleton, 17... Source code work file, 18... Difference information table, 19... Source code after chart change, 21... Chart information,
23...Skeleton, 24...Editing means, 25...
·Source code.

Claims (2)

【特許請求の範囲】[Claims] (1)作成すべきプログラムの処理の流れを示すチャー
トをもとに、上記プログラムの制御構造を示し、且つそ
の構造に対応した構造コメントを含み、上記プログラム
のソースコードの骨格を成すテンプレートソースを生成
するソース生成手段と、 プログラム変更のために変更が施されたチャートをもと
に上記ソース生成手段により新たなテンプレートソース
が生成された場合に、変更前のチャートに対応する以前
のソースコードと上記新たなテンプレートソースをもと
に構造コメントを含めて相違点のない制御構造を検出し
、同テンプレートソースの該当制御構造に上記以前のソ
ースコードの該当制御構造中の情報を反映させてチャー
ト変更後のソースコードを生成するソース生成支援手段
と、 を具備することを特徴とするソース生成支援システム。
(1) Based on a chart showing the processing flow of the program to be created, create a template source that shows the control structure of the above program, includes structural comments corresponding to the structure, and forms the skeleton of the source code of the above program. When a new template source is generated by the source generation means based on a chart that has been changed due to a program change, the source code that corresponds to the chart before the change and the previous source code that corresponds to the chart before the change. Based on the above new template source, a control structure with no differences is detected, including structural comments, and the chart is changed by reflecting the information in the corresponding control structure of the previous source code in the corresponding control structure of the same template source. A source generation support system comprising: source generation support means for generating subsequent source code;
(2)上記ソース生成支援手段は、上記以前のソースコ
ードから同ソースコードに対応するテンプレートソース
を生成する手段と、このテンプレートソースと上記新た
なテンプレートソースとを比較することで構造コメント
を含めて相違点のない制御構造を検出し、上記新たなテ
ンプレートソースの該当制御構造に上記以前のソースコ
ードの該当制御構造中の情報を反映させる手段とを含ん
でいることを特徴とする第1請求項記載のソース生成支
援システム。
(2) The source generation support means generates a template source corresponding to the source code from the previous source code, and includes structural comments by comparing this template source and the new template source. 1. The method of claim 1, further comprising means for detecting a control structure having no difference and reflecting information in the corresponding control structure of the previous source code in the corresponding control structure of the new template source. Source generation support system described.
JP1852590A 1990-01-29 1990-01-29 Support system for generation of source Pending JPH03223930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1852590A JPH03223930A (en) 1990-01-29 1990-01-29 Support system for generation of source

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1852590A JPH03223930A (en) 1990-01-29 1990-01-29 Support system for generation of source

Publications (1)

Publication Number Publication Date
JPH03223930A true JPH03223930A (en) 1991-10-02

Family

ID=11974050

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1852590A Pending JPH03223930A (en) 1990-01-29 1990-01-29 Support system for generation of source

Country Status (1)

Country Link
JP (1) JPH03223930A (en)

Similar Documents

Publication Publication Date Title
JP3196675B2 (en) Language processing method
JPH03223930A (en) Support system for generation of source
JP2766261B2 (en) Sentence summarization system
JPH03260766A (en) Translating device with parenthesis generation deciding function
JPS5922140A (en) Interactive compiling system
JPH07160490A (en) Coding assistance device
KR102046250B1 (en) e-Book Reader and Operating Method for Programming Language Learning, Recording Medium for Performing the Method
JPS61234434A (en) Program editing system
JPH11154093A (en) Program compiler and storage medium recording compiler program
JP3019874B2 (en) Program generation / synthesis apparatus and method
JP2942414B2 (en) Virtual database method
JPH04324528A (en) Program editing device and compiling device
JPH04237365A (en) Difference detecting system and automatic editing system for text processor
JP2000076056A (en) Automatic code generation system capable of expanding input specification
JPH04209029A (en) Parallel process program translation processor
JPH05341973A (en) Program analyzing device
JPH05158679A (en) Program text editing device
JPH06110750A (en) Automatic generating method for make-file of application program capable of accessing related data base
JPH04248624A (en) Program conversion processor
JPH04137073A (en) Design drawing device
JPH02100732A (en) Program grammar checking system
JPH07191858A (en) Simulation interpreter
JPH0580992A (en) Output system for procedure-function relation chart
JPH02115968A (en) Input guide system for editor
JPH01194053A (en) Processing system for command procedure