JP2007079906A - Source code generator - Google Patents

Source code generator Download PDF

Info

Publication number
JP2007079906A
JP2007079906A JP2005266453A JP2005266453A JP2007079906A JP 2007079906 A JP2007079906 A JP 2007079906A JP 2005266453 A JP2005266453 A JP 2005266453A JP 2005266453 A JP2005266453 A JP 2005266453A JP 2007079906 A JP2007079906 A JP 2007079906A
Authority
JP
Japan
Prior art keywords
source code
input data
input
storage means
generated
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
JP2005266453A
Other languages
Japanese (ja)
Inventor
Hiroshi Nagasawa
博志 長澤
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.)
Hitachi Software Engineering Co Ltd
Original Assignee
Hitachi Software Engineering Co 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 Hitachi Software Engineering Co Ltd filed Critical Hitachi Software Engineering Co Ltd
Priority to JP2005266453A priority Critical patent/JP2007079906A/en
Publication of JP2007079906A publication Critical patent/JP2007079906A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a source code generator capable of generating a source code from input specifications while leaving an editing part when regenerating the source code and reflecting the change of the source code on the input specifications further. <P>SOLUTION: The source code generator 1 comprises: an input specification analysis part 21 for generating input data 4 by analyzing the input specifications; a source code generation part 22 for generating the source code 8 by converting the parameter of a source code template 6 to the information of the input data 4; a source code editing part 23 for reading and editing the source code 8; a source code analysis part 24 for analyzing the syntax of the source code 8 and generating new input data 4A; and an input specification generation part 25 for generating new input specifications 2A by setting the information of the new input data 4A to an input specification template 10. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、入力仕様からソースコードを生成するソースコード生成装置に関するものである。   The present invention relates to a source code generation device that generates source code from input specifications.

従来、入力仕様からソースコードを生成する装置として、例えば特許文献1に開示されたものが知られている。
特許文献1を例に挙げて説明すると、ソースコードのテンプレートのパラメータを入力仕様の情報に変換することによって、ソースコードを生成するというものである。
特開2002−157118号公報
Conventionally, as an apparatus for generating source code from input specifications, for example, one disclosed in Patent Document 1 is known.
For example, Japanese Patent Laid-Open No. 2004-151867 describes generating source code by converting source code template parameters into input specification information.
JP 2002-157118 A

しかしながら、上記の従来技術には次の問題点がある。
(1)入力仕様を変更し、ソースコードを再生成する場合、再度ソースコードのテンプレートと入力仕様の情報からソースコードを生成するので、ソースコードの編集部分が元に戻ってしまう。そのため、入力仕様を変更する場合、変更部分に対して手動でソースコードを実装するか、または、ソースコードを再生成する時に編集したソースコードを保存しておき、生成したソースコードと編集したソースコードとを比較し、編集部分を生成したソースコードに追加するといった煩雑な作業が必要になる。
However, the above prior art has the following problems.
(1) When the input specification is changed and the source code is regenerated, the source code is generated again from the source code template and the input specification information, so that the edited portion of the source code is restored. Therefore, when changing the input specifications, manually implement the source code for the changed part, or save the edited source code when regenerating the source code, and generate the edited source code and the edited source. Complicated work such as comparing the code and adding the edited part to the generated source code is required.

(2)ソースコードを変更した場合、入力仕様と整合性が取れなくなる可能性があるため、ソースコードを変更する場合は、入力仕様も変更し整合性を取る必要がある。 (2) If the source code is changed, it may become inconsistent with the input specification. Therefore, when the source code is changed, it is necessary to change the input specification to ensure consistency.

以上の現状に鑑み、本発明は、ソースコードを再生成する場合に、編集部分を残しつつ入力仕様からソースコードを生成することができ、更に、ソースコードの変更を入力仕様に反映することができるソースコード生成装置を提供することを目的とする。   In view of the above situation, when regenerating the source code, the present invention can generate the source code from the input specification while leaving the edited portion, and can further reflect the change of the source code in the input specification. An object of the present invention is to provide a source code generation device that can be used.

上記の課題を解決すべく、本発明は以下の構成を提供する。
請求項1に係る発明は、入力仕様を解析することにより、ソースコードテンプレートのパラメータとなる入力データを生成し、該入力データを記憶手段に格納する入力仕様解析手段と、
記憶手段から読み込んだ前記ソースコードテンプレートのパラメータを、記憶手段から読み込んだ前記入力データの情報に変換することにより、ソースコードを生成し、該ソースコードを記憶手段に格納するソースコード生成手段と、
記憶手段内のソースコードを読み込み編集するソースコード編集手段と、
該ソースコードを記憶手段から読み込んで構文解析し、新入力データを生成し、記憶手段に格納するソースコード解析手段と、
記憶手段から入力仕様テンプレートと該新入力データとを読み込み、該入力仕様テンプレートに該新入力データの情報を設定することにより新入力仕様を生成する入力仕様生成手段とを備えることを特徴とするソースコード生成装置を提供するものである。
In order to solve the above problems, the present invention provides the following configurations.
The invention according to claim 1, by analyzing the input specification, generates input data that is a parameter of the source code template, and stores the input data in a storage unit;
Source code generation means for generating source code by converting the parameters of the source code template read from the storage means into information of the input data read from the storage means, and storing the source code in the storage means;
Source code editing means for reading and editing the source code in the storage means;
Source code analysis means for reading the source code from the storage means and analyzing the syntax, generating new input data, and storing it in the storage means;
Source comprising: input specification generating means for generating an input specification by reading an input specification template and the new input data from storage means and setting information of the new input data in the input specification template A code generation device is provided.

請求項2に係る発明は、上記ソースコード編集手段は、記憶手段内の予め生成された生成ソースコードの存在の有無を判定する機能を備え、
上記ソースコード解析手段は、該ソースコード編集手段によって、記憶手段内に生成ソースコードが存在すると判断された時、該生成ソースコードを読み込み解析して構文解析情報を生成し、該構文解析情報を記憶手段に格納する機能を備え、
上記ソースコード生成手段は、該構文解析情報と、上記入力データとを読み込み、ソースコードを再生成する機能を備えていることを特徴とする請求項1記載のソースコード生成装置を提供するものである。
The invention according to claim 2 is characterized in that the source code editing means has a function of determining the presence or absence of the generated source code generated in advance in the storage means,
When the source code editing means determines that the generated source code exists in the storage means, the source code analyzing means reads and analyzes the generated source code and generates syntax analysis information. It has a function to store in the storage means,
2. The source code generation device according to claim 1, wherein the source code generation means has a function of reading the syntax analysis information and the input data and regenerating the source code. is there.

本発明の請求項1記載の発明によれば、入力仕様を解析することにより、ソースコードテンプレートのパラメータとなる入力データを生成し、該入力データを記憶手段に格納する入力仕様解析手段と、
記憶手段から読み込んだ前記ソースコードテンプレートのパラメータを、記憶手段から読み込んだ前記入力データの情報に変換することにより、ソースコードを生成し、該ソースコードを記憶手段に格納するソースコード生成手段と、
記憶手段内のソースコードを読み込み編集するソースコード編集手段と、
該ソースコードを記憶手段から読み込んで構文解析し、新入力データを生成し、記憶手段に格納するソースコード解析手段と、
記憶手段から入力仕様テンプレートと該新入力データとを読み込み、該入力仕様テンプレートに該新入力データの情報を設定することにより新入力仕様を生成する入力仕様生成手段とを備えるソースコード生成装置を提供するので、ソースコードを再生成する場合に、編集部分を残しつつ入力仕様からソースコードを生成することができる。
According to the invention described in claim 1 of the present invention, by analyzing the input specification, the input specification serving as a parameter of the source code template is generated, and the input specification analyzing means for storing the input data in the storage means;
Source code generation means for generating source code by converting the parameters of the source code template read from the storage means into information of the input data read from the storage means, and storing the source code in the storage means;
Source code editing means for reading and editing the source code in the storage means;
Source code analysis means for reading the source code from the storage means and analyzing the syntax, generating new input data, and storing it in the storage means;
Provided is a source code generation device including an input specification generation unit that reads an input specification template and the new input data from a storage unit, and sets the information of the new input data in the input specification template to generate a new input specification. Therefore, when regenerating the source code, it is possible to generate the source code from the input specification while leaving the edited part.

更に、生成したソースコードを構文解析し新入力データを生成することで、ソースコードの変更を新入力仕様に反映することができる。   Furthermore, by parsing the generated source code and generating new input data, the change of the source code can be reflected in the new input specification.

請求項2記載の発明によれば、上記ソースコード編集手段は、記憶手段内の予め生成された生成ソースコードの存在の有無を判定する機能を備え、
上記ソースコード解析手段は、該ソースコード編集手段によって、記憶手段内に生成ソースコードが存在すると判断された時、該生成ソースコードを読み込み解析して構文解析情報を生成し、該構文解析情報を記憶手段に格納する機能を備え、
上記ソースコード生成手段は、該構文解析情報と、上記入力データとを読み込み、ソースコードを再生成する機能を備えているので、請求項1記載の発明の効果に加え、予め生成された生成ソースコードが存在する場合に、生成ソースコードを構文解析することで生成対象のみソースコードを生成することができる。
According to the second aspect of the present invention, the source code editing means has a function of determining the presence / absence of a pre-generated generated source code in the storage means,
When the source code editing means determines that the generated source code exists in the storage means, the source code analyzing means reads and analyzes the generated source code and generates syntax analysis information. It has a function to store in the storage means,
The source code generation means has a function of reading the syntax analysis information and the input data and regenerating the source code. Therefore, in addition to the effect of the invention of claim 1, the generation source generated in advance When the code exists, the source code can be generated only for the generation target by parsing the generated source code.

以下、実施例を示した図面を参照しつつ本発明の実施の形態を説明する。
図1は、本発明の一実施形態を示すソースコード生成装置1の内部構成を概略的に示すブロック図であり、ソースコード生成装置1は、記憶手段として、入力仕様2を格納する第1記憶部3と、入力データ4を格納する第2記憶部5と、ソースコードテンプレート6を格納する第3記憶部7と、ソースコード8を格納する第4記憶部9と、入力仕様テンプレート10を格納する第5記憶部11とを備え、更に、入力仕様2を解析し、ソースコードテンプレート6のパラメータとなる入力データ4を生成し、第2記憶部5に格納する入力仕様解析手段である入力仕様解析部21と、ソースコードテンプレート6と入力データ4を読み込み、ソースコードテンプレート6のパラメータを入力データ4の情報に変換することでソースコード8を生成し、第4記憶部9に格納するソースコード生成手段であるソースコード生成部22と、第4記憶部9内のソースコード8を読み込み編集するソースコード編集手段であるソースコード編集部23と、第4記憶部9内のソースコード8を読み込み構文解析し、新入力データ4Aを生成し、第2記憶部5に格納するソースコード解析手段であるソースコード解析部24と、入力仕様テンプレート10と新入力データ4Aを読み込み、入力仕様テンプレート10に新入力データ4Aの情報を設定することで新入力仕様2Aを生成する入力仕様生成手段である入力仕様生成部25とを備えている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings showing examples.
FIG. 1 is a block diagram schematically showing an internal configuration of a source code generation device 1 according to an embodiment of the present invention. The source code generation device 1 stores a first memory for storing an input specification 2 as storage means. Unit 3, a second storage unit 5 for storing input data 4, a third storage unit 7 for storing source code template 6, a fourth storage unit 9 for storing source code 8, and an input specification template 10 A fifth storage unit 11 that further analyzes the input specification 2, generates input data 4 that is a parameter of the source code template 6, and stores the input data in the second storage unit 5. The analysis unit 21, the source code template 6 and the input data 4 are read, and the source code 8 is generated by converting the parameters of the source code template 6 into the information of the input data 4. , A source code generation unit 22 which is a source code generation unit stored in the fourth storage unit 9, a source code editing unit 23 which is a source code editing unit which reads and edits the source code 8 in the fourth storage unit 9, 4 Source code 8 in the storage unit 9 is read and parsed to generate new input data 4A and stored in the second storage unit 5, a source code analysis unit 24 that is a source code analysis unit, an input specification template 10 and a new An input specification generation unit 25 that is an input specification generation unit that generates the new input specification 2A by reading the input data 4A and setting the information of the new input data 4A in the input specification template 10 is provided.

又、前記ソースコード編集部23は、第4記憶部9内に予め生成された生成ソースコード8Aが存在するかどうかの存在の有無を判定する機能を備え、前記ソースコード解析部24は、ソースコード編集部23によって、生成ソースコード8Aが存在すると判断された時、生成ソースコード8Aを読み込み解析して構文解析情報26を生成し、構文解析情報26を第2記憶部部5に格納する機能を備え、前記ソースコード生成部22は構文解析情報26と、前記入力データ4とを読み込み、再生成ソースコード8Bを生成する機能を備えている。   The source code editing unit 23 has a function of determining whether or not the generated source code 8A previously generated in the fourth storage unit 9 exists, and the source code analyzing unit 24 A function for reading and analyzing the generated source code 8A to generate syntax analysis information 26 when the code editing unit 23 determines that the generated source code 8A exists, and storing the syntax analysis information 26 in the second storage unit 5 The source code generation unit 22 has a function of reading the parsing information 26 and the input data 4 and generating the regenerated source code 8B.

尚、前記入力仕様2を格納する第1記憶部3と、入力データ4を格納する第2記憶部5と、ソースコードテンプレート6を格納する第3記憶部7と、ソースコード8を格納する第4記憶部9と、入力仕様テンプレート10を格納する第5記憶部11とは、同一の記憶装置、例えば、ハードディスクで構成しても良い。   The first storage unit 3 that stores the input specification 2, the second storage unit 5 that stores the input data 4, the third storage unit 7 that stores the source code template 6, and the first storage unit that stores the source code 8. The fourth storage unit 9 and the fifth storage unit 11 that stores the input specification template 10 may be configured by the same storage device, for example, a hard disk.

図2は、前記ソースコード生成装置1によってソースコード8を生成する方法を示すフローチャートである。同図及び図1を参照して、ソースコード8を生成する方法を説明する。まず、入力仕様解析部21が、第1記憶部3からソースコードテンプレート6のパラメータとなる情報を持つ入力仕様2を読み込み、解析し(ステップS11)、入力データ4を生成して第2記憶部5に格納する(ステップS12)。   FIG. 2 is a flowchart showing a method for generating the source code 8 by the source code generating apparatus 1. A method for generating the source code 8 will be described with reference to FIG. First, the input specification analysis unit 21 reads and analyzes the input specification 2 having information as parameters of the source code template 6 from the first storage unit 3 (Step S11), generates the input data 4 and generates the second storage unit. 5 (step S12).

次に、ソースコード生成部22が、ステップS12で生成した入力データ4を第2記憶部5から読み込み(ステップS13)、更に、第3記憶部7からソースコードテンプレート6を読み込む(ステップS14)。   Next, the source code generation unit 22 reads the input data 4 generated in step S12 from the second storage unit 5 (step S13), and further reads the source code template 6 from the third storage unit 7 (step S14).

更に、ソースコード編集部23が、第4記憶部9内の予め生成した生成ソースコード8Aの存在の有無を判定する(ステップS15)。判定の結果は、矢印A及びBの如く、ソースコード生成部22及びソースコード解析部24に伝達される。   Further, the source code editing unit 23 determines whether or not the generated source code 8A generated in advance in the fourth storage unit 9 exists (step S15). The determination result is transmitted to the source code generation unit 22 and the source code analysis unit 24 as indicated by arrows A and B.

生成ソースコード8Aが存在しない場合、ソースコード生成部22が、
ソースコードテンプレート6のパラメータを入力データ4の情報に変換することでソースコード8を生成し、第4記憶部9に格納する(ステップS16)。もし、生成ソースコード8Aが第4記憶部9に既に存在している場合は、ソースコード解析部24が生成ソースコード8Aを構文解析し、構文解析した構文解析情報26を第2記憶部5に格納する(ステップS17)。
When the generated source code 8A does not exist, the source code generating unit 22
The source code 8 is generated by converting the parameters of the source code template 6 into the information of the input data 4, and stored in the fourth storage unit 9 (step S16). If the generated source code 8A already exists in the fourth storage unit 9, the source code analysis unit 24 parses the generated source code 8 A, and the parsed parsing information 26 is stored in the second storage unit 5. Store (step S17).

そして、ソースコード生成部22は、第2記憶部5から読み込んだ構文解析情報26及び入力データ4によって生成対象のみ再生成ソースコード8Bを生成し、第4記憶部9に格納する(ステップS18)。   Then, the source code generation unit 22 generates the regenerated source code 8B only for the generation target based on the parsing information 26 and the input data 4 read from the second storage unit 5, and stores them in the fourth storage unit 9 (step S18). .

次に、ソースコード編集部23によって第4記憶部9から生成したソースコード8又は再生成ソースコード8Bを読み取り編集し、編集した編集ソースコード8Cを第4記憶部9に格納する(ステップS19)。   Next, the source code editing unit 23 reads and edits the source code 8 or the regenerated source code 8B generated from the fourth storage unit 9, and stores the edited edited source code 8C in the fourth storage unit 9 (step S19). .

編集後、入力仕様2に変更がある場合は、前述したステップS11からステップS19までの処理を繰り返す。   If there is a change in the input specification 2 after editing, the processing from step S11 to step S19 described above is repeated.

図3に、入力仕様2の例を示す。同図は、業務処理を実行する業務クラスの仕様書を表している。この例では、Excelなどの表計算ソフトを使用して仕様書を作成した場合を表している。同図に示す入力仕様2には、業務クラスのパッケージ名101、クラス名102、メソッドのインタフェースの定義がある。メソッドのインタフェースの定義には、業務クラスのメソッド名103、メソッドの引数104、メソッドの戻り値105、メソッドの説明106がある。メソッドのインタフェースの定義は複数定義できるようになっている。   FIG. 3 shows an example of the input specification 2. The figure shows a specification of a business class that executes business processing. In this example, the specification is created using spreadsheet software such as Excel. The input specification 2 shown in the figure includes a business class package name 101, a class name 102, and a method interface definition. The method interface definition includes a business class method name 103, a method argument 104, a method return value 105, and a method description 106. Multiple method interface definitions can be defined.

図4に、入力仕様解析部21が入力仕様2を読み込み、生成する入力データ4の例を示す。この例では、入力データ4は、XML(Extensible Markup Language)ファイルとして生成している。同図は、図3の入力仕様2から生成した入力データ4を表している。図4の入力データ4は、ソースコードテンプレート6のパラメータとなる業務クラスのパッケージ名「sample」201、クラス名「CustomerLogic」202、メソッド名「findAll」203、メソッドのパラメータ「void」204、メソッド戻り値「List」205、メソッドの説明「顧客の一覧を取得する」206、メソッド名「findByPrimaryKey」207、メソッドのパラメータ「Strin id」208、メソッドの戻り値「Customer」209、メソッドの説明「顧客IDで検索し顧客を取得する」210の情報を持っている。   FIG. 4 shows an example of input data 4 that the input specification analysis unit 21 reads the input specification 2 and generates. In this example, the input data 4 is generated as an XML (Extensible Markup Language) file. The figure shows the input data 4 generated from the input specification 2 of FIG. The input data 4 in FIG. 4 includes a business class package name “sample” 201, a class name “CustomerLogic” 202, a method name “findAll” 203, a method parameter “void” 204, and a method return that are parameters of the source code template 6. Value “List” 205, method description “acquire customer list” 206, method name “findByPrimaryKey” 207, method parameter “Strin id” 208, method return value “Customer” 209, method description “customer ID” Search for and acquire a customer ”210 information.

図5に、ソースコードテンプレート6の例を示す。ソースコードテンプレート6には、入力データ4の情報と変換するパラメータが定義してある。同図では、「$」で始まる文字列がパラメータを表している。同図は、パッケージ名301、クラス名302、メソッドの説明304、メソッドの戻り値305、メソッド名306、メソッドの引数307のパラメータを持っている。図中、符号303は、メソッドのインタフェースの定義を繰り返し変換することを表している。   FIG. 5 shows an example of the source code template 6. The source code template 6 defines information of the input data 4 and parameters to be converted. In the figure, a character string starting with “$” represents a parameter. This figure has parameters of a package name 301, a class name 302, a method description 304, a method return value 305, a method name 306, and a method argument 307. In the figure, reference numeral 303 represents that the method interface definition is repeatedly converted.

図6に、ソースコード生成部22が図5のソースコードテンプレート6のパラメータを図4の入力データ4の情報に変換し、生成したソースコード8を示す。   6 shows source code 8 generated by the source code generation unit 22 converting the parameters of the source code template 6 of FIG. 5 into the information of the input data 4 of FIG.

図7は、ソースコード生成部22が生成したソースコード8を編集した編集ソースコード8Cを示している。同図では、行クラスのパッケージ名を「sample.logic」401に変更し、顧客を登録するメソッドのインタフェース「insert」402を追加し、顧客の一覧を取得するメソッド「findAll」403と顧客IDで検索し顧客を取得する「findByPrimaryKey」404を実装したものである。   FIG. 7 shows an edited source code 8C obtained by editing the source code 8 generated by the source code generator 22. In the figure, the package name of the row class is changed to “sample.logic” 401, the interface “insert” 402 of the method for registering the customer is added, and the method “findAll” 403 for acquiring the customer list and the customer ID are added. This implements “findByPrimaryKey” 404 for searching and acquiring customers.

次に、再度、図2及び図1を参照して、前述したステップS19の編集後に、編集ソースコード8Cを再生成する方法について説明する。図7の編集ソースコード8Cのように編集した後に再生成ソースコード8Bを再生成する場合は、ソースコード解析部24によって、編集ソースコード8Cを第4記憶部9から読み込み構文解析し、パッケージ名、クラス名、メソッドの一覧を取得し、第2記憶部5に構文解析情報26として格納し(ステップS20)、ソースコード生成部22によって、第2記憶部5から読み込んだ構文解析情報26を、同様に、第2記憶部5から読み込んだ入力データ4のパッケージ名、クラス名に変換する。その場合、メソッドのインタフェースの場合は、メソッドの一覧に存在しない場合のみ生成し、既に存在している場合は生成しない。以上のように、生成対象のみソースコードを生成し、再生成ソースコード8Bとして再生成する(ステップS21)。   Next, with reference to FIGS. 2 and 1 again, a method of regenerating the edited source code 8C after editing in step S19 described above will be described. When the regenerated source code 8B is regenerated after being edited like the edited source code 8C in FIG. 7, the source code analyzing unit 24 reads the edited source code 8C from the fourth storage unit 9 and parses the package name. A list of class names and methods is obtained, stored as syntax analysis information 26 in the second storage unit 5 (step S20), and the syntax analysis information 26 read from the second storage unit 5 by the source code generation unit 22 is Similarly, the input data 4 read from the second storage unit 5 is converted into the package name and class name. In that case, in the case of a method interface, it is generated only when it does not exist in the method list, and is not generated when it already exists. As described above, the source code is generated only for the generation target, and regenerated as the regenerated source code 8B (step S21).

図8は、ソースコード8の変更を入力仕様2に反映するために新入力仕様2Aを生成する方法を示すフローチャートである。同図及び図1を参照して、新入力仕様2Aを生成する方法を説明する。   FIG. 8 is a flowchart showing a method of generating a new input specification 2A in order to reflect the change of the source code 8 in the input specification 2. A method for generating the new input specification 2A will be described with reference to FIG.

まず、ソースコード解析部24が、第4記憶部9から再生成ソースコード8Bを読み込んで再生成ソースコード8Bを構文解析し(ステップS31)、新入力データ4Aを生成し、第2記憶部5に格納する(ステップS32)。   First, the source code analysis unit 24 reads the regenerated source code 8B from the fourth storage unit 9, parses the regenerated source code 8B (step S31), generates new input data 4A, and the second storage unit 5 (Step S32).

そして、入力仕様生成部25がステップS32で生成した新入力データ4Aを第2記憶部5から読み込み(ステップS33)、入力仕様テンプレート10を第5記憶部11から読み込み(ステップS34)、入力仕様テンプレート10に、新入力データ4Aの情報を設定することで新入力仕様2Aを生成する(ステップS35)。   Then, the input specification generation unit 25 reads the new input data 4A generated in step S32 from the second storage unit 5 (step S33), the input specification template 10 is read from the fifth storage unit 11 (step S34), and the input specification template 10, the new input specification 2A is generated by setting the information of the new input data 4A (step S35).

図9に、ソースコード解析部24が図7の編集ソースコード8Cを解析し生成した新入力データ4Aを示す。新入力データ4Aは、変更された業務クラスのパッケージ名「sample.logic」501及び業務クラスのクラス名「CustomerLogic」502に更新され、メソッドのインタフェースの定義(メソッド名「insert」503、メソッドの引数「Customer customer」504、メソッドの戻り値「void」505、メソッドの説明「顧客を登録する」506)が追加されている。   FIG. 9 shows new input data 4A generated by the source code analysis unit 24 analyzing and editing the edited source code 8C of FIG. The new input data 4A is updated to the package name “sample.logic” 501 of the changed business class and the class name “CustomerLogic” 502 of the business class, and the method interface definition (method name “insert” 503, method argument "Customer customer" 504, method return value "void" 505, and method description "register customer" 506) are added.

図10に、入力仕様テンプレート10の例を示す。図3の入力仕様2と同様に、業務クラスのパッケージ名601、クラス名602、メソッド名603、メソッドの引数604、メソッドの戻り値605、メソッドの説明606がある。   FIG. 10 shows an example of the input specification template 10. Similar to the input specification 2 in FIG. 3, there are a business class package name 601, a class name 602, a method name 603, a method argument 604, a method return value 605, and a method description 606.

図11に、図10の入力仕様テンプレート10に、図9の新入力データ4Aの情報を設定することで生成した新入力仕様2Aを示す。図10の業務クラスのパッケージ名601に図9の「sample.logic」501を設定し、図10の業務クラスのクラス名602に図9の「CustomerLogic」502を設定し、図10のメソッドのインタフェースの定義603、604、605、606に図9の「insert」503、「Customer customer」504、「void」505、「顧客を登録する」506を設定し、メソッドのインタフェースの定義について繰り返し設定する。   FIG. 11 shows the new input specification 2A generated by setting the information of the new input data 4A of FIG. 9 in the input specification template 10 of FIG. The “sample.logic” 501 in FIG. 9 is set in the package name 601 in FIG. 10, the “CustomerLogic” 502 in FIG. 9 is set in the class name 602 in FIG. 10, and the method interface in FIG. 9 are set to “insert” 503, “Customer customer” 504, “void” 505, and “register customer” 506 in FIG. 9, and the method interface definition is repeatedly set.

以上のように、本発明によれば、ソースコード8を再生成する場合に、編集部分を残しつつ入力仕様からソースコード8を生成することができる。   As described above, according to the present invention, when the source code 8 is regenerated, the source code 8 can be generated from the input specifications while leaving the edited portion.

更に、生成したソースコード8を構文解析し新入力データ4Aを生成することで、ソースコード8の変更を新入力仕様に反映することができる。   Further, by parsing the generated source code 8 and generating new input data 4A, the change of the source code 8 can be reflected in the new input specification.

又、予め生成された生成ソースコード8Aが存在する場合に、生成ソースコード8Aを構文解析することで生成対象のみソースコード8を生成することができる。   In addition, when the generated source code 8A generated in advance exists, the source code 8 can be generated only for the generation target by parsing the generated source code 8A.

本発明によるソースコード生成装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the source code production | generation apparatus by this invention. 本発明のソースコード生成装置によるソースコードを生成する処理手順の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the process sequence which produces | generates the source code by the source code production | generation apparatus of this invention. 本発明の入力仕様を示す図である。It is a figure which shows the input specification of this invention. 本発明の入力データを示す図である。It is a figure which shows the input data of this invention. 本発明のソースコードテンプレートを示す図である。It is a figure which shows the source code template of this invention. 本発明のソースコードを示す図である。It is a figure which shows the source code of this invention. 本発明の編集ソースコードを示す図である。It is a figure which shows the edit source code of this invention. 本発明のソースコード生成装置による新入力仕様を生成する処理手順の概要を示すフローチャートである。It is a flowchart which shows the outline | summary of the process sequence which produces | generates the new input specification by the source code production | generation apparatus of this invention. 本発明の新入力データを示す図である。It is a figure which shows the new input data of this invention. 本発明の入力仕様テンプレートを示す図である。It is a figure which shows the input specification template of this invention. 本発明の新入力仕様を示す図である。It is a figure which shows the new input specification of this invention.

符号の説明Explanation of symbols

1 ソースコード生成装置
2 入力仕様
2A 新入力仕様
4 入力データ
4A 新入力データ
6 ソースコードテンプレート
8 ソースコード
8A 生成ソースコード
10 入力仕様テンプレート
26 構文解析情報
DESCRIPTION OF SYMBOLS 1 Source code generator 2 Input specification 2A New input specification 4 Input data 4A New input data 6 Source code template 8 Source code 8A Generated source code 10 Input specification template 26 Parsing information

Claims (2)

入力仕様を解析することにより、ソースコードテンプレートのパラメータとなる入力データを生成し、該入力データを記憶手段に格納する入力仕様解析手段と、
記憶手段から読み込んだ前記ソースコードテンプレートのパラメータを、記憶手段から読み込んだ前記入力データの情報に変換することにより、ソースコードを生成し、該ソースコードを記憶手段に格納するソースコード生成手段と、
記憶手段内のソースコードを読み込み編集するソースコード編集手段と、
該ソースコードを記憶手段から読み込んで構文解析し、新入力データを生成し、記憶手段に格納するソースコード解析手段と、
記憶手段から入力仕様テンプレートと該新入力データとを読み込み、該入力仕様テンプレートに該新入力データの情報を設定することにより新入力仕様を生成する入力仕様生成手段とを備えることを特徴とするソースコード生成装置。
Analyzing the input specifications, generating input data as parameters of the source code template, and storing the input data in the storage means;
Source code generation means for generating source code by converting the parameters of the source code template read from the storage means into information of the input data read from the storage means, and storing the source code in the storage means;
Source code editing means for reading and editing the source code in the storage means;
Source code analysis means for reading the source code from the storage means and analyzing the syntax, generating new input data, and storing it in the storage means;
Source comprising: input specification generating means for generating an input specification by reading an input specification template and the new input data from storage means and setting information of the new input data in the input specification template Code generator.
上記ソースコード編集手段は、記憶手段内の予め生成された生成ソースコードの存在の有無を判定する機能を備え、
上記ソースコード解析手段は、該ソースコード編集手段によって、記憶手段内に生成ソースコードが存在すると判断された時、該生成ソースコードを読み込み解析して構文解析情報を生成し、該構文解析情報を記憶手段に格納する機能を備え、
上記ソースコード生成手段は、該構文解析情報と、上記入力データとを読み込み、ソースコードを再生成する機能を備えていることを特徴とする請求項1記載のソースコード生成装置。
The source code editing means has a function of determining the presence or absence of a pre-generated generated source code in the storage means,
When the source code editing means determines that the generated source code exists in the storage means, the source code analyzing means reads and analyzes the generated source code and generates syntax analysis information. It has a function to store in the storage means,
2. The source code generation apparatus according to claim 1, wherein the source code generation means has a function of reading the parsing information and the input data and regenerating the source code.
JP2005266453A 2005-09-14 2005-09-14 Source code generator Pending JP2007079906A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005266453A JP2007079906A (en) 2005-09-14 2005-09-14 Source code generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005266453A JP2007079906A (en) 2005-09-14 2005-09-14 Source code generator

Publications (1)

Publication Number Publication Date
JP2007079906A true JP2007079906A (en) 2007-03-29

Family

ID=37940151

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005266453A Pending JP2007079906A (en) 2005-09-14 2005-09-14 Source code generator

Country Status (1)

Country Link
JP (1) JP2007079906A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009211143A (en) * 2008-02-29 2009-09-17 Toshiba Corp Information processor and information processing program
KR100935683B1 (en) * 2007-12-17 2010-01-08 한국전자통신연구원 Apparatus for generating device driver specification based source code
JP2013050868A (en) * 2011-08-31 2013-03-14 Mitsubishi Electric Corp Information processing apparatus, information processing method and program
US8631385B2 (en) 2009-02-26 2014-01-14 International Business Machines Corporation Optimizing code generation system with input data integration

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07129382A (en) * 1993-11-02 1995-05-19 Nri & Ncc Co Ltd Spiral type object oriented software development supporting system and software developing method
JP2000066889A (en) * 1998-08-19 2000-03-03 Nippon Telegr & Teleph Corp <Ntt> Method and device for supplying difference between source code and design information
JP2002157118A (en) * 2000-09-06 2002-05-31 Ns Solutions Corp Program generation assisting device, program generating method, storage medium, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07129382A (en) * 1993-11-02 1995-05-19 Nri & Ncc Co Ltd Spiral type object oriented software development supporting system and software developing method
JP2000066889A (en) * 1998-08-19 2000-03-03 Nippon Telegr & Teleph Corp <Ntt> Method and device for supplying difference between source code and design information
JP2002157118A (en) * 2000-09-06 2002-05-31 Ns Solutions Corp Program generation assisting device, program generating method, storage medium, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100935683B1 (en) * 2007-12-17 2010-01-08 한국전자통신연구원 Apparatus for generating device driver specification based source code
JP2009211143A (en) * 2008-02-29 2009-09-17 Toshiba Corp Information processor and information processing program
US8631385B2 (en) 2009-02-26 2014-01-14 International Business Machines Corporation Optimizing code generation system with input data integration
JP2013050868A (en) * 2011-08-31 2013-03-14 Mitsubishi Electric Corp Information processing apparatus, information processing method and program

Similar Documents

Publication Publication Date Title
US7761788B1 (en) System and method for capturing document style by example
AU2006200047B2 (en) Data store for software application documents
JP5060043B2 (en) Context-free document parts with alternative formats
JP4924976B2 (en) Software development support system
EP1630702A1 (en) System and method for automatically generating xml schema for validating xml input documents
US9122664B2 (en) Method for automatically creating transforms
JP2009521026A (en) Method and system for editing text with search and replace functions that leverage derivation of search and replace inputs
JP4216323B2 (en) Structured data conversion method
CN113312033A (en) Template protocol generation and management method
JP2007079906A (en) Source code generator
JP2008052356A (en) Source code automatic generation device
KR100846203B1 (en) Method for generating mobile application and record media recorded program for realizing the same
KR101705254B1 (en) Apparatus and program
JP4776972B2 (en) Cache generation method, apparatus, program, and recording medium
JP2009080681A (en) Program structure parsing method and device
JP4698943B2 (en) Program production method, program production apparatus, program automatic conversion method, and program
JP2009134662A (en) Performance test data construction tool
JP5359446B2 (en) Information processing system, access path determination method, and access path determination program
JP2007094453A (en) Program development support system, program development support method and program
JP4220439B2 (en) Structured data conversion apparatus and method
Espinazo-Pagán et al. Metamodel syntactic sheets: An approach for defining textual concrete syntaxes
JP2005250593A (en) Object information generating device
JP2002140325A (en) Medium with document generating program recorded thereon
JP2005267531A (en) Structure converting device for structured document, and program for the same
JP2001282520A (en) Method and device for preparing program and recording medium for program preparation

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20071218

A977 Report on retrieval

Effective date: 20101220

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110426

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110823