JP2007094922A - Automatic program generation, method, and program - Google Patents

Automatic program generation, method, and program Download PDF

Info

Publication number
JP2007094922A
JP2007094922A JP2005285802A JP2005285802A JP2007094922A JP 2007094922 A JP2007094922 A JP 2007094922A JP 2005285802 A JP2005285802 A JP 2005285802A JP 2005285802 A JP2005285802 A JP 2005285802A JP 2007094922 A JP2007094922 A JP 2007094922A
Authority
JP
Japan
Prior art keywords
program
source code
state
exception
exception processing
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
JP2005285802A
Other languages
Japanese (ja)
Inventor
Masatoshi Tsuyuki
正年 露木
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Holdings 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 Fuji Electric Holdings Ltd filed Critical Fuji Electric Holdings Ltd
Priority to JP2005285802A priority Critical patent/JP2007094922A/en
Publication of JP2007094922A publication Critical patent/JP2007094922A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To allow an automatic program generator to automatically add exception handling to a program. <P>SOLUTION: A graphic data generation means 111 generates graphic data in receipt of an instruction from a user. A source code generation means 120 generates a compilable program source code from the graphic data. An exception handling reception means 112 receives the source code for exception handling to be carried out when a status is different from any status defined by the graphic data. An exception handling embedding means 130 embeds the exception handling source code in the program source code to output it as a new program source code 200. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、プログラム自動生成装置、方法、およびプログラムに関し、特にプログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成装置、方法、およびプログラムに関する。   The present invention relates to an automatic program generation device, method, and program, and more particularly, to an automatic program generation device, method, and program for generating a program from graphic data that represents the behavior of the program in graphic format.

従来より、プログラムの振る舞いが状態遷移図によって表されることはよく知られている。状態遷移図の標準的な表記方法は、UML(Unified Modeling Language)の状態マシン図としても定義されている。また、状態遷移図をベースに記述されたプログラムの仕様をもとに、プログラムのソースコードを自動生成する装置が提案されている(たとえば、特許文献1参照)。   Conventionally, it is well known that the behavior of a program is represented by a state transition diagram. The standard notation method of the state transition diagram is also defined as a UML (Unified Modeling Language) state machine diagram. Also, an apparatus for automatically generating a program source code based on a program specification described based on a state transition diagram has been proposed (see, for example, Patent Document 1).

図9は、従来のプログラム自動生成装置によるプログラムを自動生成する自動生成処理の手順を示すフローチャートである。
従来のプログラム自動生成装置は、キーボードやマウスなどの入力手段を介してユーザからの指示を受けて状態遷移図を生成する(ステップS31)。そして、プログラム自動生成装置は、生成した状態遷移図に対応するソースコードを自動で生成する(ステップS32)。
FIG. 9 is a flowchart showing a procedure of automatic generation processing for automatically generating a program by a conventional automatic program generation device.
The conventional automatic program generation device generates a state transition diagram in response to an instruction from the user via an input unit such as a keyboard or a mouse (step S31). Then, the program automatic generation device automatically generates a source code corresponding to the generated state transition diagram (step S32).

図10は、従来のプログラム自動生成装置で生成されたプログラムの振る舞いを示すフローチャートである。
生成されたプログラムは、イベントの生起を待つ処理が行われ(ステップS41)、イベントが発生すると、現在の状態を判定する処理が行われる(ステップS42)。そして、判定された現在の状態別に生起イベントとガード条件によって遷移先の状態を決定する処理が行われ(ステップS43)、決定された遷移先の状態に更新する処理が行われる(ステップS44)。
FIG. 10 is a flowchart showing the behavior of a program generated by a conventional automatic program generation device.
The generated program is processed to wait for the occurrence of an event (step S41), and when an event occurs, a process for determining the current state is performed (step S42). Then, processing for determining the transition destination state is performed for each determined current state based on the occurrence event and the guard condition (step S43), and processing for updating to the determined transition destination state is performed (step S44).

図11は、従来のプログラム自動生成装置が生成したプログラムソースコードの内容の概略を示す図である。
プログラムソースコード400は、従来のプログラム自動生成装置が生成したプログラムソースコードの内容の概略を示している。プログラムソースコード400は、C言語形式でプログラムソースコードが生成されたときのソースコードを示している。プログラムソースコード400に記載されている内容は、図10に示したフローチャートの各処理に対応している。
FIG. 11 is a diagram showing an outline of the contents of a program source code generated by a conventional automatic program generation device.
The program source code 400 shows an outline of the contents of the program source code generated by the conventional automatic program generation device. The program source code 400 indicates a source code when the program source code is generated in the C language format. The contents described in the program source code 400 correspond to each process of the flowchart shown in FIG.

上から3行目の“if”から始まる行は、図10に示したフローチャートのステップS41の処理に対応する。つまり、イベントの生起を待つ処理を行う。上から4行目の“switch”から始まる行は、図10に示したフローチャートのステップS42の処理に対応する。つまり、現在の状態を判定し、判定された現在の状態別に生起イベントとガード条件によって遷移先を決定する処理を行う。遷移先の処理は、この行の一番後ろの“{”から始まるかっこで囲われている各処理である。   The third line starting from “if” from the top corresponds to the process in step S41 of the flowchart shown in FIG. That is, a process of waiting for the occurrence of an event is performed. The line starting from “switch” on the fourth line from the top corresponds to the processing in step S42 in the flowchart shown in FIG. That is, the current state is determined, and a transition destination is determined according to the occurrence event and the guard condition for each determined current state. The transition destination process is each process enclosed in parentheses starting from “{” at the end of this line.

プログラムの状態が状態0から1、2、3、・・・、n−1、nまであるとしたとき、上から5行目の“case 状態0;”と書いてある行を含めて“break;”と書いてある行までの3行が状態0と判定されたときに実行されるコードであり、図10に示したフローチャートのステップS43aの処理に対応する。以下同様に、上から8行目の“case 状態1;”と書いてある行を含めて“break;”と書いてある行までの3行が状態1と判定されたときに実行されるコードであり、図10に示したフローチャートのステップS43bの処理に対応し、上から12行目の“case 状態n;”と書いてある行を含めて“break;”と書いてある行までの3行が状態nと判定されたときに実行されるコードであり、図10に示したフローチャートのステップS43dの処理に対応する。また、下から3行目の“現在の”から始まる行は、図10に示したフローチャートのステップS44の処理に対応する。
特開平7−78076号公報
When the state of the program is from state 0 to 1, 2, 3,..., N−1, n, the “break state” including the line “case state 0;” in the fifth line from the top is included. ; ”Is a code that is executed when it is determined that the three lines up to the line written as“ 0 ”are in the state 0, and corresponds to the process of step S43a in the flowchart shown in FIG. Similarly, the code that is executed when three lines up to the line written as “break;” including the line written as “case state 1;” on the eighth line from the top are determined to be in state 1 3 corresponding to the processing of step S43b in the flowchart shown in FIG. 10, including the line “case state n;” on the 12th line from the top to the line “break;”. This code is executed when it is determined that the line is in the state n, and corresponds to the process of step S43d in the flowchart shown in FIG. The third line starting from “current” from the bottom corresponds to the process in step S44 of the flowchart shown in FIG.
JP 7-78076 A

しかし、従来のプログラム自動生成装置で生成されるソースコードは、現在の状態を保持するメモリ領域が、このソースコードが示す処理以外の場所で何らかの原因により書き換えられ、現在の状態が想定したすべての状態に当てはまらなかった場合、つまり、上記例においては、状態0から1、2、3、・・・、n−1、nまで定義されたいずれの状態にも当てはまらなかった場合の例外処理がない。現在の状態がすべての状態に当てはまらないということは、明らかにプログラムが異常な動作をしている状態であり、対象システムによっては異常状態を放置しておくことが致命的な障害につながる場合もあるため、何らかの警告を発したり、場合によってはシステムの機能を停止させるなどの対策が必要となる。つまり、実際のシステムの一部としてこのプログラムを実行させることを考えた場合、このソースコードでは信頼性が低いということになる。そのため、従来は例外処理がなくても問題がないと判断できる部分にしか自動生成を適用することができないという問題があった。また、例外処理がないと問題があると判断された場合には、自動生成されたソースコードに例外処理を人手で追加しなければならないという問題もあった。つまり、プログラムを自動で生成するメリットが損なわれていた。   However, in the source code generated by the conventional automatic program generation device, the memory area that holds the current state is rewritten for some reason other than the processing indicated by the source code, and all the current states assumed In the above example, there is no exception handling when the state does not apply to any state defined from state 0 to 1, 2, 3,..., N−1, n. . The fact that the current state does not apply to all states clearly means that the program is operating abnormally, and depending on the target system, leaving the abnormal state may lead to a fatal failure. For this reason, it is necessary to take measures such as issuing a warning or stopping the function of the system in some cases. In other words, when this program is executed as a part of an actual system, the reliability of the source code is low. For this reason, there has conventionally been a problem that automatic generation can be applied only to a portion where it can be determined that there is no problem even if there is no exception handling. There is also a problem that if it is determined that there is a problem without exception handling, exception handling must be manually added to the automatically generated source code. That is, the merit of automatically generating a program has been lost.

本発明はこのような点に鑑みてなされたものであり、プログラムに自動で例外処理を追加できるプログラム自動生成装置、方法、およびプログラムを提供することを目的とする。   The present invention has been made in view of these points, and an object thereof is to provide an automatic program generation apparatus, method, and program capable of automatically adding exception processing to a program.

本発明では上記問題を解決するために、プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成装置において、ユーザからの指示を受けて、前記図形式データを生成する図形式データ生成手段と、前記図形式データからコンパイル可能なプログラムソースコードを生成するソースコード生成手段と、前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける例外処理受付手段と、前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する例外処理埋込手段とを有することを特徴とするプログラム自動生成装置が提供される。   In the present invention, in order to solve the above-described problem, a diagram of generating the diagram format data in response to an instruction from a user in an automatic program generation device that generates a program from diagram format data expressing the behavior of the program in a diagram format Format data generation means, source code generation means for generating compilable program source code from the diagram format data, and source code for exception processing that is performed when any state defined by the diagram format data is different There is provided an automatic program generation apparatus comprising: an exception process accepting unit; and an exception process embedding unit that embeds the exception process source code in the program source code and outputs the program as a new program source code.

このようなプログラム自動生成装置によれば、図形式データ生成手段が、ユーザからの指示を受けて、図形式データを生成する。ソースコード生成手段が、図形式データからコンパイル可能なプログラムソースコードを生成する。例外処理受付手段が、図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける。例外処理埋込手段が、プログラムソースコードに例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する。   According to such an automatic program generation device, the graphic data generation means generates graphic data in response to an instruction from the user. Source code generation means generates compilable program source code from graphic data. The exception process accepting unit accepts a source code of exception process to be performed when different from any state defined by the graphic data. The exception processing embedding means embeds the exception processing source code in the program source code and outputs it as a new program source code.

また、本発明では、プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成方法において、図形式データ生成手段が、ユーザからの指示を受けて、前記図形式データを生成するステップと、ソースコード生成手段が、前記図形式データからコンパイル可能なプログラムソースコードを生成するステップと、例外処理受付手段が、前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付けるステップと、例外処理埋込手段が、前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力するステップとを含むことを特徴とするプログラム自動生成方法が提供される。   Further, in the present invention, in a program automatic generation method for generating a program from diagram format data representing the behavior of the program in diagram format, diagram format data generation means generates the diagram format data in response to an instruction from a user. And a step in which the source code generating means generates a program source code that can be compiled from the graphic data, and an exception processing accepting means is performed when it is different from any state defined in the graphic data. Receiving a source code of exception processing; and an exception processing embedding unit that embeds the source code of exception processing in the program source code and outputs the program as a new program source code. A generation method is provided.

このようなプログラム自動生成方法によれば、図形式データ生成手段が、ユーザからの指示を受けて、図形式データを生成する。ソースコード生成手段が、図形式データからコンパイル可能なプログラムソースコードを生成する。例外処理受付手段が、図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける。例外処理埋込手段が、プログラムソースコードに例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する。   According to such a program automatic generation method, the graphic data generation means generates graphic data in response to an instruction from the user. Source code generation means generates compilable program source code from graphic data. The exception process accepting unit accepts a source code of exception process to be performed when different from any state defined by the graphic data. The exception processing embedding means embeds the exception processing source code in the program source code and outputs it as a new program source code.

また、本発明では、プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成プログラムにおいて、コンピュータに、ユーザからの指示を受けて、前記図形式データを生成する図形式データ生成手段と、前記図形式データからコンパイル可能なプログラムソースコードを生成するソースコード生成手段、前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける例外処理受付手段、前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する例外処理埋込手段として機能させることを特徴とするプログラム自動生成プログラムが提供される。   Further, in the present invention, in a program automatic generation program for generating a program from diagram format data expressing the behavior of the program in diagram format, diagram format data for generating the diagram format data in response to an instruction from a user to a computer Generating means, source code generating means for generating compilable program source code from the diagram format data, exception processing acceptance for receiving source code of exception processing performed when different from any state defined in the diagram format data And an automatic program generation program characterized by functioning as an exception processing embedding means for embedding the source code of the exception processing in the program source code and outputting it as a new program source code.

このようなプログラム自動生成プログラムによれば、図形式データ生成手段が、ユーザからの指示を受けて、図形式データを生成する。ソースコード生成手段が、図形式データからコンパイル可能なプログラムソースコードを生成する。例外処理受付手段が、図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける。例外処理埋込手段が、プログラムソースコードに例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する。   According to such a program automatic generation program, the graphic data generation means generates graphic data in response to an instruction from the user. Source code generation means generates compilable program source code from graphic data. The exception process accepting unit accepts a source code of exception process to be performed when different from any state defined by the graphic data. The exception processing embedding means embeds the exception processing source code in the program source code and outputs it as a new program source code.

本発明のプログラム自動生成装置、方法、およびプログラムによれば、例外処理をプログラムに自動で追加できるので、例外処理がないと問題がある場合であるか否かに関係なくプログラムを自動で生成することができる。また、例外処理を人手で追加しなくてもよくなる。したがって、プログラムを自動で生成するメリットが向上する。   According to the program automatic generation apparatus, method, and program of the present invention, exception processing can be automatically added to the program, so that the program is automatically generated regardless of whether there is a problem if there is no exception processing. be able to. Also, it is not necessary to add exception handling manually. Therefore, the merit of automatically generating the program is improved.

以下、本発明の実施の形態を図面を参照して詳細に説明する。
図1は、本実施の形態に適用される発明の概念図である。図1に示すように、プログラム自動生成装置100は、データ受付手段110、ソースコード生成手段120、および例外処理埋込手段130を備えている。また、データ受付手段110は、図形式データ生成手段111と例外処理受付手段112から構成されている。また、データ受付手段110は、入力手段12を介してユーザの指示を受け、図形式データの生成や例外処理の受け付けを行う。生成した図形式データや受け付けた例外処理は逐次モニタ11に表示する。図形式データ生成手段111は、入力手段12を介してユーザからの指示を受けて、ユーザが生成したいプログラムを表す図形式データを生成する。例外処理受付手段112は、入力手段12を介してユーザから例外処理を行う例外処理ソースコードを受け付ける。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a conceptual diagram of the invention applied to this embodiment. As shown in FIG. 1, the automatic program generation device 100 includes a data reception unit 110, a source code generation unit 120, and an exception process embedding unit 130. The data receiving unit 110 includes a diagram format data generating unit 111 and an exception process receiving unit 112. The data receiving unit 110 receives a user instruction via the input unit 12 and generates graphic data and receives exception processing. The generated graphic data and the accepted exception process are sequentially displayed on the monitor 11. The figure format data generation unit 111 receives an instruction from the user via the input unit 12 and generates figure format data representing a program that the user wants to generate. The exception processing accepting unit 112 accepts exception processing source code for performing exception processing from the user via the input unit 12.

ソースコード生成手段120は、図形式データ生成手段111から図形式データを受け取ると、図形式データとして表現されているプログラムを実現するためのソースコードを図形式データに基づいて生成する。例外処理埋込手段130は、例外処理受付手段112が受け付けた例外処理ソースコードを受け取る。また、ソースコード生成手段120が生成したソースコード(以下、生成ソースコードという。)を受け取る。そして、生成ソースコードの所定の位置に例外処理ソースコードを埋め込む。そして、例外処理を行うことができる新たなプログラムソースコード200として出力する。   When the source code generation unit 120 receives the diagram format data from the diagram format data generation unit 111, the source code generation unit 120 generates a source code for realizing the program expressed as the diagram format data based on the diagram format data. The exception processing embedding unit 130 receives the exception processing source code received by the exception processing receiving unit 112. Further, the source code generated by the source code generation means 120 (hereinafter referred to as generated source code) is received. Then, the exception processing source code is embedded at a predetermined position of the generated source code. And it outputs as the new program source code 200 which can perform exception processing.

このようにプログラム自動生成装置100は、例外処理埋込手段130によって例外処理ソースコードを生成ソースコードに自動で埋め込み、新たに例外処理をすることができるプログラムソースコード200として出力することができるので、例外処理が必要か不必要かに関係なくプログラム自動生成装置100を用いてプログラムの自動生成を行わせることができる。また、例外処理を自動で必要な場所に埋め込むことができるので、容易に例外処理機能が盛り込まれたプログラムを自動で生成することができる。   As described above, the automatic program generation apparatus 100 can automatically embed the exception processing source code in the generated source code by the exception processing embedding unit 130 and output it as the program source code 200 that can newly perform the exception processing. Regardless of whether exception processing is necessary or not, the automatic program generation apparatus 100 can be used to automatically generate a program. In addition, since exception processing can be automatically embedded in a necessary place, a program including an exception processing function can be easily generated automatically.

図2は、本実施の形態に用いるプログラム自動生成装置のハードウェア構成例を示す図である。プログラム自動生成装置100は、CPU(Central Processing Unit)101によって装置全体が制御されている。CPU101には、バス106を介してRAM(Random Access Memory)102、ハードディスクドライブ(HDD:Hard Disk Drive)103、グラフィック処理装置104、および入力インタフェース105が接続されている。   FIG. 2 is a diagram illustrating a hardware configuration example of the automatic program generation device used in the present embodiment. The entire automatic program generation apparatus 100 is controlled by a CPU (Central Processing Unit) 101. A random access memory (RAM) 102, a hard disk drive (HDD) 103, a graphics processing device 104, and an input interface 105 are connected to the CPU 101 via a bus 106.

RAM102には、CPU101に実行させるOSのプログラムやアプリケーションプログラムの少なくとも一部が一時的に格納される。また、RAM102には、CPU101による処理に必要な各種データが格納される。HDD103には、OS(Operating System)やアプリケーションプログラムが格納される。   The RAM 102 temporarily stores at least a part of OS programs and application programs to be executed by the CPU 101. The RAM 102 stores various data necessary for processing by the CPU 101. The HDD 103 stores an OS (Operating System) and application programs.

グラフィック処理装置104には、モニタ11が接続されている。グラフィック処理装置104は、CPU101からの命令に従って、画像をモニタ11の画面に表示させる。入力インタフェース105には、キーボード12aとマウス12bとが接続されている。入力インタフェース105は、キーボード12aやマウス12bから送られてくる信号を、バス106を介してCPU101に送信する。以上のようなハードウェア構成によって、本実施の形態の処理機能を実現することができる。   A monitor 11 is connected to the graphic processing device 104. The graphic processing device 104 displays an image on the screen of the monitor 11 in accordance with a command from the CPU 101. A keyboard 12a and a mouse 12b are connected to the input interface 105. The input interface 105 transmits a signal transmitted from the keyboard 12 a and the mouse 12 b to the CPU 101 via the bus 106. With the hardware configuration as described above, the processing functions of the present embodiment can be realized.

図3は、本実施の形態のプログラム自動生成装置によるプログラムを自動生成する自動生成処理の手順を示すフローチャートである。以下、図3に示す処理をステップ番号に沿って説明する。   FIG. 3 is a flowchart showing a procedure of automatic generation processing for automatically generating a program by the automatic program generation device of the present embodiment. Hereinafter, the process illustrated in FIG. 3 will be described in order of step number.

〔ステップS11〕図形式データ生成手段111は、入力手段12を介して入力されるユーザからの指示を受け付ける。この指示に基づいて、図形式データであり、プログラムの振る舞いを表現する状態遷移図を生成する。   [Step S11] The graphic data generation unit 111 receives an instruction from the user input via the input unit 12. Based on this instruction, a state transition diagram representing diagram behavior and representing the behavior of the program is generated.

〔ステップS12〕例外処理受付手段112は、入力手段12を介して入力される例外処理ソースコードを受け付ける。
〔ステップS13〕ソースコード生成手段120は、図形式データ生成手段111から状態遷移図を受け取る。そして、受け取った状態遷移図に基づいて状態遷移図が表す処理を行うプログラムのソースコードを自動生成する。
[Step S12] The exception process accepting unit 112 accepts an exception process source code input via the input unit 12.
[Step S13] The source code generation unit 120 receives a state transition diagram from the diagram data generation unit 111. Then, based on the received state transition diagram, the source code of the program that performs the process represented by the state transition diagram is automatically generated.

〔ステップS14〕例外処理埋込手段130は、ソースコード生成手段120から生成ソースコードを受け取る。また、例外処理受付手段112から例外処理ソースコードを受け取る。そして、生成ソースコードの所定の位置に例外処理ソースコードを埋め込み、新たなプログラムソースコード200として出力する。   [Step S14] The exception processing embedding unit 130 receives the generated source code from the source code generating unit 120. Also, the exception processing source code is received from the exception processing receiving means 112. Then, the exception processing source code is embedded at a predetermined position of the generated source code and output as a new program source code 200.

図4は、本実施の形態のプログラム自動生成装置が生成したプログラムの振る舞いを示すフローチャートである。以下、図4に示す処理をステップ番号に沿って説明する。
〔ステップS21〕イベントの生起を判断する。イベントが発生したときは処理をステップS22へ進める。
FIG. 4 is a flowchart showing the behavior of the program generated by the automatic program generation device of this embodiment. In the following, the process illustrated in FIG. 4 will be described in order of step number.
[Step S21] The occurrence of an event is determined. If an event occurs, the process proceeds to step S22.

〔ステップS22〕現在の状態を判断する。状態0と判断した場合には、処理をステップS23aへ進め、状態1と判断した場合には、処理をステップS23bへ進め、状態n−1と判断した場合には、処理をステップS23cへ進め、状態nと判断した場合には、処理をステップS23dへ進め、状態0からnまでに該当しないと判断した場合には、処理をステップS25へ進める。   [Step S22] The current state is determined. If it is determined that the state is 0, the process proceeds to step S23a. If it is determined that the state is 1, the process proceeds to step S23b. If it is determined that the state is n-1, the process proceeds to step S23c. If it is determined that the state is n, the process proceeds to step S23d. If it is determined that states 0 to n are not applicable, the process proceeds to step S25.

〔ステップS23〕現在の状態別に生起イベントとガード条件によって遷移先の状態を決定する。
〔ステップS24〕決定された遷移先の状態に更新し、処理をステップS21へ進める。
[Step S23] The transition destination state is determined according to the occurrence event and the guard condition for each current state.
[Step S24] The state is updated to the determined transition destination state, and the process proceeds to Step S21.

〔ステップS25〕例外処理ソースコードで表される例外処理を行い、処理をステップS21へ進める。
図5は、本実施の形態のプログラム自動生成装置が生成したプログラムソースコードの概略を示す図である。
[Step S25] Exception processing Exception processing represented by source code is performed, and the processing proceeds to step S21.
FIG. 5 is a diagram showing an outline of the program source code generated by the automatic program generation device of the present embodiment.

プログラムソースコード201は、プログラム自動生成装置100が生成したプログラムソースコード200の概略を示している。プログラムソースコード201は、C言語形式でプログラムソースコード200が生成されたときのソースコードを示している。プログラムソースコード201に記載されている内容は、図4に示したフローチャートの各処理に対応している。   A program source code 201 shows an outline of the program source code 200 generated by the automatic program generation device 100. A program source code 201 indicates a source code when the program source code 200 is generated in the C language format. The contents described in the program source code 201 correspond to each process of the flowchart shown in FIG.

上から3行目の“if”から始まる行は、図4に示したフローチャートのステップS21の処理に対応する。つまり、イベントの生起を待つ処理を行う。上から4行目の“switch”から始まる行は、図4に示したフローチャートのステップS22の処理に対応する。つまり、現在の状態を判定する。また、判定された現在の状態別に生起イベントとガード条件によって遷移先を決定する処理は、この行の一番後ろの“{”から始まるかっこで囲われている各処理である。   The third line starting from “if” from the top corresponds to the process of step S21 in the flowchart shown in FIG. That is, a process of waiting for the occurrence of an event is performed. The line starting from “switch” on the fourth line from the top corresponds to the processing in step S22 of the flowchart shown in FIG. That is, the current state is determined. Further, the process of determining the transition destination by the occurrence event and the guard condition for each determined current state is each process enclosed in parentheses starting from “{” at the back of this line.

プログラムの状態が状態0から1、2、3、・・・、n−1、nまであるとしたとき、上から5行目の“case 状態0;”と書いてある行を含めて“break;”と書いてある行までの3行が状態0と判定されたときに実行されるコードであり、図4に示したフローチャートのステップS23aの処理に対応する。以下同様に、上から8行目の“case 状態1;”と書いてある行を含めて“break;”と書いてある行までの3行が状態1と判定されたときに実行されるコードであり、図4に示したフローチャートのステップS23bの処理に対応し、上から12行目の“case 状態n;”と書いてある行を含めて“break;”と書いてある行までの3行が状態nと判定されたときに実行されるコードであり、図4に示したフローチャートのステップS23dの処理に対応する。   When the state of the program is from state 0 to 1, 2, 3,..., N−1, n, the “break state” including the line “case state 0;” in the fifth line from the top is included. ; ”Is a code executed when three lines up to a line written as“ ”are determined to be in the state 0, and corresponds to the process of step S23a of the flowchart shown in FIG. Similarly, the code that is executed when three lines up to the line written as “break;” including the line written as “case state 1;” on the eighth line from the top are determined to be in state 1 4 corresponding to the processing in step S23b in the flowchart shown in FIG. 4, including the line “case state n;” on the 12th line from the top to the line “break;” 3 This code is executed when it is determined that the line is in the state n, and corresponds to the process of step S23d in the flowchart shown in FIG.

下から7行目の“default;”と書いてある行を含めて“break;” と書いてある行までの3行が上記状態0からn以外の状態になったときに行われる処理である。つまり、図5に示しているプログラムソースコード201中において点線で囲われた部分のコードが例外処理ソースコード210であり、図4に示したフローチャートのステップS25の処理に対応する。また、下から3行目の“現在の”から始まる行は、図4に示したフローチャートのステップS24の処理に対応する。つまり、決定された遷移先の状態に更新する。   This is a process that is performed when three lines from the bottom to the line written “break;” including the line written “default;” on the seventh line change from the above state 0 to a state other than n. . That is, the code in the portion surrounded by the dotted line in the program source code 201 shown in FIG. 5 is the exception processing source code 210, and corresponds to the processing in step S25 of the flowchart shown in FIG. The third line starting from “current” from the bottom corresponds to the process in step S24 of the flowchart shown in FIG. That is, the state is updated to the determined transition destination state.

図6は、データ受付手段が受け付けたデータの表示の一例を示す図である。
表示例300は、入力手段12を介して入力されたデータをデータ受付手段110が受け付け、モニタ11に出力したときの表示例である。表示例300には、状態遷移図および例外アクティビティが示されており、状態311、312、313、遷移321、322、323、324、325、ラベル331、332、333、334、335、および例外アクティビティ370によってプログラムの振る舞いを表している。また、ラベル331は、イベント341、ガード条件351、およびアクション式361で構成されている。同様に、ラベル332は、イベント342、ガード条件352、およびアクション式362で構成されており、ラベル333は、イベント343、ガード条件353、およびアクション式363で構成されており、ラベル334は、イベント344、ガード条件354、およびアクション式364で構成されており、ラベル335は、イベント345、ガード条件355、およびアクション式365で構成されている。
FIG. 6 is a diagram illustrating an example of display of data received by the data receiving unit.
The display example 300 is a display example when the data receiving unit 110 receives data input via the input unit 12 and outputs the data to the monitor 11. The display example 300 shows a state transition diagram and an exception activity, and states 311, 312, 313, transitions 321, 322, 323, 324, 325, labels 331, 332, 333, 334, 335, and exception activity. 370 represents the behavior of the program. The label 331 includes an event 341, a guard condition 351, and an action expression 361. Similarly, the label 332 includes an event 342, a guard condition 352, and an action expression 362. The label 333 includes an event 343, a guard condition 353, and an action expression 363, and the label 334 includes the event 342. 344, a guard condition 354, and an action expression 364. The label 335 includes an event 345, a guard condition 355, and an action expression 365.

遷移321は、状態311から状態312に進むことを示しており、ラベル331が関連づけられている。つまり、状態311のときに、イベント341に示されている“event1”が発生し、ガード条件351に示されている“x==1”の条件を満たすと、アクション式361に示されている“a=x+1”が実行され、状態312に状態が遷移する。   A transition 321 indicates a transition from the state 311 to the state 312 and is associated with the label 331. That is, in the state 311, when “event1” shown in the event 341 occurs and the condition of “x == 1” shown in the guard condition 351 is satisfied, it is shown in the action expression 361. “A = x + 1” is executed, and the state transitions to the state 312.

同様に、遷移322は、状態312から状態311に進むことを示しており、ラベル332が関連づけられている。つまり、状態312のときに、イベント342に示されている“event2_1”が発生し、ガード条件352に示されている“x==2”の条件を満たすと、アクション式362に示されている“a=x+2”が実行され、状態311に状態が遷移し、遷移323は、状態312から状態313に進むことを示しており、ラベル333が関連づけられている。つまり、状態312のときに、イベント343に示されている“event2_2”が発生し、ガード条件353に示されている“x==3”の条件を満たすと、アクション式363に示されている“a=x+3”が実行され、状態313に状態が遷移する。   Similarly, transition 322 indicates a transition from state 312 to state 311 and is associated with label 332. That is, in the state 312, when “event2_1” shown in the event 342 occurs and the condition of “x == 2” shown in the guard condition 352 is satisfied, it is shown in the action expression 362. “A = x + 2” is executed, the state transitions to the state 311, and the transition 323 indicates that the state 312 is advanced to the state 313, and the label 333 is associated therewith. That is, in the state 312, when “event2_2” shown in the event 343 occurs and the condition “x == 3” shown in the guard condition 353 is satisfied, it is shown in the action expression 363. “A = x + 3” is executed, and the state transitions to the state 313.

また、遷移324は、状態313から状態312に進むことを示しており、ラベル334が関連づけられている。つまり、状態313のときに、イベント344に示されている“event3_1”が発生し、ガード条件354に示されている“x==4”の条件を満たすと、アクション式364に示されている“a=x−3”が実行され、状態312に状態が遷移し、遷移325は、状態313から状態311に進むことを示しており、ラベル335が関連づけられている。つまり、状態313のときに、イベント345に示されている“event3_2”が発生し、ガード条件355に示されている“x==5”の条件を満たすと、アクション式365に示されている“a=0”が実行され、状態311に状態が遷移する。   A transition 324 indicates that the state 313 is advanced to the state 312, and the label 334 is associated with the transition 324. That is, in the state 313, when “event3_1” shown in the event 344 occurs and the condition of “x == 4” shown in the guard condition 354 is satisfied, it is shown in the action expression 364. “A = x−3” is executed, the state transitions to the state 312, and the transition 325 indicates that the state 313 proceeds to the state 311, and the label 335 is associated therewith. That is, in the state 313, when “event3_2” shown in the event 345 occurs and the condition of “x == 5” shown in the guard condition 355 is satisfied, it is shown in the action expression 365. “A = 0” is executed, and the state transitions to the state 311.

また、例外アクティビティ370には、状態遷移図には定義されていない状態になったときに実行される処理である例外処理のコードが属性として記述されている。この例外アクティビティ370は、入力手段12を介して例外処理ソースコードが入力できるようになっている。   In addition, the exception activity 370 describes, as an attribute, a code for exception processing, which is processing executed when a state not defined in the state transition diagram is entered. The exception activity 370 can be input with exception processing source code via the input means 12.

図7は、本実施の形態のプログラム自動生成装置が生成したプログラムソースコードの内容の一例を示す図である。
プログラムソースコード202は、図6に示した表示例300の内容から自動生成されたプログラムソースコードの内容を示している。上から3行目の“if”から始まる行は、イベントの生起を待つ処理であり、図4に示したフローチャートのステップS21の処理に対応する。図6に示したとおり、表示例300に示した状態遷移図では、“event1”、“event2_1”、“event2_2”、“event3_1”、および“event3_2”がイベントとして定義されており、プログラムソースコード例202においても上記各イベントが発生したときに遷移する旨が、上から4行目の“next_state”から始まる行に記載されている。
FIG. 7 is a diagram showing an example of the contents of the program source code generated by the automatic program generation device of the present embodiment.
The program source code 202 shows the contents of the program source code automatically generated from the contents of the display example 300 shown in FIG. The third line starting from “if” from the top is a process of waiting for the occurrence of an event, and corresponds to the process of step S21 in the flowchart shown in FIG. As shown in FIG. 6, in the state transition diagram shown in the display example 300, “event1”, “event2_1”, “event2_2”, “event3_1”, and “event3_2” are defined as events, and an example of program source code In 202, the fact that a transition is made when each event occurs is described in the line starting from “next_state” on the fourth line from the top.

上から5行目の“switch”から始まる行は、図4に示したフローチャートのステップS22の処理に対応する。つまり、現在の状態を判定する。また、判定された現在の状態別に生起イベントとガード条件によって遷移先を決定する処理は、この行の一番後ろの“{”から始まるかっこで囲われている各処理である。本実施の形態のプログラム自動生成装置100においては、図6の状態311、312、313にあるように、プログラムの状態がそれぞれ“STATE1”、“STATE2”、および“STATE3”と定義されている。   The line starting from “switch” on the fifth line from the top corresponds to the process in step S22 of the flowchart shown in FIG. That is, the current state is determined. Further, the process of determining the transition destination based on the occurrence event and the guard condition for each determined current state is each process enclosed in parentheses starting from “{” at the end of this line. In the automatic program generation device 100 of the present embodiment, as shown in the states 311, 312, and 313 in FIG. 6, the program states are defined as “STATE1”, “STATE2”, and “STATE3”, respectively.

このとき上から6行目の“case STATE1;”と書いてある行を含めて“break;”と書いてある行までの6行が、状態が“STATE1”と判定されたときに実行されるコードであり、たとえば、図4に示したフローチャートのステップS23aの処理に対応する。以下同様に、上から12行目の“case STATE2;”と書いてある行を含めて“break;”と書いてある行までの10行が、状態が“STATE2”と判定されたときに実行されるコードであり、たとえば、図4に示したフローチャートのステップS23bの処理に対応し、上から22行目の“case STATE3;”と書いてある行を含めて“break;”と書いてある行までの10行が、状態が“STATE3”と判定されたときに実行されるコードであり、図4に示したフローチャートのステップS23dの処理に対応する。   At this time, six lines from the top to the line written as “break;” including the line written as “case STATE1;” on the sixth line are executed when the state is determined as “STATE1”. For example, it corresponds to the processing of step S23a in the flowchart shown in FIG. In the same manner, 10 lines including “break STATE 2;” on the 12th line from the top to the line written “break;” are executed when the state is determined as “STATE 2”. For example, it corresponds to the process of step S23b in the flowchart shown in FIG. 4, and “break;” is written including the line “case STATE3;” on the 22nd line from the top. Ten lines up to the line are codes executed when the state is determined to be “STATE3”, and corresponds to the process of step S23d of the flowchart shown in FIG.

また、下から8行目の“default;”と書いてある行を含めて“break;” と書いてある行までの4行が上記状態“STATE1”、“STATE2”、および“STATE3”以外の状態になったときに行われる処理である。つまり、この4行のコードが例外処理ソースコード210であり、図4に示したフローチャートのステップS25の処理に対応する。また、下から3行目の“now_state”から始まる行は、図4に示したフローチャートのステップS24の処理に対応する。以下に、ソースコード生成手段120が表示例300に示されている状態遷移図を使ってどのようにしてソースコードを生成するかを説明する。   In addition, the four lines up to the line written “break;” including the line written “default;” on the eighth line from the bottom are other than the above states “STATE1,” “STATE2,” and “STATE3”. This process is performed when a state is reached. That is, the four lines of code are the exception processing source code 210, which corresponds to the processing in step S25 of the flowchart shown in FIG. Further, the line starting from “now_state” in the third line from the bottom corresponds to the process in step S24 of the flowchart shown in FIG. Hereinafter, how the source code generation unit 120 generates source code using the state transition diagram shown in the display example 300 will be described.

まずは状態を“STATE1”と判定したときに実行するコードについて説明する。ソースコード生成手段120は、図6に示した状態遷移図の状態311から伸びている矢印がどの状態に対して伸びているかを検索する。表示例300においては、状態311から状態312に対してのみ遷移321が表示されている。つまり、状態311からは状態312にしか遷移しないということになる。また、ソースコード生成手段120は、遷移321に関連づけられているラベル331を読み取る。そして、プログラムソースコード202の上から7行目にあるように“if”から始まる行にイベント341とガード条件351を所定の位置に挿入する。また、上から8行目にアクション式361を挿入する。また、上から9行目の“next_state=”の後ろに遷移321の遷移先である状態312に対応する“STATE2”を挿入する。   First, the code executed when the state is determined as “STATE 1” will be described. The source code generation unit 120 searches for which state the arrow extending from the state 311 in the state transition diagram shown in FIG. 6 extends. In the display example 300, the transition 321 is displayed only from the state 311 to the state 312. That is, the state 311 only transits to the state 312. Further, the source code generation unit 120 reads the label 331 associated with the transition 321. Then, an event 341 and a guard condition 351 are inserted at predetermined positions in a line starting from “if” as in the seventh line from the top of the program source code 202. Also, an action expression 361 is inserted in the eighth line from the top. Also, “STATE2” corresponding to the state 312 that is the transition destination of the transition 321 is inserted after “next_state =” on the ninth line from the top.

また、状態を“STATE2”と判定したときに実行するコードについて説明する。ソースコード生成手段120は、状態312から伸びている矢印がどの状態に対して伸びているかを検索する。表示例300においては、状態312から状態311と状態313に対して遷移322、323が表示されている。つまり、状態312からは状態311と状態313に対して遷移するということになる。また、ソースコード生成手段120は、遷移322に対応づけられているラベル332を読み取る。そして、プログラムソースコード202の上から13行目にあるように“if”から始まる行にイベント342とガード条件352を所定の位置に挿入する。また、上から14行目にアクション式362を挿入する。また、上から15行目の“next_state=”の後ろに遷移322の遷移先である状態311に対応する“STATE1”を挿入する。また、ソースコード生成手段120は、遷移323に対応づけられているラベル333を読み取る。そして、上から17行目にあるように“else if”から始まる行にイベント343とガード条件353を所定の位置に挿入する。また、上から18行目にアクション式363を挿入する。また、上から19行目の“next_state=”の後ろに遷移323の遷移先である状態313に対応する“STATE3”を挿入する。   A code executed when the state is determined to be “STATE2” will be described. The source code generation unit 120 searches for the state in which the arrow extending from the state 312 extends. In the display example 300, transitions 322 and 323 are displayed from the state 312 to the states 311 and 313. That is, the state 312 transitions to the state 311 and the state 313. In addition, the source code generation unit 120 reads the label 332 associated with the transition 322. Then, an event 342 and a guard condition 352 are inserted at predetermined positions in a line starting from “if” as shown in the 13th line from the top of the program source code 202. Also, an action expression 362 is inserted in the 14th line from the top. Also, “STATE 1” corresponding to the state 311 that is the transition destination of the transition 322 is inserted after “next_state =” on the 15th line from the top. Further, the source code generating unit 120 reads the label 333 associated with the transition 323. Then, the event 343 and the guard condition 353 are inserted at predetermined positions on the line starting from “else if” as shown in the 17th line from the top. Also, an action expression 363 is inserted in the 18th line from the top. Also, “STATE3” corresponding to the state 313 that is the transition destination of the transition 323 is inserted after “next_state =” on the 19th line from the top.

また、状態を“STATE3”と判定したときに実行するコードについて説明する。ソースコード生成手段120は、状態313から伸びている矢印がどの状態に対して伸びているかを検索する。表示例300においては、状態313から状態311と状態312に対して遷移324、325が表示されている。つまり、状態313からは状態311と状態312に対して遷移するということになる。また、ソースコード生成手段120は、遷移324に対応づけられているラベル334を読み取る。そして、プログラムソースコード202の上から23行目にあるように“if”から始まる行にイベント344とガード条件354を所定の位置に挿入する。また、上から24行目にアクション式364を挿入する。また、上から25行目の“next_state=”の後ろに遷移324の遷移先である状態312に対応する“STATE2”を挿入する。また、ソースコード生成手段120は、遷移325に対応づけられているラベル335を読み取る。そして、上から27行目にあるように“else if”から始まる行にイベント345とガード条件355を所定の位置に挿入する。また、上から28行目にアクション式365を挿入する。また、上から29行目の“next_state=”の後ろに遷移325の遷移先である状態311に対応する“STATE1”を挿入する。   A code executed when the state is determined to be “STATE 3” will be described. The source code generation means 120 searches for which state the arrow extending from the state 313 extends. In the display example 300, transitions 324 and 325 are displayed from the state 313 to the states 311 and 312. That is, the state 313 transits to the state 311 and the state 312. In addition, the source code generation unit 120 reads the label 334 associated with the transition 324. Then, an event 344 and a guard condition 354 are inserted at predetermined positions in the line starting from “if” as shown in the 23rd line from the top of the program source code 202. Also, an action expression 364 is inserted in the 24th line from the top. Also, “STATE 2” corresponding to the state 312 that is the transition destination of the transition 324 is inserted after “next_state =” on the 25th line from the top. Further, the source code generation unit 120 reads the label 335 associated with the transition 325. Then, an event 345 and a guard condition 355 are inserted at predetermined positions on the line starting from “else if” as shown in the 27th line from the top. Also, an action expression 365 is inserted in the 28th line from the top. Also, “STATE 1” corresponding to the state 311 that is the transition destination of the transition 325 is inserted after “next_state =” on the 29th line from the top.

また、状態が“STATE1”、“STATE2”、および“STATE3”以外の状態と判定したときに実行するコードについて説明する。例外処理埋込手段130は、例外処理受付手段112が受け付けた、例外アクティビティ370に記載された例外処理ソースコードを読み取る。そして、ソースコード生成手段120が生成した生成ソースコードにある、いわゆる“switch文”の最後に“default文”を挿入する。このようにすることによって、“case文”に定義されている“STATE1”、“STATE2”、および“STATE3”以外の状態になったときには下から8行目からの“default文”が実行されることになる。つまり、定義されている状態以外の状態になったときに例外処理が行われることになる。   In addition, a code that is executed when it is determined that the state is other than “STATE 1”, “STATE 2”, and “STATE 3” will be described. The exception processing embedding unit 130 reads the exception processing source code described in the exception activity 370 received by the exception processing receiving unit 112. Then, a “default statement” is inserted at the end of the so-called “switch statement” in the generated source code generated by the source code generation unit 120. In this way, when a state other than “STATE1”, “STATE2”, and “STATE3” defined in the “case statement” is entered, the “default statement” from the eighth line from the bottom is executed. It will be. That is, exception handling is performed when a state other than the defined state is entered.

以上のようなプログラム自動生成装置100を用いることにより、例外アクティビティ370に記載した例外処理ソースコードが、ソースコード生成手段120が生成した生成ソースコードに自動で挿入されるので、新たに生成されたプログラムソースコード200には想定されている状態以外の状態になっても例外処理が行われることになる。つまり、例外処理がないと問題がある場合であるか否かに関係なくプログラムを自動で生成することができる。また、例外処理を人手で追加しなくてもよくなる。したがって、プログラムを自動で生成するメリットが向上する。   By using the automatic program generation device 100 as described above, the exception processing source code described in the exception activity 370 is automatically inserted into the generated source code generated by the source code generating unit 120, so that it is newly generated. Even if the program source code 200 enters a state other than the assumed state, exception processing is performed. That is, the program can be automatically generated regardless of whether there is a problem if there is no exception handling. Also, it is not necessary to add exception handling manually. Therefore, the merit of automatically generating the program is improved.

なお、図6において、入力手段12を介して入力されたデータをデータ受付手段110が受け付け、モニタ11に出力したときの表示例を表示例300として示した。しかし、表示例300のように例外アクティビティ370を必ずしも図形式データの一部として取り扱う必要はない。そこで、図形式データの属性として取り扱う場合の表示例を図8に示す。   In FIG. 6, a display example is shown as a display example 300 when the data receiving unit 110 receives data input via the input unit 12 and outputs the data to the monitor 11. However, unlike the display example 300, the exception activity 370 is not necessarily handled as a part of the graphic data. Therefore, FIG. 8 shows a display example in the case of handling it as an attribute of diagram format data.

図8は、データ受付手段が受け付けたデータの表示の別の例を示す図である。
表示例301には、図形データ表示部302と図面属性表示部303が表示されている。また、図面属性表示部303には、例外アクティビティ371が表示されている。図形データ表示部302は、図形データである状態遷移図を表示する。また、図面属性表示部303は、図形データ表示部302に表示されている状態遷移図の属性を表示する。その属性として例外アクティビティ371が表示されている。例外アクティビティ371に例外処理ソースコードを入力することによって、図形データ表示部302に表示されている状態遷移図の例外処理を行えるようにしてもよい。
FIG. 8 is a diagram illustrating another example of the display of data received by the data receiving unit.
In the display example 301, a graphic data display unit 302 and a drawing attribute display unit 303 are displayed. Further, an exceptional activity 371 is displayed in the drawing attribute display unit 303. The graphic data display unit 302 displays a state transition diagram that is graphic data. The drawing attribute display unit 303 displays the attributes of the state transition diagram displayed on the graphic data display unit 302. An exception activity 371 is displayed as the attribute. By inputting an exception processing source code to the exception activity 371, exception processing of the state transition diagram displayed on the graphic data display unit 302 may be performed.

このように、例外処理ソースコードを状態遷移図の属性データとして扱うことにより、例外アクティビティ371に入力した例外処理ソースコードを他の状態遷移図の例外処理のための例外処理ソースコードとして使うこともできる。したがって、状態遷移図を生成するたびに例外処理ソースコードを入力することなく例外処理を含んだプログラムソースコード200を生成することができ、さらにプログラムを自動で生成するメリットが向上する。   As described above, by handling the exception processing source code as the attribute data of the state transition diagram, the exception processing source code input to the exception activity 371 may be used as the exception processing source code for exception processing of another state transition diagram. it can. Therefore, it is possible to generate the program source code 200 including the exception processing without inputting the exception processing source code every time the state transition diagram is generated, and further improve the merit of automatically generating the program.

また、例外アクティビティから入力手段を介して例外処理ソースコードを入力する旨を説明したが、例外処理ソースコードをプログラム自動生成装置とは別個に作成して、できあがった例外処理ソースコードを、たとえば、記録装置などに格納し、プログラム自動生成装置がその記録媒体を読み取ることによって例外処理ソースコードを受け取ってもよい。また、ネットワークを介して例外処理のソースコードを受け取ってもよい。その場合には、図2に示したハードウェアにネットワークインタフェースなどを設ける。   Also, the exception processing source code is input from the exception activity via the input means. However, the exception processing source code is created separately from the program automatic generation device, and the resulting exception processing source code is, for example, The exception processing source code may be received by being stored in a recording device or the like, and the automatic program generation device reading the recording medium. Also, exception processing source code may be received via a network. In that case, a network interface or the like is provided in the hardware shown in FIG.

本実施の形態に適用される発明の概念図である。It is a conceptual diagram of the invention applied to this Embodiment. 本実施の形態に用いるプログラム自動生成装置のハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the program automatic generation apparatus used for this Embodiment. 本実施の形態のプログラム自動生成装置によるプログラムを自動生成する自動生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the automatic generation process which automatically produces | generates the program by the program automatic generation apparatus of this Embodiment. 本実施の形態のプログラム自動生成装置が生成したプログラムの振る舞いを示すフローチャートである。It is a flowchart which shows the behavior of the program which the program automatic generation apparatus of this Embodiment produced | generated. 本実施の形態のプログラム自動生成装置が生成したプログラムソースコードの概略を示す図である。It is a figure which shows the outline of the program source code which the program automatic generation apparatus of this Embodiment produced | generated. データ受付手段が受け付けたデータの表示の一例を示す図である。It is a figure which shows an example of the display of the data which the data reception means received. 本実施の形態のプログラム自動生成装置が生成したプログラムソースコードの内容の一例を示す図である。It is a figure which shows an example of the content of the program source code which the program automatic generation apparatus of this Embodiment produced | generated. データ受付手段が受け付けたデータの表示の別の例を示す図である。It is a figure which shows another example of the display of the data which the data reception means received. 従来のプログラム自動生成装置によるプログラムを自動生成する自動生成処理の手順を示すフローチャートである。It is a flowchart which shows the procedure of the automatic generation process which automatically generates the program by the conventional program automatic generation apparatus. 従来のプログラム自動生成装置で生成されたプログラムの振る舞いを示すフローチャートである。It is a flowchart which shows the behavior of the program produced | generated by the conventional program automatic generation apparatus. 従来のプログラム自動生成装置が生成したプログラムソースコードの内容の概略を示す図である。It is a figure which shows the outline of the content of the program source code which the conventional program automatic generation apparatus produced | generated.

符号の説明Explanation of symbols

11 モニタ
12 入力手段
100 プログラム自動生成装置
110 データ受付手段
111 図形式データ生成手段
112 例外処理受付手段
120 ソースコード生成手段
130 例外処理埋込手段
200 プログラムソースコード
DESCRIPTION OF SYMBOLS 11 Monitor 12 Input means 100 Program automatic generation apparatus 110 Data reception means 111 Diagram format data generation means 112 Exception processing reception means 120 Source code generation means 130 Exception processing embedding means 200 Program source code

Claims (8)

プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成装置において、
ユーザからの指示を受けて、前記図形式データを生成する図形式データ生成手段と、
前記図形式データからコンパイル可能なプログラムソースコードを生成するソースコード生成手段と、
前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける例外処理受付手段と、
前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する例外処理埋込手段と、
を有することを特徴とするプログラム自動生成装置。
In an automatic program generation device that generates a program from diagram data representing the behavior of the program in diagram format,
In response to an instruction from the user, graphic data generation means for generating the graphic data,
Source code generation means for generating a compilable program source code from the graphic data;
Exception processing receiving means for receiving source code of exception processing to be performed when different from any state defined in the diagram format data;
Exception processing embedding means for embedding the exception processing source code in the program source code and outputting as a new program source code;
An apparatus for automatically generating a program, comprising:
前記例外処理受付手段は、前記例外処理のソースコードを前記図形式データの要素として取り扱うことを特徴とする請求項1記載のプログラム自動生成装置。   2. The automatic program generation apparatus according to claim 1, wherein the exception process accepting unit handles the source code of the exception process as an element of the graphic data. 前記例外処理受付手段は、前記例外処理のソースコードを前記図形式データの属性として取り扱うことを特徴とする請求項1記載のプログラム自動生成装置。   2. The automatic program generation apparatus according to claim 1, wherein the exception process accepting unit handles the source code of the exception process as an attribute of the graphic data. 前記例外処理受付手段は、ユーザから手入力で入力された前記例外処理のソースコードを受け付けることを特徴とする請求項1記載のプログラム自動生成装置。   The automatic program generation apparatus according to claim 1, wherein the exception process accepting unit accepts a source code of the exception process manually input by a user. 前記例外処理受付手段は、あらかじめ作成された前記例外処理のソースコードを受け付けることを特徴とする請求項1記載のプログラム自動生成装置。   2. The automatic program generation apparatus according to claim 1, wherein the exception process accepting unit accepts a source code of the exception process created in advance. 前記例外処理受付手段は、記録媒体に記録された前記例外処理のソースコードを受け付けることを特徴とする請求項1記載のプログラム自動生成装置。   2. The automatic program generation apparatus according to claim 1, wherein the exception process accepting unit accepts a source code of the exception process recorded on a recording medium. プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成方法において、
図形式データ生成手段が、ユーザからの指示を受けて、前記図形式データを生成するステップと、
ソースコード生成手段が、前記図形式データからコンパイル可能なプログラムソースコードを生成するステップと、
例外処理受付手段が、前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付けるステップと、
例外処理埋込手段が、前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力するステップと、
を含むことを特徴とするプログラム自動生成方法。
In an automatic program generation method for generating a program from diagram data representing the behavior of the program in diagram format,
A step of generating graphic data in response to an instruction from a user;
Source code generation means for generating compilable program source code from the diagram data;
A step of receiving an exception processing source code when the exception processing receiving means is different from any state defined in the graphic data;
An exception processing embedding unit embeds the source code of the exception processing in the program source code and outputs it as a new program source code;
A method for automatically generating a program, comprising:
プログラムの振る舞いを図形式で表現した図形式データからプログラムを生成するプログラム自動生成プログラムにおいて、
コンピュータに、
ユーザからの指示を受けて、前記図形式データを生成する図形式データ生成手段と、
前記図形式データからコンパイル可能なプログラムソースコードを生成するソースコード生成手段、
前記図形式データで定義されたどの状態とも異なっている場合に行う例外処理のソースコードを受け付ける例外処理受付手段、
前記プログラムソースコードに前記例外処理のソースコードを埋め込み、新たなプログラムソースコードとして出力する例外処理埋込手段、
として機能させることを特徴とするプログラム自動生成プログラム。
In an automatic program generation program that generates a program from diagram format data that represents the behavior of the program in diagram format,
On the computer,
In response to an instruction from the user, graphic data generation means for generating the graphic data,
Source code generating means for generating compilable program source code from the diagram format data;
Exception processing receiving means for receiving source code of exception processing performed when different from any state defined in the diagram format data,
Exception processing embedding means for embedding the exception processing source code in the program source code and outputting as a new program source code;
An automatic program generation program characterized in that it functions as a program.
JP2005285802A 2005-09-30 2005-09-30 Automatic program generation, method, and program Pending JP2007094922A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005285802A JP2007094922A (en) 2005-09-30 2005-09-30 Automatic program generation, method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005285802A JP2007094922A (en) 2005-09-30 2005-09-30 Automatic program generation, method, and program

Publications (1)

Publication Number Publication Date
JP2007094922A true JP2007094922A (en) 2007-04-12

Family

ID=37980537

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005285802A Pending JP2007094922A (en) 2005-09-30 2005-09-30 Automatic program generation, method, and program

Country Status (1)

Country Link
JP (1) JP2007094922A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014060595A (en) * 2012-09-18 2014-04-03 Mitsubishi Electric Corp Message sequence generation method and message sequence generation device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60178795A (en) * 1984-02-24 1985-09-12 Fujitsu Ltd Condition transition processing system
JPH06332689A (en) * 1993-05-21 1994-12-02 Hitachi Ltd Program displaying method and program edition accepting method
JPH0778076A (en) * 1993-09-08 1995-03-20 Toshiba Corp Automatic program generating device
JPH1091411A (en) * 1996-09-18 1998-04-10 Hitachi Ltd Source program generation system
JP2003256203A (en) * 2002-03-01 2003-09-10 Mitsubishi Electric Corp System and method for developing automatic machine application program, program for executing the method and storage medium stored with the program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60178795A (en) * 1984-02-24 1985-09-12 Fujitsu Ltd Condition transition processing system
JPH06332689A (en) * 1993-05-21 1994-12-02 Hitachi Ltd Program displaying method and program edition accepting method
JPH0778076A (en) * 1993-09-08 1995-03-20 Toshiba Corp Automatic program generating device
JPH1091411A (en) * 1996-09-18 1998-04-10 Hitachi Ltd Source program generation system
JP2003256203A (en) * 2002-03-01 2003-09-10 Mitsubishi Electric Corp System and method for developing automatic machine application program, program for executing the method and storage medium stored with the program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014060595A (en) * 2012-09-18 2014-04-03 Mitsubishi Electric Corp Message sequence generation method and message sequence generation device

Similar Documents

Publication Publication Date Title
KR101238550B1 (en) Method and computer-readable medium for commanding
US8201143B2 (en) Dynamic mating of a modified user interface with pre-modified user interface code library
US8792116B2 (en) Printing controller, GUI display method, printer driver, and recording medium
US8797335B2 (en) Platform agnostic screen capture tool
KR20120026055A (en) Displaying transition images during a slide transition
JP2007293548A (en) Information processor and information processing method
JP2006301989A (en) Method, apparatus and program for automatically generating program in computer language from block diagram
JP5086296B2 (en) Programmable controller control program creation method and programmable controller control program creation system
JP2007094922A (en) Automatic program generation, method, and program
JP2007012037A (en) Information processor, display control processing method and program
US20180373512A1 (en) Method and device for simulating synchronous blocking in asynchronous environment, storage medium, server and terminal
JP2007287025A (en) Method and apparatus for creating screen transition program
JP2009211622A (en) Contract definition function verification device, method thereof, and program thereof
JP2007034825A (en) Debugging device
JP2006285754A (en) Program source code automatic generation system
JP5702265B2 (en) Program automatic generation apparatus and program automatic generation method
JP2008299423A (en) Information processor and information processing program
JP3544462B2 (en) Source program analysis device and computer-readable recording medium storing source program analysis program
JP2007219893A (en) Firmware evaluation system and firmware evaluation method
WO2022249358A1 (en) Robot control device and robot control system
KR102000543B1 (en) Apparatus for editing web electric document and operating method thereof
JP2010026968A (en) Circuit generation support program and circuit generation support method
JP2011128864A (en) Data processor, and data processing method and program
JP2006172003A (en) Program execution monitoring device, program execution monitoring method and program preparing method
JP2009015579A (en) Information processor and window display method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080916

A977 Report on retrieval

Effective date: 20110513

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110524

A02 Decision of refusal

Effective date: 20111004

Free format text: JAPANESE INTERMEDIATE CODE: A02