JPH0298731A - Program code generator - Google Patents

Program code generator

Info

Publication number
JPH0298731A
JPH0298731A JP25277888A JP25277888A JPH0298731A JP H0298731 A JPH0298731 A JP H0298731A JP 25277888 A JP25277888 A JP 25277888A JP 25277888 A JP25277888 A JP 25277888A JP H0298731 A JPH0298731 A JP H0298731A
Authority
JP
Japan
Prior art keywords
box
subordinate
unextracted
program code
tree structure
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
JP25277888A
Other languages
Japanese (ja)
Inventor
Masakazu Matsukura
松倉 正和
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.)
Kobe Steel Ltd
Original Assignee
Kobe Steel Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kobe Steel Ltd filed Critical Kobe Steel Ltd
Priority to JP25277888A priority Critical patent/JPH0298731A/en
Publication of JPH0298731A publication Critical patent/JPH0298731A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE:To automatically perform coding based on data corresponding to a tree structure chart by responding to one statement in a program code from the data of the tree structure chart in one to one, taking out a box in sequence of arrangement of the statement, and generating a corresponding program code. CONSTITUTION:A processing means 4 is provided with a tree structure chart generating part 10, and a programmer 1 can generate the tree structure chart on a display 3 via an input means 2. The data of the tree structure chart can be obtained by generating such tree structure chart. In such a case, when the programmer 1 completes the tree structure chart on the display 3, a coding command is supplied via the input means 2. Then, the processing means 4 operates a program code generating part 11 held in the inside of the means, and generates the program code based on the data of the tree structure chart. In such a way, it is possible to automatically perform the coding based on the data of the tree structure chart, and to save time and labor.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、プログラムコード生成装置に関し、更に詳し
くは、木構造チャート(構造化千十−ト)のデータに基
づいてプログラムコードを自動生成するプログラムコー
ド生成装置に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a program code generation device, and more specifically, to a program code generation device that automatically generates a program code based on data of a tree structure chart (structured 100-t). The present invention relates to a program code generation device.

〔従来の技術] 従来、連接1反復及び選択の3つの基本構造でプログラ
ムを設計する構造化プログラミングの手法が促唱されて
おり、この構造化プログラミングでは、従来のフローチ
ャートに代わって、木構造チャートが用いられている。
[Prior Art] Conventionally, a structured programming method has been promoted in which a program is designed using three basic structures: concatenation, one repetition, and selection.In this structured programming, a tree structure chart is used instead of a conventional flowchart. is used.

このような木構造チャートとしては、PAD、HCP、
SPD、YAC等の各種のものがあり、これらの木構造
チャートを作成するのを支援するコンピュータシステム
も開発されている。
Such tree structure charts include PAD, HCP,
There are various types such as SPD and YAC, and computer systems that support the creation of these tree structure charts have also been developed.

木構造チャートは、従来のフローチャートよりも制御構
造が明確に表現されており、プログラマがコーディング
を行う労力が軽減されると共に、誤りも発生し難くなっ
ている。
Tree-structured charts express control structures more clearly than conventional flowcharts, reducing the coding effort of programmers and making it less likely that errors will occur.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

木構造チャートを作成し、これに基づいてコーディグを
行えば、従来のフローチャートに基づいてコーディング
を行う場合よりもプログラマの負担が軽減され、誤りも
低下する。
Creating a tree structure chart and coding based on it reduces the burden on the programmer and reduces errors compared to coding based on conventional flowcharts.

しかし、プログラムのサイズが大きくなると、コーディ
ングの労力・時間が大きくなり、また発生する誤りの数
も増加する。従って、コーディングを自動化することが
望まれる。
However, as the size of the program increases, the effort and time required for coding increases, and the number of errors that occur also increases. Therefore, it is desirable to automate the coding.

そこで、本発明の目的とするところは、木構造チャート
に対応するデータに基づいて自動的にコーディングを行
うことが出来るプログラムコード生成装置を提供するこ
とにある。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a program code generation device that can automatically perform coding based on data corresponding to a tree-structured chart.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のプログラムコード生成装置は、連接9反復およ
び選択の3つの基本構造に分類しうるボックスを連接方
向および従属方向に多数接続してなる木構造チャートの
データからプログラムコードを生成する装置であって;
連接方向最上位かつ従属方向最上位のボックスをスター
トボックスとして取り出すスタートボックス取出手段と
、ひとつのボックスの種類が連接ボックスで連接下位方
向のボックスがあればそれを次のボックスとして取り出
し、連接下位方向のボックスがなくて従属下位方向のボ
ックスがあればそれを次のボックスとして取り出し、連
接下位方向のボックスも従属上位方向のボックスもなけ
れば自己をエンドボックスとする連接次ボックス取出手
段と、ひとつのボックスの種類が反復ボックスで従属下
位方向の未取出のボックスがあればそれを次のボックス
として取り出し、従属下位方向の未取出のボックスがな
くて連接下位方向のボックスがあればそれを次のボック
スとして取り出し、従属下位方向の未取出のボックスも
連接下位方向のボックスもなくて従属上位方向のボック
スがあればそれを次のボックスとして取り出し、従属下
位方向の未取出のボックスも連接下位方向のボックスも
従属上位方向のボックスもなければ自己をエンドボック
スとする反復次ボンクス取出手段と、ひとつのボックス
の種類が選択ボックスで従属下位方向の未取出のボック
スがあればそれらのうちの所定の優先順位の高いものを
次のボックスとして取り出し、従属下位方向の未取出の
ボックスがなくて連接下位方向のボックスがあればそれ
を次のボックスとして取り出し、従属下位方向の未取出
のボックスも連接下位方向のボックスもなくて従属上位
方向のボックスがあればそれを次のボックスとして取り
出し、従属下位方向の未取出のボックスも連接下位方向
のボックスも従属上位方向のボックスもなければ自己を
エンドボックスとする選択次ボックス取出手段と、順に
ボックスが取り出される毎に対応するプログラムコード
をその順に作成するプログラムコード生成手段とを具備
してなること構成上の特徴とするものである。
The program code generation device of the present invention is a device that generates a program code from data of a tree structure chart formed by connecting a large number of boxes in a connection direction and a dependent direction, which can be classified into three basic structures of connection, nine repetitions, and selection. hand;
Start box extraction means takes out the topmost box in the connection direction and the topmost box in the subordinate direction as a start box, and if one box type is a connection box and there is a box in the lower connection direction, it is taken out as the next box, and the box is taken out in the lower connection direction. If there is no box and there is a box in the subordinate downward direction, it is extracted as the next box, and if there is neither a box in the downward direction nor a box in the subordinate upward direction, the connected next box extracting means makes itself the end box; If the box type is a repeat box and there is an unextracted box in the subordinate subordinate direction, it will be taken out as the next box, and if there is no unextracted box in the subordinate subordinate direction and there is a box in the concatenated subordinate direction, it will be taken as the next box. If there is no unextracted box in the subordinate downward direction or a box in the concatenated downward direction, and there is a box in the subordinate upward direction, it is extracted as the next box, and the unextracted box in the subordinate downward direction is also a box in the concatenated downward direction. If there is no box in the subordinate upper direction, iterative next box extraction means uses itself as the end box, and if one box type is a selection box and there is an unextracted box in the subordinate lower direction, a predetermined priority order among them. If there is no unextracted box in the subordinate downward direction and there is a box in the concatenated downward direction, then it is extracted as the next box, and the unextracted box in the subordinate downward direction is also extracted in the concatenated downward direction. If there is no box and there is a box in the subordinate upward direction, extract it as the next box, and if there is no unextracted box in the subordinate downward direction, a box in the concatenated downward direction, or a box in the subordinate upward direction, select the self as the end box. The present invention is characterized in that it comprises a next box extracting means and a program code generating means which sequentially generates a corresponding program code each time a box is sequentially extracted.

なお、木構造チャートのデータは、コンピュータを用い
て木構造チャートを作成した時は自動的に作成され余分
な労力はかからない、また、コンピユータを用いない場
合でも、人手で容易に木構造チャートから必要なデータ
を抽出することが出来る6 [作用) 本発明のプログラムコード生成装置によれば、木構造チ
ャートのデータからプログラムコードの1つのステート
メントに1対1で対応するように且つステートメントの
並ぶ順にボックスが取り出される。そして、1つのボッ
クスが取り出される毎に対応するプログラムコードが作
成されるから、自動的にコーディングを行えることとな
る。
Furthermore, when creating a tree structure chart using a computer, the data for the tree structure chart is automatically created and does not require any extra effort, and even when a computer is not used, the data can be easily created manually from the tree structure chart. [Operation] According to the program code generation device of the present invention, boxes are extracted from the data of the tree structure chart in a one-to-one correspondence with one statement of the program code and in the order in which the statements are arranged. is taken out. Since a corresponding program code is created every time one box is taken out, coding can be performed automatically.

〔実施例] 以下、図に示す実施例に基づいて本発明を更に詳しく説
明する。ここに第1図は本発明の一実施例のプログラム
コード生成装置を含むプログラミング装置のブロック図
、第2図〜第7図はプログラムコード生成装置としての
処理を示すフローチャート、第8図は生成されたプログ
ラムコードの例示図、第9図は生成されたプログラムコ
ードの他の例示図、第10図は木構造チャートのデータ
の例示図、第11図は木構造チャー)・の例示図である
[Example] Hereinafter, the present invention will be explained in more detail based on the example shown in the drawings. Here, FIG. 1 is a block diagram of a programming device including a program code generation device according to an embodiment of the present invention, FIGS. 2 to 7 are flowcharts showing processing as the program code generation device, and FIG. FIG. 9 is another example of the generated program code, FIG. 10 is an example of tree-structured chart data, and FIG. 11 is a tree-structured chart.

なお、図に示す実施例により本発明が限定されるもので
はない。
Note that the present invention is not limited to the embodiments shown in the figures.

第1図に示すプログラミング装置1は、キーボードの如
き入力手段2と、CRTのす0きデイスプレィ3と、コ
ンピュータの如き処理手段4と、フロッピーディスク装
置の如き出力手段5とをq(1してなっている。
The programming device 1 shown in FIG. It has become.

処理手段4は、木構造チャート作成部IOを有しており
、この働きによって、プログラマは人力手段2を介して
デイスプレィ3上に木構造チャートを作成できる。第1
1図はこのようにして作成された木構造チャートを示し
ている。
The processing means 4 has a tree structure chart creation section IO, which allows the programmer to create a tree structure chart on the display 3 via the human power means 2. 1st
Figure 1 shows a tree structure chart created in this way.

そして、このような木構造チャー1・を作成することに
より、第1O図に示す如き木構造チャー1のデータが得
られる。ここで、ボックスのfIltJT AB、Cは
それぞれ処理箱5反復箱5選沢箱を表しており、それぞ
れ連接1反復5選沢の基本構造に対応している。木構造
チャートの上下方向が連接方向に対応し、上が上位、下
が下位になる。また、木構造チャートの左右方向が従属
方向になり、左が上位、右が下位になる6選択箱につい
ては、右上と右下の従属方向の接続を有しており、−j
i19に右上が真、右下が偽の接続関係を表している。
By creating such a tree-structured chart 1, data of the tree-structured chart 1 as shown in FIG. 1O is obtained. Here, the boxes fIltJT AB and C represent 5 processing boxes, 5 repetition boxes, and 5 selection boxes, respectively, and each corresponds to the basic structure of 1 repetition and 5 selection boxes. The vertical direction of the tree structure chart corresponds to the connection direction, with the top being the top and the bottom being the bottom. In addition, the left and right direction of the tree structure chart is the subordinate direction, and for the 6 selection boxes where the left is upper and the right is lower, there is a connection in the upper right and lower right subordinate directions, -j
In i19, the upper right represents a true connection and the lower right represents a false connection.

コーディング文字は各ボックスの内部に書かれる文字列
である。
Coding characters are strings of characters written inside each box.

さて、プログラマは、デイスプレィ3上に木構造チャー
トを完成すると、入力手段2を介してコーディング指令
を与える。
Now, when the programmer completes the tree structure chart on the display 3, he gives a coding command via the input means 2.

すると、処理手段4は、内部に有するプログラムコード
生成部11を作動させ、木構造チャートのデータ(第1
0図参照)に基づいてプログラムコード(第8図参照)
を生成する。以下、第2図〜第7図を参照して、そのプ
ログラムコード生成の作動について詳細に説明する。た
だし、木構造チャートのデータは第10図に例示したも
のであるとする。
Then, the processing means 4 operates the internal program code generation section 11 and generates the data of the tree structure chart (first
Program code (see Figure 8) based on the program code (see Figure 8)
generate. The operation of generating the program code will be described in detail below with reference to FIGS. 2 to 7. However, it is assumed that the data of the tree structure chart is as illustrated in FIG.

まず、第2図に示すように、各ボックス■〜■に対応す
るレジスタを設定し、各レジスタの内容を全て0にする
0次に、初期値として行番号N=lを設定する。そして
、接続情報の上−0,左−〇のボックスを取り出す。こ
こではボックス■である。上=0とは、連接上位方向の
接続がない(従って連接方向最上位である)ことを表し
ている。
First, as shown in FIG. 2, the registers corresponding to the boxes (1) to (2) are set, and the contents of each register are all set to 0.Then, the row number N=l is set as the initial value. Then, take out the top-0 and left-○ boxes of the connection information. Here it is box ■. Upper = 0 indicates that there is no connection in the upper direction of the connection (therefore, it is the highest in the connection direction).

左=0とは、従属上位方向の接続がない(従って従属方
向最上位である)ことを表している。これがコーディン
グのスタートボックスとなる。
Left = 0 indicates that there is no connection in the subordinate direction (therefore, it is the highest subordinate direction). This will be your starting box for coding.

スタートボックスとしてボックス■が取り出されると、
第3図に示す種類判定を行い、そのボックスが処理箱で
あるか1反復柑であるか、1AIf<箱であるかを判定
する。ボックス■は処理箱である。
When the box ■ is taken out as the start box,
The type determination shown in FIG. 3 is performed to determine whether the box is a processing box, a 1-repetition box, or 1AIf<box. Box ■ is a processing box.

そこで、第4図に示す処理箱の処理を行う、即ち、N(
−1)行目のステートメントとしてボックス■のコーデ
ィング文字がそのまま採用される。
Therefore, the processing of the processing box shown in FIG. 4 is performed, that is, N(
-1) The coding characters in the box ■ are adopted as they are as the statement in line 1.

かくして第8図に示す1行目のステートメントが生成さ
れる。
In this way, the statement in the first line shown in FIG. 8 is generated.

上記処理箱の処理を終わると、第5図に示す連続の処理
に移行する。
When the processing of the processing box is completed, the process shifts to the continuous processing shown in FIG. 5.

連続の処理では、行番号Nをインクリメントし、次に連
続下位方向の接続があるか否かをチエソりする(下=O
?)、ボックス■では、下==2であり、ボックス■が
連接下位方向のボックスとして存在する。そこで、その
連接下位方向のボックスを取り出し、前記種類判定の処
理に戻る。
In continuous processing, the line number N is incremented, and then it is checked whether there is a connection in the continuous downward direction (bottom = O
? ), in box ■, lower==2, and box ■ exists as a box in the downward direction. Therefore, the box in the lower order direction is taken out and the process returns to the type determination process.

ボックス■は、ボックス■と同じ処理箱であるので、上
述と同様の処理が行われる。これにより第8図に示す2
行目のステートメントが生成される。
Box ■ is the same processing box as box ■, so the same processing as described above is performed. As a result, 2
The statement on line is generated.

同様にして、ボックス■が取り出され、第8図に示す3
行目のステートメントが生成される。なお、実際は3行
目と4行目であるが、これらは−体不可分であるので、
合わせて3行目と考える。
In the same way, the box ■ is taken out and the box 3 shown in FIG.
The statement on line is generated. Note that these are actually the 3rd and 4th lines, but they are inseparable from the − body, so
Think of it as the third line in total.

ボックス■の連接下位方向のボックスとして、ボックス
■が次に取り出されるが、このボックス■は反復箱なの
で、第6図に示す反復箱の処理が行われる。即ち、ボッ
クス■のレジスタの内容がチエツクされ、この時点では
0であるから、N(−4)行目のステートメントとして
、Doと、自動的に発行したステートメント番号m(こ
こではlOになっている)と、ボックス■のコーディン
グ文字とをこの順に並べたコードを生成する。かくして
第8図に示す4行目のステートメントが生成される。
Box ■ is extracted next as a box in the downward direction of box ■, but since box ■ is a repeating box, the repeating box processing shown in FIG. 6 is performed. That is, the contents of the register in box ■ are checked, and since it is 0 at this point, the N(-4)th line statement is Do and the automatically issued statement number m (here it is lO). ) and the coding characters in the box ■ are arranged in this order to generate a code. In this way, the statement on the fourth line shown in FIG. 8 is generated.

次いで、ボックス■のレジスタ=1とし、ステートメン
ト番号Nをインクリメントし、従属下位方向のボックス
を取り出す、これはボックス■である。そして、ステー
トメントの階層構造を明確に表現するために、ステート
メントを記述する先頭位置を2字分右へ入れる。
Next, the register of box ■ is set to 1, the statement number N is incremented, and the box in the subordinate direction is taken out, which is box ■. Then, to clearly express the hierarchical structure of the statements, move the beginning position of the statement two characters to the right.

ボックス■は、選択箱であるから、第7図に示す選択箱
の処理に移行する。 Finち、ボックス■のレジスタ
の内容がチエツクされ、この時点ではOであるから、N
(−5)行目のステートメントとして、IFと、(ボッ
クス■のコーディング文字)と、THENとをこの順に
並べたコードが生成される。ただし、コーディング文字
中の記号〈は記号、LT、に置換する。かくして、第8
図に示す5行目のステートメントが生成される。
Since the box (2) is a selection box, the processing shifts to the selection box shown in FIG. Finchi, the contents of the register in box ■ are checked, and since it is O at this point, N is
As the statement on the (-5)th line, a code is generated in which IF, (coding characters in box ■), and THEN are arranged in this order. However, the symbol < in the coding characters is replaced with the symbol LT. Thus, the eighth
The statement on the fifth line shown in the figure is generated.

次に、ボックス■のレジスタの内容を1とし、ステート
メント番号Nをインクリメントし、右上に接続するボッ
クスがあるか否かをチエツクする。
Next, the contents of the register of box (2) are set to 1, the statement number N is incremented, and it is checked whether there is a box to be connected to the upper right.

これは、従属下位方向の真関係にあるボックスの有無を
チエツクするものである。ボックス■では右上=8であ
るから、次に、ボックス■を取り出す、そして、上記と
同様の理由により、ステートメントの先頭位置を2字分
右へ入れる。
This checks whether there is a box that has a true relationship in the subordinate direction. In box ■, the upper right = 8, so next, take out box ■, and for the same reason as above, move the start position of the statement two characters to the right.

ボックス■は選択箱であり、第7図に示す選択箱の処理
を行う、ボックス■のレジスタはOであるから、上記と
同様の処理が行われ、第8図に示す第6行目のステート
メントが生成される。但し、コーディング文字中の記号
〉は記号、 GT、に置換される。
Box ■ is a selection box, and performs the selection box processing shown in Figure 7. Since the register of box ■ is O, the same processing as above is performed, and the statement in the 6th line shown in Figure 8 is generated. However, the symbol 〉 in the coding characters is replaced with the symbol GT.

ボックス■の右上のボックスとしてボックス■が取り出
され、これは処理箱であるから、ボックス■のコーディ
ング文字がN (=7)行目のステートメントとされる
。かくして第8図に示す第7行目のステートメントが生
成される。
Box ■ is taken out as the upper right box of box ■, and since this is a processing box, the coding character of box ■ is taken as the statement on the Nth (=7)th line. In this way, the statement on the seventh line shown in FIG. 8 is generated.

ボックス■に関する連続の処理(第5図)では、下−〇
なので、左=0か否かがチエツクされ(即ち従属上位方
向の接続があるか否か)、ボックスOの左−8であるか
ら、ボックス■が取り出される。そして、階層構造明確
化のために、ステートメントの記述先頭位置が2字分左
へ出される。
In the continuous processing regarding box ■ (Figure 5), since the bottom is -0, it is checked whether the left = 0 (that is, whether there is a connection in the subordinate upper direction), and since the left of box O is -8. , box ■ is taken out. In order to clarify the hierarchical structure, the starting position of the statement is moved two characters to the left.

ボックス■は選択箱であり、第7図の選択箱の処理が行
われるが、このときボックス■のレジスターlであるか
ら、N(=8)行目のステートメントとして、ELSE
が生成される。かくして、第8図に示す8行目のステー
トメントが生成される。
Box ■ is a selection box, and the selection box processing in Figure 7 is performed, but at this time, since it is register l of box ■, ELSE is entered as the statement on line N (=8).
is generated. Thus, the statement on line 8 shown in FIG. 8 is generated.

次に、ボックス■のレジスタを2とし、ステートメント
番号Nをインクリメントし、右下−〇か否かをチエツク
する。これは従属下位方向の偽関係のボックスが有るか
否かをチエツクするものである。
Next, set the register in box (3) to 2, increment the statement number N, and check whether it is -0 in the lower right corner. This is to check whether there is a box with a false relationship in the subordinate/lower direction.

ボックス■では右下−〇なので、N(=9)行目のステ
ートメントとして、END  IFが生成される。かく
して第8図に示す9行目のステートメントが生成される
In box ■, the bottom right is −0, so END IF is generated as the Nth (=9)th line statement. In this way, the statement on the 9th line shown in FIG. 8 is generated.

次に、ボックス■のレジスタがOにされ、第5図に示す
連続の処理に移行する。
Next, the register in box (2) is set to O, and the process shifts to the continuous process shown in FIG.

連続の処理において、ボックス■では下−〇で、左−7
であるから、ボックス■が取り出される。
In continuous processing, in box ■, bottom - ○, left -7
Therefore, the box ■ is taken out.

そして、上記と同様の理由によりステートメントの記述
先頭位置が2字分左へ出される。
Then, for the same reason as above, the starting position of the statement is moved two characters to the left.

ボックス■は、選択箱であり、選択箱の処理(第7図)
に移行する。
Box ■ is a selection box, and selection box processing (Figure 7)
to move to.

ボックス■のレジスタは1であるから、N(−10)行
目のステートメントとして、ELSEが生成される。か
くして第8図に示す10行目のステートメントが生成さ
れる。
Since the register in box (■) is 1, ELSE is generated as the statement on the N (-10)th line. In this way, the statement on the 10th line shown in FIG. 8 is generated.

次にボックス■のレジスタが2とされて、ステートメン
ト番号Nがインクリメントされ、右下=0か否かがチエ
ツクされる。ボックス■の右下−9であるから、ボック
ス■が取り出される。そして、上記と同じ理由によりス
テートメントの先頭位置が2字分右へ入れられる。
Next, the register in box (2) is set to 2, the statement number N is incremented, and it is checked whether the lower right=0. Since the position is -9 at the bottom right of box ■, box ■ is taken out. Then, for the same reason as above, the starting position of the statement is moved two characters to the right.

ボックス■は、処理箱であり、そのコーディング文字が
N(−11)行目のステートメントとなる。即ち、第8
図に示す第11行目のステートメントが生成される。
Box ■ is a processing box, and its coding character becomes the statement on the N (-11)th line. That is, the eighth
The statement on the 11th line shown in the figure is generated.

ボックス■の下=10であり、ボックス[相]が次に取
り出され、ボックス[相]は処理箱であるから、そのコ
ーディング文字がN(=12)行目のステートメントと
され、第8図に示す第12行目のステートメントが生成
される。
The bottom of the box ■ = 10, the box [phase] is taken out next, and the box [phase] is a processing box, so its coding character is taken as the statement on the N (= 12)th line, and it is shown in Figure 8. The statement shown on the 12th line is generated.

ボックス[相]では、下−0であり、左=7であるから
、ボックス■が取り出される。また、ステートメントの
先頭位置が2字分左へ出される。
In the box [phase], the bottom is -0 and the left is 7, so the box ■ is taken out. Also, the starting position of the statement is moved two characters to the left.

ボックス■は選択箱であり、第7図の選択箱の処理が行
われるが、この時点でのボックス■のレジスタは2であ
るから、N(=13)行目のステートメントして、EN
D  IFが生成される。かくして第8図に示す第13
行目のステートメントが生成される。
The box ■ is a selection box, and the process of the selection box in Figure 7 is performed, but at this point the register of the box ■ is 2, so the statement in the N (= 13) line is
A DIF is generated. 13 shown in FIG.
The statement on line is generated.

次に、ボックス■のレジスタ=0とされ、第5図に示す
連続の処理に移行し、ボックス■では下−〇であり、左
=4であるから、ボックス■が取り出される。また、ス
テートメントの先頭位置が2字分左へ出される。
Next, the register of box (2) is set to 0, and the process moves to the continuous process shown in FIG. 5, and since in box (2) it is lower - 0 and left = 4, box (2) is taken out. Also, the starting position of the statement is moved two characters to the left.

ボックス■は反復箱であり、第6図に示す反復箱の処理
が行われるが、この時点でボックス■のレジスタは1で
あり、ステートメントの先頭位置が3字分左へ出される
。そして、N(−14)行目のステートメントとして、
m  C0NTINUEが生成される。かくして、第8
図に示す14行目のステートメントが生成される。
Box ■ is a repeat box, and the process of the repeat box shown in FIG. 6 is performed. At this point, the register of box ■ is 1, and the starting position of the statement is moved three characters to the left. Then, as the statement on the N(-14)th line,
m C0NTINUE is generated. Thus, the eighth
The statement on the 14th line shown in the figure is generated.

次に、ステートメントの開始位置が3字分右に入れられ
、ボックス■のレジスターOにされ、第5図に示す連続
の処理に移行する。
Next, the start position of the statement is moved three characters to the right and placed in register O of box 2, and the process proceeds to the continuous process shown in FIG.

連続の処理において、ボックス■の下−5であるから、
ボックス■が取り出される。ボックス■は処理箱であり
、そのコーディング文字がN(=1.5)行目のステー
トメントとされ、第8図に示す15行目のステートメン
トが生成される。
In continuous processing, since it is -5 below the box ■,
Box ■ is taken out. Box ■ is a processing box, and its coding character is taken as the statement on the N (=1.5) line, and the statement on the 15th line shown in FIG. 8 is generated.

次に、ボックス■の下=6であり、ボックス■が取り出
され、ボックス■は処理箱であるから、そのコーディン
グ文字がステートメントとされる。
Next, the bottom of the box ■=6, the box ■ is taken out, and since the box ■ is a processing box, its coding character is taken as a statement.

かくして第8図に示す16行目のステートメントが生成
される。
In this way, the statement on the 16th line shown in FIG. 8 is generated.

次に、第5図に示す連続処理に移行するが、ボックス■
は下−0であり、且つ左−〇であるから、N(=17)
行目のステートメントして、ENDが生成される。かく
して、第8図に示す17行目のステートメントが生成さ
れる。
Next, we move on to the continuous processing shown in Figure 5, but the box ■
is lower - 0 and left - 0, so N (= 17)
END is generated by the statement in line 1. Thus, the statement on the 17th line shown in FIG. 8 is generated.

そして、コーディングの作動を終了する。Then, the coding operation ends.

以上のように、木構造チャートのデータ(第10図)か
ら自動的にコーディングが行われることとなる。
As described above, coding is automatically performed from the data of the tree structure chart (FIG. 10).

このようにして生成されたプログラムコードは出力手段
5へ出力される。
The program code generated in this way is output to the output means 5.

他の実施例としては、ステートメントの先頭位置を2字
分右へ入れたり5左へ出したりする階層明確化の処理を
省略したものが挙げられる。この場合には、第9図に示
すようなプログラムコードが生成されることになる。
Another example is one in which the hierarchy clarification process of moving the start position of the statement two characters to the right or moving it five characters to the left is omitted. In this case, a program code as shown in FIG. 9 will be generated.

なお、説明の都合上、処理箱と反復箱と選択箱の3つの
種類のボックスのみを用いて説明したが、前判定反復箱
、後判定反復箱等のバリエーションを持つ木構造チャー
トのデータに対しても本発明を適用できることは言うま
でもない。
For convenience of explanation, we have explained using only three types of boxes: processing box, repetition box, and selection box. Needless to say, the present invention can be applied to any case.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、連接1反復および選択の3つの基本構
造に分類しろるボックスを連接方向および従属方向に多
数接続してなる木構造チャートのデータからプログラム
コードを生成する装置であって;連接方向最上位かつ従
属方向最上位のボックスをスタートボックスとして取り
出すスタートボックス取出手段と、ひとつのボックスの
種類が連接ボックスで連接下位方向のボックスがあれば
それを次のボックスとして取り出し、連接下位方向のボ
ックスがなくて従属上位方向のボックスがあればそれを
次のボックスとして取り出し1連接下位方向のボックス
も従属上位方向のボックスもなければ自己をエンドボッ
クスとする連接衣ボックス取出手段と、ひとつのボック
スの種類が反復ボックスで従属下位方向の未取出のボッ
クスがあればそれを次のボックスとして取り出し、従属
下位方向の未取出のボックスがなくて連接下位方向のボ
ックスがあればそれを次のボックスとして取り出し、従
属下位方向の未取出のボックスも連接下位方向のボック
スもなくて従属上位方向のボックスがあればそれを次の
ボックスとして取り出し、従属下位方向の未取出のボッ
クスも連接下位方向のボックスも従属上位方向のボック
スもなければ自己をエンドボックスとする反復次ボック
ス取出手段と、ひとつのボックスの種類が選択ボックス
で従属下位方向の未取出のボックスがあれはそれらのう
ちの所定の優先順位の高いものを次のボックスとして取
り出し、従属下位方向の未取出のボックスがなくて連接
下位方向のボックスがあればそれを次のボックスとして
取り出し、従属下位方向の未取出のボックスも連接下位
方向のボックスもなくて従属上位方向のボックスがあれ
ばそれを次のボックスとして取り出し、従属下位方向の
未取出のボックスも連接下位方向のボックスも従属上位
方向のボックスもなければ自己をエンドボックスとする
選択次ボックス取出手段と、順にボックスが取り出され
る毎に対応するプログラムコードをその順に生成するプ
ログラムコード生成手段とを具備してなることを特徴と
するプログラムコード生成装置が提供され、これにより
木構造チャートのデータに基づいて自動的にコーディン
グを行えるようになるので、労力と時間の節約になると
共に、誤りの発生もなくなり、更に、プログラマの個人
差が入る余地もなくなる。
According to the present invention, there is provided a device for generating a program code from data of a tree-structured chart formed by connecting a large number of boxes classified into three basic structures of concatenation, repetition, and selection in a concatenation direction and a subordinate direction; A start box extraction means takes out the topmost box in the direction and the topmost box in the subordinate direction as a start box, and if one box type is a linked box and there is a box in the lower linked direction, it is taken out as the next box, and the box in the lower linked direction is extracted. If there is no box and there is a box in the subordinate upper direction, it is taken out as the next box.If there is neither a box in the lower direction nor a box in the subordinate upper direction, a means for taking out a connected box that makes itself an end box, and one box. If the type is repeat box and there is an unextracted box in the dependent downward direction, it is extracted as the next box, and if there is no unextracted box in the dependent downward direction and there is a box in the concatenated downward direction, it is taken as the next box. Retrieve, if there is no unextracted box in the subordinate downward direction or a box in the concatenated downward direction, and there is a box in the subordinate upward direction, extract it as the next box, and remove any unextracted boxes in the subordinate downward direction or boxes in the concatenated downward direction. If there is no box in the subordinate upper direction, there is an iterative next box extraction means that uses itself as the end box, and if one box type is a selection box and there are unextracted boxes in the subordinate lower direction, it is possible to use a predetermined priority order among them. The higher one is taken out as the next box, and if there is no unextracted box in the subordinate lower direction and there is a box in the concatenated lower direction, it is extracted as the next box, and the unextracted box in the subordinate lower direction is also a box in the concatenated lower direction. If there is no box in the subordinate upward direction, extract it as the next box, and if there is no unextracted box in the subordinate downward direction, or a box in the concatenated downward direction, or a box in the subordinate upward direction, select the self as the end box.Next There is provided a program code generation device characterized by comprising a box extraction means and a program code generation means for sequentially generating a corresponding program code each time a box is extracted, and which enables a tree structure chart to be generated. Coding can be done automatically based on data, which saves labor and time, eliminates errors, and eliminates the possibility of individual differences between programmers.

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

第1図は本発明の一実施例のプログラムコード生成装置
を含むプログラミング装置のブロック図、第2図〜第7
図はプログラムコード生成装置としての処理を示すフロ
ーチャート、第8図は□生成されたプログラムコードの
例示図、第9図は生成されたプログラムコードの他の例
示図、第1O図は木構造チャートのデータの例示図、第
11図は木構造チャートの例示図である。 〔符号の説明] 1・・・プログラミング装置 2・・・人力手段 3・・・デイスプレィ 4・・・処理手段 5・・・出力手段 10・・・木構造チャート作成部 11・・・プログラムコード生成部。
FIG. 1 is a block diagram of a programming device including a program code generation device according to an embodiment of the present invention, and FIGS.
The figure is a flowchart showing the processing as a program code generation device, Figure 8 is an example diagram of the generated program code, Figure 9 is another example diagram of the generated program code, and Figure 1O is a tree structure chart. An example diagram of data, FIG. 11 is an example diagram of a tree structure chart. [Explanation of symbols] 1...Programming device 2...Manual means 3...Display 4...Processing means 5...Output means 10...Tree structure chart creation unit 11...Program code generation Department.

Claims (1)

【特許請求の範囲】[Claims] 1、連接、反復および選択の3つの基本構造に分類しう
るボックスを連接方向および従属方向に多数接続してな
る木構造チャートのデータからプログラムコードを生成
する装置であって;連接方向最上位かつ従属方向最上位
のボックスをスタートボックスとして取り出すスタート
ボックス取出手段と、ひとつのボックスの種類が連接ボ
ックスで連接下位方向のボックスがあればそれを次のボ
ックスとして取り出し、連接下位方向のボックスがなく
て従属上位方向のボックスがあればそれを次のボックス
として取り出し、連接下位方向のボックスも従属上位方
向のボックスもなければ自己をエンドボックスとする連
接次ボックス取出手段と、ひとつのボックスの種類が反
復ボックスで従属下位方向の未取出のボックスがあれば
それを次のボックスとして取り出し、従属下位方向の未
取出のボックスがなくて連接下位方向のボックスがあれ
ばそれを次のボックスとして取り出し、従属下位方向の
未取出のボックスも連接下位方向のボックスもなくて従
属上位方向のボックスがあればそれを次のボックスとし
て取り出し、従属下位方向の未取出のボックスも連接下
位方向のボックスも従属上位方向のボックスもなければ
自己をエンドボックスとする反復次ボックス取出手段と
、ひとつのボックスの種類が選択ボックスで従属下位方
向の未取出のボックスがあればそれらのうちの所定の優
先順位の高いものを次のボックスとして取り出し、従属
下位方向の未取出のボックスがなくて連接下位方向のボ
ックスがあればそれを次のボックスとして取り出し、従
属下位方向の未取出のボックスも連接下位方向のボック
スもなくて従属上位方向のボックスがあればそれを次の
ボックスとして取り出し、従属下位方向の未取出のボッ
クスも連接下位方向のボックスも従属上位方向のボック
スもなければ自己をエンドボックスとする選択次ボック
ス取出手段と、順にボックスが取り出される毎に対応す
るプログラムコードをその順に生成するプログラムコー
ド生成手段とを具備してなることを特徴とするプログラ
ムコード生成装置。
1. A device for generating a program code from data of a tree structure chart in which a large number of boxes that can be classified into three basic structures of connection, repetition, and selection are connected in a connection direction and a subordinate direction; A start box extraction means takes out the top box in the subordinate direction as a start box, and if one box type is a linked box and there is a box in the lower linked direction, it is taken out as the next box, and if there is no box in the lower linked direction, If there is a box in the subordinate upper direction, it is extracted as the next box, and if there is no linked lower box or subordinate upper direction box, it becomes the end box, and one type of box is repeated. If there is an unextracted box in the subordinate subordinate direction, take it out as the next box, and if there is no unextracted box in the subordinate subordinate direction and there is a box in the concatenated subordinate direction, take it out as the next box, and If there is no unextracted box in the direction or a box in the connected lower direction, and there is a box in the subordinate upper direction, it will be extracted as the next box, and both unextracted boxes in the subordinate lower direction and boxes in the connected lower direction will be extracted in the subordinate upper direction. If there is no box, the repeating next box extraction means uses itself as the end box, and if one box type is a selection box and there are unextracted boxes in the subordinate downward direction, one of them with a predetermined higher priority is selected as the next box. If there is no unextracted box in the subordinate subordinate direction and there is a box in the concatenated subordinate direction, extract it as the next box, and if there is no unextracted box in the subordinate subordinate direction or box in the concatenated subordinate direction, it is extracted as a subordinate box. If there is a box in the upward direction, it is extracted as the next box, and if there is no unextracted box in the subordinate downward direction, a box in the connected downward direction, or a box in the subordinate upward direction, the selection next box extracting means sets itself as the end box. , and program code generation means for generating corresponding program codes in order each time a box is taken out.
JP25277888A 1988-10-05 1988-10-05 Program code generator Pending JPH0298731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25277888A JPH0298731A (en) 1988-10-05 1988-10-05 Program code generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25277888A JPH0298731A (en) 1988-10-05 1988-10-05 Program code generator

Publications (1)

Publication Number Publication Date
JPH0298731A true JPH0298731A (en) 1990-04-11

Family

ID=17242151

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25277888A Pending JPH0298731A (en) 1988-10-05 1988-10-05 Program code generator

Country Status (1)

Country Link
JP (1) JPH0298731A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05100833A (en) * 1991-05-31 1993-04-23 Internatl Business Mach Corp <Ibm> Data processor having code forming means and method of forming code
EP0801346A1 (en) * 1996-04-10 1997-10-15 SHARP Corporation Retargetable device for generating assembly-language programs from extended tree structure diagrams

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05100833A (en) * 1991-05-31 1993-04-23 Internatl Business Mach Corp <Ibm> Data processor having code forming means and method of forming code
EP0801346A1 (en) * 1996-04-10 1997-10-15 SHARP Corporation Retargetable device for generating assembly-language programs from extended tree structure diagrams

Similar Documents

Publication Publication Date Title
US4956773A (en) System and method of generating a source program from inputted schematic information
CN106162302B (en) Layout method and device for Launcher main interface and smart television
CN1085866C (en) Character string outputting method and apparatus capable of varying sizes of characters
JPH0298731A (en) Program code generator
JP3171363B2 (en) Programming device
JPH0296230A (en) Program code producing device
JP2519250B2 (en) Sequence logic program generator
JP3079481B2 (en) Document processing device
JP2811804B2 (en) Variable output range specification method
JPS58176704A (en) Assembling system for circuit diagram type programming device of programmable controller
JPH01251230A (en) Program converting system
JPS62145424A (en) Program managing method
JP2723236B2 (en) Character reader
JPH02171901A (en) Programmable controller
JP2669070B2 (en) Screen definition device
JPS6336386A (en) Storing system for graph data
JPH04242286A (en) Hierarchic structure display processing method
JPS62145422A (en) Automatically generating method for source program
JPH0296229A (en) Program code producing device
JPS62145423A (en) Automatically generating method for program specification
Gabrielson Mesh generation for two-dimensional regions using the Tektronix DVST (direct view storage tube) graphics terminal
JPH02153426A (en) Software development supporting device
JPH0519752B2 (en)
JPS60242731A (en) Digital pattern compressing method
JPS61285532A (en) Vector-to-raster converter for raster type plotter