JP2016201009A - Source code generation system, source code generation apparatus, source code generation method, and program - Google Patents
Source code generation system, source code generation apparatus, source code generation method, and program Download PDFInfo
- Publication number
- JP2016201009A JP2016201009A JP2015081441A JP2015081441A JP2016201009A JP 2016201009 A JP2016201009 A JP 2016201009A JP 2015081441 A JP2015081441 A JP 2015081441A JP 2015081441 A JP2015081441 A JP 2015081441A JP 2016201009 A JP2016201009 A JP 2016201009A
- Authority
- JP
- Japan
- Prior art keywords
- source code
- item
- processing
- exception
- generation unit
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims description 198
- 238000012545 processing Methods 0.000 claims abstract description 128
- 230000008569 process Effects 0.000 claims description 165
- 230000006870 function Effects 0.000 description 205
- 230000006399 behavior Effects 0.000 description 115
- 238000010586 diagram Methods 0.000 description 14
- 238000004891 communication Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 101000836337 Homo sapiens Probable helicase senataxin Proteins 0.000 description 4
- 102100027178 Probable helicase senataxin Human genes 0.000 description 4
- 238000013461 design Methods 0.000 description 4
- 230000004913 activation Effects 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 239000011800 void material Substances 0.000 description 2
- 210000000707 wrist Anatomy 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000007430 reference method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明は、ソースコード生成システム、ソースコード生成装置、ソースコード生成方法及びプログラムに関する。 The present invention relates to a source code generation system, a source code generation device, a source code generation method, and a program.
代表的なモデル記述言語であるUML(Unified Modeling Language)では、静的モデルとしてクラス図、動的モデルとして状態遷移図、シーケンス図、アクティビティ図などがある。標準で規定されているのは、個々の図で利用するモデル要素、すなわちクラスの箱や状態の書き方、条件の書き方のみであり、記載する内容や図間の整合性などは設計者に委ねられている。 In UML (Unified Modeling Language), which is a typical model description language, there are a class diagram as a static model, a state transition diagram, a sequence diagram, and an activity diagram as a dynamic model. The standard specifies only the model elements used in individual diagrams, that is, how to write class boxes and states, and how to write conditions. The contents to be described and the consistency between diagrams are left to the designer. ing.
組込み製品においては、センサ、ディスプレイ等のハードウェア機器上で発生する故障、異常等の「例外」事象に対応したソフトウェアの例外処理が重要であるが、UMLでの記載方法は定まっていない。
また、ユースケ―ス分析において、ユースケース記述の中のシナリオの1つとしてユースケース図が記述される場合がある。しかし、ユースケース図は要求レベルの形式化されていないテキストであるため、コード生成するには、詳細設計レベルの設計情報との紐付けとコード生成の作り込みが必要であり、作成に時間がかかっている。
In an embedded product, software exception handling corresponding to an “exception” event such as a failure or abnormality occurring on a hardware device such as a sensor or a display is important, but a description method in UML has not been determined.
In use case analysis, a use case diagram may be described as one of the scenarios in the use case description. However, because use case diagrams are unformatted text at the required level, code generation requires linkage with design information at the detailed design level and creation of code generation. It depends.
また、機能実行中の割込みに対応して「処理の優先度」に応じた実行制御を行う必要があり、一般的には、タスクの競合分析により、タスク単位で競合関係をマトリクスで整理する場合がある。タスクは、ソフトウェア設計レベルのデータであり、例外処理と同様に、詳細設計レベルの設計情報との紐付けとコード生成の作り込みが必要である。 In addition, it is necessary to perform execution control according to the "processing priority" corresponding to the interrupt during function execution. Generally, when competing relations are organized in units of tasks by task conflict analysis There is. The task is data at the software design level, and it is necessary to link with the design information at the detailed design level and to create a code as in the exception processing.
特許文献1では、例外処理を定義して、自動的にソースコードに埋め込むことが可能である。
また、特許文献2では、階層化された機能項目ごとに、優先順位を記入するようにして、その実行優先順位情報に基づいて、ソースコードを実行することが可能である。
In
Further, in
特許文献1では、状態遷移図をインプットとして、定義された状態以外になった場合の1つの条件分岐文、すなわちifに対するelseなどを出力することができるが、複数パターンの例外処理の分岐を出力することはできないという課題があった。
In
本発明では、すべての例外事象の条件分岐を表すソースコードを出力することを目的とする。 An object of the present invention is to output source code representing conditional branches of all exception events.
本発明に係るソースコード生成システムは、
処理の項目を表す処理項目と、前記処理項目に含まれる操作を表す操作情報と、例外処理を表す例外処理情報とを含む処理項目リストを記憶する処理項目リスト記憶部と、
前記処理項目リストに基づいて記述された前記処理項目の振舞いを記述する振舞い記述情報を記憶する振舞い記述情報記憶部と、
前記処理項目を用いて、クラスを定義するソースコードを生成する振舞い記述生成部と、
前記操作情報を用いて、前記操作を定義するソースコードを生成する操作生成部と、
前記例外処理情報を用いて、前記操作の実行中に発生する前記例外処理を表すソースコードを生成する例外記述生成部と、
前記振舞い記述情報を用いて、前記操作の条件分岐を表すソースコードを生成する条件記述生成部と、
前記振舞い記述情報を用いて、前記操作の処理内容を表すソースコードを生成する処理記述生成部とを備える。
A source code generation system according to the present invention includes:
A process item list storage unit that stores a process item list that includes a process item that represents a process item, operation information that represents an operation included in the process item, and exception process information that represents an exception process;
A behavior description information storage unit that stores behavior description information that describes the behavior of the processing item described based on the processing item list;
A behavior description generator for generating a source code defining a class using the processing items;
Using the operation information, an operation generation unit that generates a source code that defines the operation;
Using the exception handling information, an exception description generator for generating source code representing the exception handling that occurs during execution of the operation;
Using the behavior description information, a condition description generation unit that generates a source code representing a conditional branch of the operation;
A processing description generating unit that generates source code representing the processing content of the operation using the behavior description information;
本発明に係るソースコード生成システムは、処理項目と操作情報と例外処理情報とを含む処理項目リストを記憶する処理項目リスト記憶部と、処理項目リストに基づいて記述された処理項目の振舞いを記述する振舞い記述情報を記憶する振舞い記述情報記憶部と、処理項目を用いて、クラスを定義するソースコードを生成する振舞い記述生成部と、操作情報を用いて、操作を定義するソースコードを生成する操作生成部と、例外処理情報を用いて、操作の実行中に発生する例外処理を表すソースコードを生成する例外記述生成部とを備えるので、操作時に発生する例外処理を表すソースコードを生成することができる。 A source code generation system according to the present invention describes a processing item list storage unit that stores a processing item list including processing items, operation information, and exception processing information, and describes the behavior of the processing items described based on the processing item list A behavior description information storage unit for storing behavior description information to be generated, a behavior description generation unit for generating a source code for defining a class using process items, and a source code for defining an operation using operation information Since it includes an operation generation unit and an exception description generation unit that generates source code representing exception processing that occurs during execution of an operation using exception processing information, source code that represents exception processing that occurs during an operation is generated be able to.
実施の形態1.
図1を用いて、本実施の形態に係るソースコード生成装置20のブロック構成について説明する。
本実施の形態では、物理項目に対して発生しうる例外事象と機能項目に対する処理の優先度と仕様記述方法とコード生成方法とを示す。
A block configuration of the source
In the present embodiment, exception events that may occur for physical items, processing priorities for function items, specification description methods, and code generation methods are shown.
***構成の説明***
ソースコード生成システム800は、処理項目リスト記憶部1071、振舞い記述情報記憶部1081、ソースコード生成装置20、ソースコード30を有する。
ソースコード生成装置20は、取得部40とソースコード生成部50と優先度制御生成部60とを有する。
取得部40は、物理項目リスト102、機能項目リスト103、物理項目の振舞い記述104、機能項目の振舞い記述105を入力とする。
*** Explanation of configuration ***
The source code generation system 800 includes a processing item list storage unit 1071, a behavior description information storage unit 1081, a source
The source
The
物理項目リスト102、機能項目リスト103は、処理項目リスト107の例である。
物理項目の振舞い記述104、機能項目の振舞い記述105は、振舞い記述情報108の例である。
The
The physical
処理項目リスト記憶部1071は、処理の項目を表す処理項目1072と、処理項目1072に含まれる操作を表す操作情報1073と、例外処理を表す例外処理情報1074とを含む処理項目リスト107を記憶する。処理項目リスト記憶部1071は、処理項目リスト107として、物理項目リスト102と機能項目リスト103とを記憶する。
The process item list storage unit 1071 stores a process item list 107 including a process item 1072 representing a process item, operation information 1073 representing an operation included in the process item 1072, and exception process information 1074 representing an exception process. . The processing item list storage unit 1071 stores the
振舞い記述情報記憶部1081は、処理項目リスト107に基づいて記述された処理項目1072の振舞いを記述する振舞い記述情報108を記憶する。振舞い記述情報記憶部1081は、振舞い記述情報108として、物理項目の振舞い記述104と機能項目の振舞い記述105とを記憶する。
処理項目リスト107は、操作として複数の操作1073aを表す操作情報1073を有する。
The behavior description information storage unit 1081 stores behavior description information 108 that describes the behavior of the processing item 1072 described based on the processing item list 107. The behavior description information storage unit 1081 stores a physical
The process item list 107 includes operation information 1073 representing a plurality of
ソースコード生成部50は、振舞い記述生成部501、操作生成部502、例外記述生成部503、条件記述生成部504、処理記述生成部505を有する。
振舞い記述生成部501は、処理項目1072を用いて、クラスを定義するソースコードを生成する。
操作生成部502は、操作情報1073を用いて、操作を定義するソースコードを生成する。操作生成部502は、複数の操作の各操作を定義するソースコードを生成する。
例外記述生成部503は、例外処理情報1074を用いて、操作の実行中に発生する例外処理を表すソースコードを生成する。例外記述生成部503は、複数の操作の各操作を定義するソースコードに対して例外処理を表すソースコードを割り付ける。
条件記述生成部504は、振舞い記述情報108を用いて、操作の条件分岐を表すソースコードを生成する。
処理記述生成部505は、振舞い記述情報108を用いて、操作の処理内容を表すソースコードを生成する。
The source
The behavior
The
The exception
The condition
The process
各構成部についてさらに詳しく説明する。
振舞い記述生成部501は、物理項目リスト102および機能項目リスト103で定義された全ての物理項目および機能項目毎に1つのクラスを生成する。ここでクラスとは、ソースコードの形式で生成されたものである。クラスの名称には、物理項目および機能項目毎、すなわち処理項目1072毎に定義したラベル名を使用する。
次に、物理項目リスト102および機能項目リスト103、すなわち処理項目リスト107で、自項目の上位階層項目が定義されているものについては、その上位階層の項目から生成されたクラスと親子関係があることを示す継承コードを生成する。振舞い記述生成部501は、生成した継承コードをソースコードの形式で生成されたクラスに追記する。
Each component will be described in more detail.
The behavior
Next, in the
操作生成部502は、物理項目リスト102および機能項目リスト103で定義された全ての操作毎に1つのメソッドを生成し、当該操作が属する機能のクラス内に配置する。ここでメソッドとは、ソースコードの形式で生成されたものである。メソッドの名称には、操作毎に定義したラベル名を使用する。メソッドのソースコードを生成するとは、操作を定義するソースコードを生成することである。
The
例外記述生成部503は、物理項目リスト102で定義された例外毎に例外コードを生成し、その例外が属する物理項目のすべてのメソッドに例外コードを配置する。
The exception
条件記述生成部504は、物理項目の振舞い記述104および機能項目の振舞い記述105、すなわち振舞い記述情報108で定義された全ての条件記述について、同じ内容となるif文を生成する。ここでif文の判定対象として使用する属性名称は、物理項目リスト102または機能項目リスト103において属性名称とラベルを対にして定義しており、ソースコードには当該ラベルを使用する。また、生成したif文は、物理項目の振舞い記述104および機能項目の振舞い記述105で定義した操作のソースコード内にて、記述した順番通りに配置する。
The condition
処理記述生成部505では、物理項目の振舞い記述104および機能項目の振舞い記述105で定義された全ての処理記述について、同じ内容となる制御文を生成する。制御文内で使用する属性名称は、物理項目リスト102または機能項目リスト103において属性名称とラベルを対にして定義しており、ソースコードには当該ラベルを使用する。また、生成した制御文は、物理項目の振舞い記述104および機能項目の振舞い記述105で定義した操作のソースコード内にて、記述した順番通りに配置する。
The process
優先度制御生成部60は、処理項目1072の各々に設定された優先度1075に基づいて、実行中の処理項目の優先度と実行が要求された処理項目の優先度とを比較し、優先度が高い方の処理項目を実行する優先度制御機能を有する優先度制御ソースコード303を生成する。
なお、優先度制御生成部60は無くてもよく、機能の優先順位の制御プログラムを各機能のソースコードに持つ構成でも構わない。
The priority
Note that the priority
図2を用いて、本実施の形態に係るソースコード生成システム800における仕様記述からソースコード生成までの流れについて説明する。
仕様が記述されたインプット仕様書101から、ハードウェアを抽出し、故障、電源断、異常値検出などの発生する可能性のある例外項目の定義を物理項目リスト102に列挙する。また、インプット仕様書101から、ソフトウェアの機能を抽出し、優先度の定義を機能項目リスト103に列挙する。
A flow from specification description to source code generation in the source code generation system 800 according to the present embodiment will be described with reference to FIG.
The hardware is extracted from the
物理項目リスト102の項目ごとに、物理項目の振舞い記述104に日本語の振舞い記述言語により、例外発生時の例外と振舞いを定義する。
機能項目リスト103の項目ごとに、機能の振舞いの定義を機能項目の振舞い記述105に記述する。
For each item in the
For each item in the
ソースコード生成装置20に、物理項目リスト102、物理項目の振舞い記述104、機能項目リスト103、機能項目の振舞い記述105を入力して、物理項目クラス301、機能項目クラス302のソースコード30を生成する。
The
図3を用いて、本実施の形態に係る物理項目リスト102の具体例及び作成の手順について説明する。物理項目リスト102では、ハードウェアの項目を階層化して表記する。
A specific example and creation procedure of the
物理項目は、処理の項目であるクラスを表す処理項目1072の例である。
物理項目リスト102、すなわち処理項目リスト107は、処理項目1072として、複数の処理項目1072aを有する。また、複数の処理項目1072aの各々が上位の階層である親処理項目10721を有する。最上位の処理項目には親処理項目はない。
具体的には、物理項目リスト102には、物理項目ごとに、物理名称である名称とソースコード生成時に用いるラベルとを階層的に記載する。階層が下になるほど物理項目を詳細化する。
物理項目の名称として、センサの階層の下にセンサ1とセンサ2とを記載し、物理項目のラベルとして、センサに対応するSensor、センサ1に対応するSen1、センサ2に対応するSen2と記載する。
例えば、センサが親物理項目、すなわち親処理項目10721であり、センサ1、センサ2が子物理項目、すなわち子処理項目10722となる。
The physical item is an example of a processing item 1072 that represents a class that is a processing item.
The
Specifically, in the
As the names of the physical items,
For example, the sensor is a parent physical item, that is, a parent processing item 10721, and the
また、物理項目ごとに操作の名称、操作のラベルを記載する。図3では、センサ1の操作の名称として、起動と値取得を記載し、それぞれのラベルOpeY,OpeZを記載する。
In addition, an operation name and an operation label are described for each physical item. In FIG. 3, activation and value acquisition are described as names of operations of the
それぞれの操作に対して、属性の名称、属性のラベル、属性の範囲、属性の初期値を記載する。すべての操作に共通する属性は、どの操作にも属さない行に記載する。図3では「起動」と、「値取得」という名称の操作に対して共通する、電源状態という属性の名称を記載している。「電源状態」という属性の名称に対して、ラベルをAttrN、範囲をPOWERONとPOWEROFFとした。 For each operation, the attribute name, attribute label, attribute range, and initial attribute value are described. Attributes common to all operations are listed on lines that do not belong to any operation. In FIG. 3, the name of the attribute called the power supply state common to the operations called “startup” and “value acquisition” is shown. For the attribute name “power state”, the label is AttrN and the range is POWERON and POWEROFF.
物理項目に対して例外項目がある場合は、例外の名称と例外のラベルとを記載する。図3では、「センサ1」という物理項目の名称に対して、「電源断」という例外の名称と、POWEROffEventという例外のラベルを記載している。
If there is an exception item for the physical item, describe the exception name and exception label. In FIG. 3, for the name of the physical item “
図4を用いて、本実施の形態に係る物理項目の振舞い記述104の具体例及び作成の手順について説明する。
物理項目リスト102の物理項目ごとに、物理項目の振舞い記述104を作成する。図4では「センサ1」についての振舞い記述を記載した。
物理項目の振舞い記述104では、物理項目の名称、概要、目的を記載したあと、物理項目の振舞い記述を記載する。
A specific example of the physical
A physical
The physical
物理項目リスト102において、振舞い記述の作成対象である物理項目に、例外処理があれば、[]のカッコの中に例外の名称を記載する。
また、処理を表す処理記述は先頭に・をつける。
図4では、「電源断」という例外処理が起きた場合、電源状態をPOWEROFFにするという処理を記述している。
また、操作に対しては<>のカッコで表し、<>のカッコの中に操作の名称を記載する。
In the
In addition, a process description representing a process is prefixed with.
FIG. 4 describes a process of setting the power state to POWER OFF when an exceptional process of “power failure” occurs.
In addition, operations are represented by parentheses <>, and the name of the operation is described in parentheses <>.
図5を用いて、本実施の形態に係る機能項目リスト103の具体例及び作成の手順について説明する。機能項目リスト103では、システムに要求される機能を階層化して表記する。
機能項目は、処理の項目であるクラスを表す処理項目1072の例である。
機能項目リスト103、すなわち処理項目リスト107は、処理項目として、複数の処理項目を有し、複数の処理項目の各々に優先度1075が設定される。また、複数の処理項目の各々が上位の階層である親処理項目を有する。最上位の処理項目には親処理項目はない。以下で説明する優先レベルは、優先度1075の例である。
A specific example of the
The function item is an example of a processing item 1072 that represents a class that is a processing item.
The
機能項目リスト103では、まずシステムが要求する機能を抽出する。そして、抽出した各機能を大分類・中分類・小分類というように階層的に整理する。階層の深さに制限を設ける必要は無く、また機能により階層の深さが異なっていても良い。
図5の例では、機能項目の欄に、上位階層から順に機能の名称が設定される。大分類が機能A、中分類が機能A1及び機能A2と設定されている。また、大分類が機能B、中分類が機能B1及び機能B2、機能B2の小分類として機能B21及び機能B22と設定されている。なお、ここで機能の名称に使用する名前、すなわち文字列に制限は無い。
例えば、機能Aが親機能項目、すなわち親処理項目であり、機能A1、機能A2が子機能項目、すなわち子処理項目となる。また、子機能項目、すなわち子処理項目を機能B21、機能B22とすると、親機能項目、すなわち親処理項目は機能B2である。
In the
In the example of FIG. 5, function names are set in the function item column in order from the upper layer. The major classification is set as function A, and the middle classification is set as function A1 and function A2. Further, the major classification is set as function B, the middle classification is set as function B1 and function B2, and the minor classification of function B2 is set as function B21 and function B22. In addition, there is no restriction | limiting in the name used for the name of a function here, ie, a character string.
For example, function A is a parent function item, that is, a parent process item, and function A1 and function A2 are child function items, that is, a child process item. If the child function items, that is, the child process items are the function B21 and the function B22, the parent function item, that is, the parent process item is the function B2.
次に、各機能についてシステムが要求する優先度1075を検討する。この優先度1075とは、同じ階層に分類した機能同士の実行優先度を指している。図5の例では、機能Aと機能Bの優先レベルは、それぞれ1と2であるため、機能Aの優先度が機能Bの優先度よりも高いことになる。
上記優先度は、上位階層の機能が同じである機能同士では固有の値を指定する必要がある。一方、上位階層が異なる機能同士では優先度の値が重複しても良い。図5の例では、上位階層が機能Aである中分類の機能A1と機能A2との優先レベルは、それぞれ1と2である。また、同じ中分類であるが上位階層が機能Bである中分類の機能B1と機能B2との優先レベルについても、それぞれ1と2とが設定されている。
Next, the priority 1075 required by the system for each function is considered. The priority 1075 indicates an execution priority between functions classified in the same hierarchy. In the example of FIG. 5, the priority levels of the function A and the function B are 1 and 2, respectively. Therefore, the priority of the function A is higher than the priority of the function B.
As the priority, it is necessary to specify a unique value between functions having the same upper layer function. On the other hand, priority values may be duplicated between functions having different upper layers. In the example of FIG. 5, the priority levels of the middle-class function A1 and function A2 whose upper layer is function A are 1 and 2, respectively. In addition, 1 and 2 are set for the priority levels of the functions B1 and B2 of the medium classification whose functions are the same middle class but whose upper layer is the function B, respectively.
次に、各機能にラベルを設定する。これは、ソースコード生成の際、クラス名に使用される。そのため、生成するコードのプログラミング言語仕様に則った命名をする必要がある。 Next, a label is set for each function. This is used for the class name when generating the source code. Therefore, it is necessary to name the generated code according to the programming language specification.
続いて、機能項目リスト103の作成において定義した各機能の具体的な仕様を機能仕様として定義する。機能仕様は操作情報1073の例である。機能仕様には、大きく分けて操作と属性がある。
Subsequently, a specific specification of each function defined in the creation of the
まず操作の項目では、各機能において必要となる処理内容を抽出し、その処理に対して名称を付ける。この名称は、一つの機能内で固有である必要がある。
次に、抽出した各操作にラベルを設定する。これは、ソースコード生成の際、メソッド名に使用される。そのため、生成するコードのプログラミング言語仕様に則った命名をする必要がある。
First, in the operation item, the processing contents necessary for each function are extracted, and a name is given to the processing. This name must be unique within a function.
Next, a label is set for each extracted operation. This is used for the method name when generating the source code. Therefore, it is necessary to name the generated code according to the programming language specification.
次に属性の項目では、各操作で使用するデータを抽出し、抽出したデータに対して名称を付ける。抽出したデータに対して付する名称は、一つの操作内で固有である必要がある。
抽出した各属性にラベルを設定する。このラベルは、ソースコード生成の際、フィールド名に使用される。そのため、生成するコードのプログラミング言語仕様に則った命名をする必要がある。
また、抽出した各属性の値域を範囲に設定する。これは、ソースコード生成の際、フィールドの値域に使用される。そのため、フィールドとして存在しえない範囲の値は設定できない。
さらに、抽出した各属性の初期値を設定する。これは、ソースコード生成の際、フィールドの初期化に使用される。そのため、フィールドとして存在しえない範囲の値は設定できない。
Next, in the attribute item, data used in each operation is extracted, and a name is given to the extracted data. The name given to the extracted data needs to be unique within one operation.
Set a label for each extracted attribute. This label is used as a field name when generating source code. Therefore, it is necessary to name the generated code according to the programming language specification.
In addition, the range of each extracted attribute is set as a range. This is used for the field range when generating source code. Therefore, a value in a range that cannot exist as a field cannot be set.
Furthermore, the initial value of each extracted attribute is set. This is used for field initialization when generating source code. Therefore, a value in a range that cannot exist as a field cannot be set.
図6を用いて、本実施の形態に係る機能項目の振舞い記述105の具体例及び作成の手順について説明する。
機能項目の振舞い記述105では、機能項目リスト103で定義した各機能の振舞いを定義し、各機能が持つ操作毎に、処理内容の詳細を記載する。
A specific example of the function
In the function
まず、機能が持つ操作の1つずつについて、当該操作に属する属性をどのように使用するか具体的に検討し、どのような「条件」で、どのような「処理」を行うか明らかにする。
次に、検討した「条件」と「処理」とを、擬似言語にて記述する。この擬似言語では、使用する属性を機能項目リスト103に記載の名称と揃え、論理構造のみを記号化する。
First, for each operation of the function, examine how to use the attribute belonging to the operation, and clarify what kind of “processing” should be performed under what “condition”. .
Next, the studied “conditions” and “processing” are described in a pseudo language. In this pseudo language, the attributes to be used are aligned with the names described in the
1つの機能が持つ全ての操作は、一つの「機能項目の振舞い記述」としてまとめて記述する。
つまり、図5の機能項目リスト103における機能A1が持つ操作A及び操作Bについては、図6に示す1つの「機能項目の振舞い記述105」にまとめて記述する。
以上の手順を、機能項目リスト103における全ての機能について実施する。
All operations of one function are collectively described as one “function item behavior description”.
That is, the operation A and the operation B included in the function A1 in the
The above procedure is performed for all functions in the
***動作の説明***
図7を用いて、本実施の形態に係るソースコード生成装置20におけるソースコード生成方法、ソースコード生成処理S10の動作について説明する。
*** Explanation of operation ***
The operation of the source code generation method and source code generation processing S10 in the source
取得部40は、処理項目リスト107と、処理項目リスト107に基づいて記述された処理項目1072の振舞いを記述する振舞い記述情報108とを取得する取得処理S100を実行する。
具体的には、S701において、取得部40は、物理項目リスト102、機能項目リスト103、物理項目の振舞い記述104、機能項目の振舞い記述105を取得する。
振舞い記述生成部501は、取得部40により取得された物理項目の振舞い記述104または機能項目の振舞い記述105に対して、未処理のものが無い場合、処理を終了し、未処理のものが有る場合、S702に処理を進める。
ここで、処理対象の振舞い記述を処理対象振舞い記述とする。
The
Specifically, in S701, the
If there is no unprocessed item for the physical
Here, the behavior description of the processing target is the processing target behavior description.
振舞い記述生成部501は、処理項目1072を用いてクラスを定義するソースコードを生成する振舞い記述生成処理S100aを実行する。
具体的には、S702において、振舞い記述生成部501は、処理対象振舞い記述に基づいて、機能項目リスト103あるいは物理項目リスト102から、処理対象振舞い記述の機能名称あるいは物理名称のラベルを取得しクラスを生成する。
The behavior
Specifically, in S702, the behavior
例えば、処理対象振舞い記述が物理項目の振舞い記述104の場合、振舞い記述生成部501は、図3の物理項目リスト102に基づいて、「センサ1」についてクラスを定義するソースコードを生成する。まず、振舞い記述生成部501は、物理項目リスト102から振舞い記述「センサ1」のラベルを取得し、物理項目クラス301であるSen1クラスをソースコードとして生成する。具体的には、振舞い記述生成部501は、図8の1行目の「Class Sen1」を生成する。
また、例えば、処理対象振舞い記述が機能項目の振舞い記述105の場合、振舞い記述生成部501は、図5の機能項目リスト103に基づいて、「機能A1」についてのソースコードを生成する。まず、振舞い記述生成部501は、機能項目リスト103から振舞い記述「機能A1」のラベルを取得し、機能項目クラス302であるClassA1クラスをソースコードとして生成する。具体的には、振舞い記述生成部501は、図9の1行目の「class ClassA1」を生成する。
For example, when the processing target behavior description is the physical
For example, if the behavior description to be processed is the
S702におけるクラスのソースコード生成後、処理対象振舞い記述の機能項目または物理項目について親機能項目または親物理項目が有る場合は、処理はS703に進む。処理対象振舞い記述の機能項目または物理項目について親機能項目または親物理項目が無い場合は、処理はS704に進む。 After the generation of the class source code in S702, if there is a parent function item or a parent physical item for the function item or physical item of the processing target behavior description, the process proceeds to S703. If there is no parent function item or parent physical item for the function item or physical item in the processing target behavior description, the process proceeds to S704.
S703において、振舞い記述生成部501は、継承記述処理S200を実行する。振舞い記述生成部501は、処理対象振舞い記述に基づいて、機能項目リスト103あるいは物理項目リスト102から、親機能項目または親物理項目の名称のラベルを取得し、継承コードを生成する。
In S703, the behavior
処理対象振舞い記述が図3の物理項目リスト102の場合、振舞い記述生成部501は、センサ1には親物理項目である「センサ」があるので、「センサ」のラベルSensorを取得する。振舞い記述生成部501は、S702で生成したソースコード「class Sen1」に対して、親クラス「Sensor」への継承記述を生成する。具体的には、振舞い記述生成部501は、図8の1行目の「:public Sensor」を生成する。
処理対象振舞い記述が図5の機能項目リスト103の場合では、振舞い記述生成部501は、機能A1には親の機能項目である「機能A」があるので、「機能A」のラベルClassAを取得する。振舞い記述生成部501は、S702で生成したソースコード「class ClassA1」に対して、親クラス「ClassA」への継承記述を生成する。具体的には、振舞い記述生成部501は、図9の1行目の「:public ClassA」を生成する。
When the behavior description to be processed is the
When the processing target behavior description is the
S704において、操作生成部502は、処理対象振舞い記述に基づいて、未処理の操作があるか否かを判定する。操作生成部502は、未処理の操作が有る場合、処理をS705に進め、未処理の操作が無い場合、処理をS708に進める。
In step S <b> 704, the
操作生成部502は、操作情報1073を用いて操作を定義するソースコードを生成する操作生成処理S300を実行する。
具体的には、S705において、操作生成部502は、機能項目リスト103あるいは物理項目リスト102から、未処理の操作名称のラベルを取得しメソッドを生成する。
The
Specifically, in step S <b> 705, the
例えば、操作生成部502は、図3の物理項目リスト102の場合、センサ1には操作「起動」があるので、ラベルを取得し、メソッドをソースコードとして生成する。具体的には、操作生成部502は、図8の2行目の「void OpeY()」を生成する。
また、例えば、操作生成部502は、図5の機能項目リスト103の場合、機能Aには操作「操作A」があるので、ラベルを取得し、メソッドをソースコードとして生成する。具体的には、操作生成部502は、図9の2行目の「void OpeA()」を生成する。
For example, in the case of the
Further, for example, in the case of the
例外記述生成部503は、例外処理情報1074を用いて操作の実行中に発生する例外処理を表すソースコードを生成する例外記述生成処理S400を実行する。
S706において、例外記述生成部503は、処理対象振舞い記述に未処理の例外記述があるか否かを判定する。例外記述生成部503は、未処理の例外記述がある場合、処理をS707に進める。また、例外記述生成部503は、未処理の例外記述が無い場合、処理をS704に進める。
The exception
In step S706, the exception
S707において、例外記述生成部503は、物理項目リスト102から、例外名称のラベルを取得し、操作に例外コードを追加する。
例えば、例外記述生成部503は、図3の物理項目リスト102の場合、センサ1には例外項目「電源断」があるので、「電源断」のラベルを取得し、「起動」メソッドに例外コードを追加する。具体的には、例外記述生成部503は、図8の3行目と5行目のように、ソースコードを生成する。
In step S707, the exception
For example, in the case of the
条件記述生成部504は、振舞い記述情報108を用いて操作の条件分岐を表すソースコードを生成する条件記述生成処理S500を実行する。
S708において、条件記述生成部504は、処理対象振舞い記述に未処理の条件記述がある場合、処理をS709に進める。条件記述生成部504は、未処理の条件記述が無い場合、処理をS710に進める。
The condition
In S708, the condition
S709において、条件記述生成部504は、条件記述内の属性名称のラベルを取得しif文を生成する。
例えば、条件記述生成部504は、図5の機能項目リスト103の場合、操作「操作A」に条件記述があるので、条件記述内の属性名称「属性B」「属性C」「属性D」「属性E」のラベルを機能項目リスト103から取得し、if文を生成する。具体的には、条件記述生成部504は、図9の3行目と6行目のように、ソースコードを生成する。
In step S709, the condition
For example, in the case of the
処理記述生成部505は、振舞い記述情報108を用いて操作の処理内容を表すソースコードを生成する処理記述生成処理S600を実行する。
S710において、処理記述生成部505は、処理対象振舞い記述に未処理の処理記述が有るか否かを判定する。処理記述生成部505は、未処理の処理記述が有る場合、処理をS711に進める。処理記述生成部505は、未処理の処理記述が無い場合、処理をS701に進める。
The process
In step S710, the process
S711において、処理記述生成部505は、処理記述内の属性名称のラベルを取得し制御文を生成する。
例えば、処理記述生成部505は、図5の機能項目リスト103の場合、操作「操作A」に未処理の処理記述があるので、条件記述内の属性名称「属性F」のラベルを取得し、制御文を生成する。具体的には、処理記述生成部505は、図9の4行目と7行目のように、ソースコードを生成する。
In step S <b> 711, the process
For example, in the case of the
図8は、物理項目クラス301のソースコード30の例を示す。図9は、機能項目クラス302のソースコード30の例を示す。
以上のソースコード生成処理S10により、図8及び図9に示すようなソースコード30が自動的に出力される。
FIG. 8 shows an example of the
Through the above source code generation processing S10, the
ソースコード生成部50は、物理項目クラス301と機能項目クラス302とのソースコード30を出力する。
なお、優先度制御生成部60は、機能項目の各々に設定された優先レベルに基づいて、実行中の機能項目の優先レベルと実行が要求された機能項目の優先レベルとを比較する。優先度制御生成部60は、優先レベルが高い方の機能項目を実行する優先度制御機能を有する優先度制御ソースコード303を生成する。
The source
The priority
図10を用いて、本実施の形態に係るソースコード生成装置20のハードウェア構成について説明する。
ソースコード生成装置20はコンピュータである。
ソースコード生成装置20は、プロセッサ901、補助記憶装置902、メモリ903、通信装置904、入力インタフェース905、ディスプレイインタフェース906といったハードウェアを備える。
プロセッサ901は、信号線910を介して他のハードウェアと接続され、これら他のハードウェアを制御する。
入力インタフェース905は、入力装置907に接続されている。
ディスプレイインタフェース906は、ディスプレイ908に接続されている。
The hardware configuration of the source
The source
The source
The
The input interface 905 is connected to the
The
プロセッサ901は、プロセッシングを行うIC(Integrated Circuit)である。
プロセッサ901は、例えば、CPU(Central Processing Unit)、DSP(Digital Signal Processor)、GPU(Graphics Processing Unit)である。
補助記憶装置902は、例えば、ROM(Read Only Memory)、フラッシュメモリ、HDD(Hard Disk Drive)である。
メモリ903は、例えば、RAM(Random Access Memory)である。
通信装置904は、データを受信するレシーバー9041及びデータを送信するトランスミッター9042を含む。
通信装置904は、例えば、通信チップ又はNIC(Network Interface Card)である。
入力インタフェース905は、入力装置907のケーブル911が接続されるポートである。
入力インタフェース905は、例えば、USB(Universal Serial Bus)端子である。
ディスプレイインタフェース906は、ディスプレイ908のケーブル912が接続されるポートである。
ディスプレイインタフェース906は、例えば、USB端子又はHDMI(登録商標)(High Definition Multimedia Interface)端子である。
入力装置907は、例えば、マウス、キーボード又はタッチパネルである。
ディスプレイ908は、例えば、LCD(Liquid Crystal Display)である。
The
The
The
The
The
The
The input interface 905 is a port to which the cable 911 of the
The input interface 905 is, for example, a USB (Universal Serial Bus) terminal.
The
The
The
The
補助記憶装置902には、図1に示す振舞い記述生成部501、操作生成部502、例外記述生成部503、条件記述生成部504、処理記述生成部505(以下、振舞い記述生成部501、操作生成部502、例外記述生成部503、条件記述生成部504、処理記述生成部505をまとめて「部」と表記する)の機能を実現するプログラムが記憶されている。
このプログラムは、メモリ903にロードされ、プロセッサ901に読み込まれ、プロセッサ901によって実行される。
更に、補助記憶装置902には、OS(Operating System)も記憶されている。
そして、OSの少なくとも一部がメモリ903にロードされ、プロセッサ901はOSを実行しながら、「部」の機能を実現するプログラムを実行する。
図10では、1つのプロセッサ901が図示されているが、ソースコード生成装置20が複数のプロセッサ901を備えていてもよい。
そして、複数のプロセッサ901が「部」の機能を実現するプログラムを連携して実行してもよい。
また、「部」の処理の結果を示す情報やデータや信号値や変数値が、メモリ903、補助記憶装置902、又は、プロセッサ901内のレジスタ又はキャッシュメモリにファイルとして記憶される。
The
This program is loaded into the
Further, the
Then, at least a part of the OS is loaded into the
Although one
A plurality of
In addition, information, data, signal values, and variable values indicating the results of the processing of “unit” are stored as files in the
「部」を「サーキットリー」で提供してもよい。
また、「部」を「回路」又は「工程」又は「手順」又は「処理」に読み替えてもよい。
「回路」及び「サーキットリー」は、プロセッサ901だけでなく、ロジックIC又はGA(Gate Array)又はASIC(Application Specific Integrated Circuit)又はFPGA(Field−Programmable Gate Array)といった他の種類の処理回路をも包含する概念である。
なお、プログラムプロダクトと称されるものは、「部」として説明している機能を実現するプログラムが記録された記憶媒体、記憶装置などであり、見た目の形式に関わらず、コンピュータ読み取り可能なプログラムをロードしているものである。
The “part” may be provided as “circuitry”.
Further, “part” may be read as “circuit”, “process”, “procedure”, or “processing”.
“Circuit” and “Circuitry” include not only the
Note that what is called a program product is a storage medium, a storage device, or the like on which a program that realizes the function described as a “part” is recorded. It is what you are loading.
***効果の説明*** *** Explanation of effects ***
本実施の形態に係るソースコード生成装置20では、ソースコードの雛型、条件記述、処理記述などの正常記述の自動生成に加え、例外と処理の優先度とを考慮したソースコードの自動生成が可能となる。よって、ソースコード作成時間を削減する効果がある。
In the source
本実施の形態に係るソースコード生成装置20では、ハードウェア物理項目に対して、任意の例外を定義した物理項目リストから物理項目リストに定義されている各操作をソースコードとして生成する。生成された全操作のソースコードに対して、同一のハードウェア物理項目に対する全例外のソースコードを割り付ける。このような処理により、例外記述生成部において、ハードウェア物理項目に属する複数の操作へ例外処理毎の例外処理ソースコードを自動生成する。このように、本実施の形態に係るソースコード生成装置20では、すべての例外事象の条件分岐を自動で出力することで、更に作成時間の削減効果を高めることができる。
In the source
本実施の形態に係るソースコード生成装置20では、優先度制御生成部を備えているので、機能の優先順位の制御プログラムを各機能のソースコードに持つ必要がない。そのため、ソースコード量を削減することができる。また、優先度制御機能により、機能優先度を考慮した切り替えが可能となる。
Since the source
実施の形態2.
本実施の形態では、主に、実施の形態1と異なる点について説明する。
本実施の形態では、機能項目に対する処理の優先度の仕様記述方法とコード生成方法とについて説明する。
In the present embodiment, differences from the first embodiment will be mainly described.
In the present embodiment, a specification description method and a code generation method for processing priority for function items will be described.
***構成の説明***
図11を用いて、本実施の形態に係るソースコード生成システム800aのブロック構成につて説明する。
本実施の形態に係るソースコード生成装置20aでは、各機能項目の優先度を考慮し、実行することが可能となる。
*** Explanation of configuration ***
The block configuration of the source code generation system 800a according to this embodiment will be described with reference to FIG.
The source
図11に示すように、ソースコード生成装置20aは、実施の形態1の優先度制御生成部60、優先度制御ソースコード303に替えて、優先度制御生成部601、優先度制御ソースコード3031を有する。優先度制御生成部601は、優先度制御ソースコード3031を生成する。
As illustrated in FIG. 11, the source
優先度制御生成部601は、実行中の処理項目の親処理項目の優先度1075aと、実行が要求された処理項目の親処理項目の優先度とに基づいて、実行が要求された処理項目の実行の可否を判定する優先度制御機能を有する優先度制御ソースコード3031を生成する。
優先度制御生成部601は、実行が要求された処理項目の親処理項目と異なる親処理項目を有する実行中の処理項目がある場合には、実行が要求された処理項目の親処理項目の優先度と実行中の処理項目の親処理項目の優先度とを比較する。優先度制御生成部601は、優先度が低い方の親処理項目を有する処理項目の実行を不可とすることで、異なる子項目同士の比較を省略できる。
The priority
When there is a process item being executed having a parent process item different from the parent process item of the process item requested to be executed, the priority
***動作の説明***
図12を用いて、本実施の形態に係る優先度制御ソースコード3031を実現する優先度制御部3031aの優先度制御処理の手順について説明する。ここで、優先度制御ソースコード3031の優先度制御機能を実現する構成部を優先度制御部3031aとする。
*** Explanation of operation ***
The procedure of the priority control process of the priority control unit 3031a that realizes the priority
S1201において、優先度制御部3031aは、実行要求の機能項目の優先レベルを取得する。
S1202において、優先度制御部3031aは、優先レベルを判定し、優先レベルが0の場合、S1212の実行許可に進む。
優先レベルが0以外の場合、優先度制御部3031aは、S1203に進み、実行中の機能情報を取得する。
In S1201, the priority control unit 3031a acquires the priority level of the function item of the execution request.
In S1202, the priority control unit 3031a determines the priority level. If the priority level is 0, the process proceeds to S1212.
If the priority level is other than 0, the priority control unit 3031a proceeds to S1203 and acquires the function information being executed.
S1204において、優先度制御部3031aは、実行中機能が無い場合、S1212の実行許可に進む。
優先度制御部3031aは、実行中機能が有る場合、S1205で異なる親クラスの実行中機能があるか否かを判定する。親クラスとは、親機能項目すなわち親処理項目のことである。
優先度制御部3031aは、異なる親クラスの実行中機能が有る場合、S1207に進む。
優先度制御部3031aは、異なる親クラスの実行中機能が無い場合、S1206に進む。
In S1204, when there is no function being executed, the priority control unit 3031a proceeds to the execution permission of S1212.
If there is a function being executed, the priority control unit 3031a determines whether there is a function being executed of a different parent class in S1205. The parent class is a parent function item, that is, a parent processing item.
If there is an executing function of a different parent class, the priority control unit 3031a proceeds to S1207.
If there is no executing function of a different parent class, the priority control unit 3031a proceeds to S1206.
S1206において、優先度制御部3031aは、同じ親クラスの実行中機能が有るか否かを判定する。優先度制御部3031aは、同じ親クラスの実行中機能が有る場合、S1209に進む。優先度制御部3031aは、同じ親クラスの実行中機能が無い場合、S1212の実行許可に進む。 In S1206, the priority control unit 3031a determines whether or not there is an executing function of the same parent class. If there is an executing function of the same parent class, the priority control unit 3031a proceeds to S1209. If there is no executing function of the same parent class, the priority control unit 3031a proceeds to S1212 to permit execution.
S1207において、優先度制御部3031aは、実行中機能と実行要求機能との親クラス同士の優先レベルを比較する。S1208において、優先度制御部3031aは、実行中機能と実行要求機能との親クラス同士の優先レベルの比較の結果、実行要求機能の親クラスの優先レベルが低い場合はS1211の実行不許可とする。優先度制御部3031aは、実行要求機能の親クラスの優先レベルが高い場合はS1206に進む。 In S1207, the priority control unit 3031a compares the priority levels of the parent classes of the function being executed and the execution request function. In S1208, when the priority level of the parent class of the execution request function is low as a result of the comparison of the priority levels of the parent class of the function being executed and the execution request function, the priority control unit 3031a does not permit the execution of S1211. . If the priority level of the parent class of the execution request function is high, the priority control unit 3031a proceeds to S1206.
S1209において、優先度制御部3031aは、同じ親クラスの実行中機能と実行要求機能との優先レベル同士を比較し、実行要求機能の優先レベルが高い場合、S1212の実行許可とする。優先度制御部3031aは、実行要求機能の優先レベルが低い場合、S1211の実行不許可とする。
以上で、優先度制御処理の手順についての説明を終わる。
In S1209, the priority control unit 3031a compares the priority levels of the executing function and the execution request function of the same parent class, and when the priority level of the execution request function is high, the execution permission of S1212 is set. If the priority level of the execution request function is low, the priority control unit 3031a does not permit the execution of S1211.
This is the end of the description of the priority control processing procedure.
次に、図13を用いて、本実施の形態にかかる優先度制御部3031aによる各機能の継承関係の例について説明する。
機能B2の場合、実行許可を判断するためには親クラスである機能Bの優先レベルを考慮して、実行許可判定を行う。親クラスの参照方法は、各言語の継承クラスの参照機能を利用する。
例えば、機能A2が実行要求機能であり、機能B1及び機能B2が実行中機能である場合、機能A2と、機能B1及び機能B2とは親クラスが異なる。そこで親クラス同士の優先レベルを比較すると、機能A2の親クラスである機能Aの優先レベル「1」は、機能B1及び機能B2の親クラスである機能Bの優先レベル「2」よりも低い。そこで、機能A2と機能B1及び機能B2の各々との優先レベルを比較するまでもなく、機能Aは実行不可となる。
Next, an example of the inheritance relationship of each function by the priority control unit 3031a according to the present embodiment will be described with reference to FIG.
In the case of the function B2, in order to determine the execution permission, the execution permission determination is performed in consideration of the priority level of the function B which is the parent class. The parent class reference method uses the reference function of the inherited class of each language.
For example, when the function A2 is an execution request function and the functions B1 and B2 are executing functions, the parent classes of the function A2, the function B1, and the function B2 are different. Therefore, when the priority levels of the parent classes are compared, the priority level “1” of the function A that is the parent class of the function A2 is lower than the priority level “2” of the function B that is the parent class of the functions B1 and B2. Therefore, the function A cannot be executed without comparing the priority levels of the function A2 and each of the functions B1 and B2.
***効果の説明***
本実施の形態に係るソースコード生成装置20aでは、実行中の機能を階層に従って上位機能毎に管理し、優先度比較を段階的に行う。起動する機能の上位機能と、実行中の機能の上位機能同士で比較し、比較対象を絞り込む。次に同一階層の機能同士で優先度を比較する。これにより、比較対象数を減らすことができ、処理時間の短縮を可能とする。
*** Explanation of effects ***
In the source
本実施の形態に係るソースコード生成装置20aでは、優先順位の制御は、各機能のソースコードで持たず、機能優先度の制御の役割を持つ実行優先度制御に集約することで、ソースコード量の削減を可能とする。
In the source
本実施の形態に係るソースコード生成装置20では、起動する機能と全ての実行中の機能の優先度を比較する必要がなく、優先度の比較処理時間を短縮することができる。
In the source
上記の実施の形態では、取得部40、振舞い記述生成部501、操作生成部502、例外記述生成部503、条件記述生成部504、処理記述生成部505、優先度制御生成部60がそれぞれ独立した機能ブロックとしてソースコード生成装置20を構成している。しかし、ソースコード生成装置20の構成は任意である。また、振舞い記述生成部501、操作生成部502、例外記述生成部503、条件記述生成部504、処理記述生成部505をひとつの機能ブロックで実現してもよい。また、優先度制御生成部60の機能をソースコード生成部50が備えていてもよい。
ソースコード生成装置20の機能ブロックは、実施の形態に記載した機能を実現することができれば、任意であり、これらの機能ブロックを、他のどのような組み合わせでファイル管理装置を構成しても構わない。
In the above embodiment, the
The function blocks of the source
以上、実施の形態1,2について説明したが、これらの2つの実施の形態のうち、1つの実施の形態を部分的に実施しても構わない。あるいは、これらの2つの実施の形態のうち、複数を部分的に組み合わせて実施しても構わない。その他、これらの2つの実施の形態を、全体としてあるいは部分的に、どのように組み合わせて実施しても構わない。
なお、上記の実施の形態は、本質的に好ましい例示であって、本発明、その適用物や用途の範囲を制限することを意図するものではなく、必要に応じて種々の変更が可能である。
Although the first and second embodiments have been described above, one of the two embodiments may be partially implemented. Alternatively, a plurality of these two embodiments may be partially combined. In addition, these two embodiments may be implemented in any combination as a whole or in part.
In addition, said embodiment is an essentially preferable illustration, Comprising: It does not intend restrict | limiting the range of this invention, its application thing, or a use, A various change is possible as needed. .
20,20a ソースコード生成装置、30 ソースコード、40 取得部、50 ソースコード生成部、60,601 優先度制御生成部、101 インプット仕様書、102 物理項目リスト、103 機能項目リスト、104 物理項目の振舞い記述、105 機能項目の振舞い記述、107 処理項目リスト、108 振舞い記述情報、301 物理項目クラス、302 機能項目クラス、303,3031 優先度制御ソースコード、501 振舞い記述生成部、502 操作生成部、503 例外記述生成部、504 条件記述生成部、505 処理記述生成部、800,800a ソースコード生成システム、901 プロセッサ、902 補助記憶装置、903 メモリ、904 通信装置、905 入力インタフェース、906 ディスプレイインタフェース、907 入力装置、908 ディスプレイ、910 信号線、911,912 ケーブル、1071 処理項目リスト記憶部、1072 処理項目、1072a 複数の処理項目、1073 操作情報、1073a 複数の操作、1074 例外処理情報、1075 優先度、1075a 実行中の処理項目の親処理項目の優先度、1075b 実行が要求された処理項目の親処理項目の優先度、1081 振舞い記述情報記憶部、3031a 優先度制御部、9041 レシーバー、9042 トランスミッター、10721 親処理項目、10722 子処理項目、S10 ソースコード生成処理、S100 取得処理、S100a 振舞い記述生成処理、S200 継承記述処理、S300 操作生成処理、S400 例外記述生成処理、S500 条件記述生成処理、S600 処理記述生成処理。 20, 20a Source code generation device, 30 source code, 40 acquisition unit, 50 source code generation unit, 60, 601 priority control generation unit, 101 input specification, 102 physical item list, 103 function item list, 104 physical item Behavior description, 105 Function item behavior description, 107 Process item list, 108 Behavior description information, 301 Physical item class, 302 Function item class, 303, 3031 Priority control source code, 501 Behavior description generation unit, 502 Operation generation unit, 503 Exception description generation unit, 504 Condition description generation unit, 505 Process description generation unit, 800, 800a Source code generation system, 901 processor, 902 auxiliary storage device, 903 memory, 904 communication device, 905 input interface, 906 display Interface, 907 input device, 908 display, 910 signal line, 911, 912 cable, 1071 processing item list storage unit, 1072 processing item, 1072a multiple processing items, 1073 operation information, 1073a multiple operations, 1074 exception processing information, 1075 Priority, 1075a Priority of parent process item of the process item being executed, 1075b Priority of parent process item of the process item requested to be executed, 1081 Behavior description information storage unit, 3031a Priority control unit, 9041 Receiver, 9042 Transmitter, 10721 Parent processing item, 10722 Child processing item, S10 Source code generation processing, S100 acquisition processing, S100a Behavior description generation processing, S200 Inheritance description processing, S300 Operation generation processing, S400 Exception description generation processing S500, condition description generation process, S600 process description generation process.
Claims (8)
前記処理項目リストに基づいて記述された前記処理項目の振舞いを記述する振舞い記述情報を記憶する振舞い記述情報記憶部と、
前記処理項目を用いて、クラスを定義するソースコードを生成する振舞い記述生成部と、
前記操作情報を用いて、前記操作を定義するソースコードを生成する操作生成部と、
前記例外処理情報を用いて、前記操作の実行中に発生する前記例外処理を表すソースコードを生成する例外記述生成部と、
前記振舞い記述情報を用いて、前記操作の条件分岐を表すソースコードを生成する条件記述生成部と、
前記振舞い記述情報を用いて、前記操作の処理内容を表すソースコードを生成する処理記述生成部と
を備えるソースコード生成システム。 A process item list storage unit that stores a process item list that includes a process item that represents a process item, operation information that represents an operation included in the process item, and exception process information that represents an exception process;
A behavior description information storage unit that stores behavior description information that describes the behavior of the processing item described based on the processing item list;
A behavior description generator for generating a source code defining a class using the processing items;
Using the operation information, an operation generation unit that generates a source code that defines the operation;
Using the exception handling information, an exception description generator for generating source code representing the exception handling that occurs during execution of the operation;
Using the behavior description information, a condition description generation unit that generates a source code representing a conditional branch of the operation;
A source code generation system comprising: a process description generation unit that generates a source code representing the processing content of the operation using the behavior description information.
前記操作として複数の操作を表す前記操作情報を有し、
前記操作生成部は、
前記複数の操作の各操作を定義するソースコードを生成し、
前記例外記述生成部は、
前記複数の操作の各操作を定義するソースコードに対して前記例外処理を表すソースコードを割り付ける請求項1に記載のソースコード生成システム。 The processing item list is:
The operation information representing a plurality of operations as the operation,
The operation generator is
Generating source code defining each operation of the plurality of operations;
The exception description generation unit
The source code generation system according to claim 1, wherein source code representing the exception processing is assigned to source code defining each operation of the plurality of operations.
前記処理項目として、複数の処理項目を有し、前記複数の処理項目の各々に優先度が設定され、
前記ソースコード生成システムは、
前記処理項目の各々に設定された優先度に基づいて、実行中の処理項目の優先度と実行が要求された処理項目の優先度とを比較し、優先度が高い方の処理項目を実行する優先度制御機能を有する優先度制御ソースコードを生成する優先度制御生成部を備える請求項1または2に記載のソースコード生成システム。 The processing item list is:
As the processing item, it has a plurality of processing items, and a priority is set for each of the plurality of processing items,
The source code generation system includes:
Based on the priority set for each of the process items, the priority of the process item being executed is compared with the priority of the process item requested to be executed, and the process item with the higher priority is executed. The source code generation system according to claim 1, further comprising a priority control generation unit that generates a priority control source code having a priority control function.
前記処理項目として、複数の処理項目を有し、
前記複数の処理項目の各々に優先度が設定されるとともに、前記複数の処理項目の各々が上位の階層である親処理項目を有し、
実行中の処理項目の親処理項目の優先度と、実行が要求された処理項目の親処理項目の優先度とに基づいて、実行が要求された処理項目の実行の可否を判定する優先度制御機能を有する優先度制御ソースコードを生成する優先度制御生成部を備える請求項1または2に記載のソースコード生成システム。 The processing item list is:
As the processing item, it has a plurality of processing items,
A priority is set for each of the plurality of processing items, and each of the plurality of processing items has a parent processing item that is a higher hierarchy,
Priority control that determines whether or not a process item requested to be executed can be executed based on the priority of the parent process item of the process item being executed and the priority of the parent process item of the process item requested to be executed The source code generation system according to claim 1, further comprising a priority control generation unit that generates a priority control source code having a function.
実行が要求された処理項目の親処理項目と異なる親処理項目を有する実行中の処理項目がある場合には、前記実行が要求された処理項目の親処理項目の優先度と前記実行中の処理項目の親処理項目の優先度とを比較し、優先度が低い方の親処理項目を有する処理項目の実行を不可とする請求項4に記載のソースコード生成システム。 The priority control generation unit
When there is a process item being executed having a parent process item different from the parent process item of the process item requested to be executed, the priority of the parent process item of the process item requested to be executed and the process being executed 5. The source code generation system according to claim 4, wherein the priority of the parent processing item of the item is compared, and execution of the processing item having the parent processing item with the lower priority is prohibited.
前記処理項目を用いて、クラスを定義するソースコードを生成する振舞い記述生成部と、
前記操作情報を用いて、前記操作を定義するソースコードを生成する操作生成部と、
前記例外処理情報を用いて、前記操作の実行中に発生する前記例外処理を表すソースコードを生成する例外記述生成部と、
前記振舞い記述情報を用いて、前記操作の条件分岐を表すソースコードを生成する条件記述生成部と、
前記振舞い記述情報を用いて、前記操作の処理内容を表すソースコードを生成する処理記述生成部と
を備えるソースコード生成装置。 A process item representing a process item, operation information representing an operation included in the process item, exception process information representing an exception process, and the process item described based on the process item list An acquisition unit for acquiring behavior description information describing the behavior of
A behavior description generator for generating a source code defining a class using the processing items;
Using the operation information, an operation generation unit that generates a source code that defines the operation;
Using the exception handling information, an exception description generator for generating source code representing the exception handling that occurs during execution of the operation;
Using the behavior description information, a condition description generation unit that generates a source code representing a conditional branch of the operation;
A source code generation device comprising: a process description generation unit that generates a source code representing the processing content of the operation using the behavior description information.
振舞い記述生成部が、前記処理項目を用いてクラスを定義するソースコードを生成し、
前記操作情報を用いて前記操作を定義するソースコードを生成する操作生成部と、
例外記述生成部が、前記例外処理情報を用いて前記操作の実行中に発生する前記例外処理を表すソースコードを生成し、
条件記述生成部が、前記振舞い記述情報を用いて前記操作の条件分岐を表すソースコードを生成し、
処理記述生成部が、前記振舞い記述情報を用いて前記操作の処理内容を表すソースコードを生成するソースコード生成方法。 A process item list storage unit that stores a process item that includes a process item that represents a process item, operation information that represents an operation included in the process item, and exception process information that represents an exception process; and In a source code generation method of a source code generation system, comprising: a behavior description information storage unit that stores behavior description information that describes the behavior of the processing item described based on
The behavior description generator generates source code that defines a class using the processing items,
An operation generation unit that generates a source code that defines the operation using the operation information;
An exception description generation unit generates source code representing the exception processing that occurs during execution of the operation using the exception processing information;
A condition description generation unit generates source code representing a conditional branch of the operation using the behavior description information,
A source code generation method in which a process description generation unit generates a source code representing the processing content of the operation using the behavior description information.
前記処理項目を用いてクラスを定義するソースコードを生成する振舞い記述生成処理と、
前記操作情報を用いて前記操作を定義するソースコードを生成する操作生成処理と、
前記例外処理情報を用いて前記操作の実行中に発生する前記例外処理を表すソースコードを生成する例外記述生成処理と、
前記振舞い記述情報を用いて前記操作の条件分岐を表すソースコードを生成する条件記述生成処理と、
前記振舞い記述情報を用いて前記操作の処理内容を表すソースコードを生成する処理記述生成処理と
をコンピュータに実行させるプログラム。 A process item representing a process item, operation information representing an operation included in the process item, exception process information representing an exception process, and the process item described based on the process item list Acquisition processing for acquiring behavior description information describing the behavior of
A behavior description generation process for generating a source code for defining a class using the processing items;
An operation generation process for generating a source code defining the operation using the operation information;
Exception description generation processing for generating source code representing the exception processing that occurs during execution of the operation using the exception processing information;
A condition description generation process for generating a source code representing a conditional branch of the operation using the behavior description information;
A program for causing a computer to execute a process description generating process for generating a source code representing the processing contents of the operation using the behavior description information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015081441A JP6482362B2 (en) | 2015-04-13 | 2015-04-13 | Source code generation system, source code generation device, source code generation method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015081441A JP6482362B2 (en) | 2015-04-13 | 2015-04-13 | Source code generation system, source code generation device, source code generation method and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2016201009A true JP2016201009A (en) | 2016-12-01 |
JP6482362B2 JP6482362B2 (en) | 2019-03-13 |
Family
ID=57424340
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015081441A Active JP6482362B2 (en) | 2015-04-13 | 2015-04-13 | Source code generation system, source code generation device, source code generation method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6482362B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115167834A (en) * | 2022-09-08 | 2022-10-11 | 杭州新中大科技股份有限公司 | Automatic source code generation method and device based on code datamation |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10214191A (en) * | 1996-11-27 | 1998-08-11 | Toshiba Corp | Device for supporting development applied to object-oriented programming, and method therefor |
JP2003208307A (en) * | 2002-01-16 | 2003-07-25 | Hitachi Software Eng Co Ltd | Source program generation system |
JP2004287695A (en) * | 2003-03-20 | 2004-10-14 | Mitsubishi Electric Corp | Program development support device, program development support method, program, and computer-readable storage medium recording the program |
WO2007116490A1 (en) * | 2006-03-31 | 2007-10-18 | Fujitsu Limited | Source code generation program, source code generation method, and source code generation device |
JP2012212286A (en) * | 2011-03-31 | 2012-11-01 | Canaly Research Co Ltd | Program development tool |
-
2015
- 2015-04-13 JP JP2015081441A patent/JP6482362B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10214191A (en) * | 1996-11-27 | 1998-08-11 | Toshiba Corp | Device for supporting development applied to object-oriented programming, and method therefor |
JP2003208307A (en) * | 2002-01-16 | 2003-07-25 | Hitachi Software Eng Co Ltd | Source program generation system |
JP2004287695A (en) * | 2003-03-20 | 2004-10-14 | Mitsubishi Electric Corp | Program development support device, program development support method, program, and computer-readable storage medium recording the program |
WO2007116490A1 (en) * | 2006-03-31 | 2007-10-18 | Fujitsu Limited | Source code generation program, source code generation method, and source code generation device |
JP2012212286A (en) * | 2011-03-31 | 2012-11-01 | Canaly Research Co Ltd | Program development tool |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115167834A (en) * | 2022-09-08 | 2022-10-11 | 杭州新中大科技股份有限公司 | Automatic source code generation method and device based on code datamation |
CN115167834B (en) * | 2022-09-08 | 2022-12-23 | 杭州新中大科技股份有限公司 | Automatic source code generation method and device based on code datamation |
Also Published As
Publication number | Publication date |
---|---|
JP6482362B2 (en) | 2019-03-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20140337824A1 (en) | Out-of-band framework libraries within applications | |
CN109739600B (en) | Data processing method, medium, device and computing equipment | |
US20150186161A1 (en) | Platform system, method for changing support hardware configuration of universal extensible firmware interface basic input output system and computer program product | |
US10585826B2 (en) | Using processor types for processing interrupts in a computing device | |
JP2014519079A (en) | Method for adapting user interface and input control | |
BR112012027950B1 (en) | computerized method of managing a plurality of subbuffers, non-transitory machine readable means and apparatus for managing a plurality of subbuffers | |
JP5244826B2 (en) | Separation, management and communication using user interface elements | |
JP5778296B2 (en) | Virtual computer system, virtualization mechanism, and data management method | |
CN110825499B (en) | Method and device for realizing security isolation based on unified container cloud platform | |
EP4231138A1 (en) | Method and apparatus for fixing weak memory ordering problem | |
JP7082105B2 (en) | Methods, equipment, equipment and media for managing the knowledge base | |
US20230418730A1 (en) | Test case generator using automation library of an information handling system | |
US11036527B2 (en) | Class splitting in object-oriented environments | |
US10540151B1 (en) | Graphical customization of a firmware-provided user interface (UI) | |
JP6482362B2 (en) | Source code generation system, source code generation device, source code generation method and program | |
CN116501415A (en) | Command execution method and device, electronic equipment and computer readable storage medium | |
US10649743B2 (en) | Application developing method and system | |
US11809833B2 (en) | System and method for image localization in knowledge base content | |
US20220414222A1 (en) | Trusted processor for saving gpu context to system memory | |
JP7050587B2 (en) | Violation dependency detector and violation dependency detector | |
US20230195666A1 (en) | Providing Platform Management Profiles to Platform Management Drivers on Electronic Devices | |
US20200050783A1 (en) | Information processing device and computer readable medium | |
US20230100758A1 (en) | Unique identifier creation and management for elaborated platform | |
US11868225B2 (en) | Provided inputs and provided output actions for use in platform management policies for platform management drivers | |
CN114706715B (en) | Control method, device, equipment and medium for distributed RAID based on BMC |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20180221 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20181031 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20181106 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20181224 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20190115 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190212 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6482362 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |