JP2004038319A - Program source code generation method and program - Google Patents

Program source code generation method and program Download PDF

Info

Publication number
JP2004038319A
JP2004038319A JP2002191199A JP2002191199A JP2004038319A JP 2004038319 A JP2004038319 A JP 2004038319A JP 2002191199 A JP2002191199 A JP 2002191199A JP 2002191199 A JP2002191199 A JP 2002191199A JP 2004038319 A JP2004038319 A JP 2004038319A
Authority
JP
Japan
Prior art keywords
source code
program source
data
aggregate
program
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
Application number
JP2002191199A
Other languages
Japanese (ja)
Other versions
JP4223745B2 (en
Inventor
Hitoshi Sumiyoshi
住吉 仁
Shinji Asamori
浅森 信治
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Toshiba Electronics Engineering Corp
Original Assignee
Toshiba Corp
Toshiba Electronics Engineering Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp, Toshiba Electronics Engineering Corp filed Critical Toshiba Corp
Priority to JP2002191199A priority Critical patent/JP4223745B2/en
Publication of JP2004038319A publication Critical patent/JP2004038319A/en
Application granted granted Critical
Publication of JP4223745B2 publication Critical patent/JP4223745B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce a labor required for generating a program source code for materializing functions of serializing and deserializing data. <P>SOLUTION: A program source code automatic generation part 20 (20a, 20b, and the like) refers a set showing units of serializing and deserializing the data and a definition file 22 of data structure defined with elements for serializing and deserializing in the set, generates the program source code for serializing and deserializing the data based on the elements included in the set, classifies the program source codes produced based on the elements, and generates the program source code file 24 including the program source code for serializing and deserializing the set. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、プログラムソースコードを生成するプログラムソースコード生成方法、プログラムソースコード生成プログラムに関する。
【0002】
【従来の技術】
一般に、コンピュータ等の情報処理装置では、所定のデータ構造をもって管理されて記録媒体に記録されているデータを、通信経路を通じて伝送して他の記録媒体に記録させる場合には、所定のデータ構造のデータを直列化(シリアライズ)した上で通信経路を伝送し、直列化されたデータを非直列化(ストラクチャ)して元のデータ構造となるように構造化する処理が実行されている。
【0003】
例えば、パーソナルコンピュータにおいて、処理対象としていたデータをハードディスク装置に書き戻す場合には、プログラムが管理していたデータ構造(例えば、階層構造など)に従ってデータをシリアライズし、またシリアライズされたデータをストラクチャすることで構造化する。
【0004】
従来、こうした所定のデータ構造をもったデータをシリアライズ及びストラクチャするプログラムを作成する場合、データ構造の定義が記載された仕様書などを参照しながら、プログラマがプログラムソースコードを作成している。データ構造の定義では、例えば作成対象とするプログラムソースコードファイルのそれぞれに応じた集合体の定義や、集合体におけるデータに関する情報(サイズやデータ型(文字列、数値など))が定義されている。
【0005】
プログラマは、データ構造の定義に従って、データを所定の手法によってシリアライズ及びストラクチャするプログラムソースコードを、目的とするプログラミング言語を用いて記述することになる。
【0006】
ところで、特開平5−216683には、プログラム記述言語に依存せずにファイル化手順を自動生成するための非言語依存のファイル化手順自動生成方法が記載されている。この生成方法は、ソースプログラムから目的とするマシンの目的ファイルを作成するものであって、データベースにおいて定義された目的ファイルに関与するファイルを定義する構成定義データなどを参照し、ファイル化手順を自動生成する手段を備えている。
【0007】
【発明が解決しようとする課題】
このように従来では、データをシリアライズ及びストラクチャする機能を実現するためのプログラムソースコードを生成する場合には、プログラマがデータ構造の定義が記載された仕様書などを参照しながら、定義されたデータ構造、すなわち集合体や各集合体における要素を定義する記述に応じたプログラムソースコードを入力する作業が必要となっていた。
【0008】
このため、データ構造の定義において集合体及び要素の数が多かったり、さらにデータ構造が多段階の階層構造あるいは要素の定義が他の集合体の定義を引用するといった複雑なものであったりした場合には、プログラマは多大な労力を要してプログラムソースコードを入力していかなければならなかった。
【0009】
また、データ構造の定義が一部変更となった場合には、プログラムソースコードの再生成をしたり、変更が必要なソースコードを抽出して変更したりする必要があった。さらに、シリアライズ及びストラクチャする手法を変更したり、対象とするプログラミング言語を変更する場合などにおいても、プログラムソースコードの再生成が必要な場合があり、多大な労力が必要となっていた。
【0010】
また、特開平5−216683に開示されたファイル化手順自動生成方法は、ファイル化手順作成を自動化することで人間による誤り防止と時間短縮を可能とするものであるが、ソースプログラムから目的とするマシンの目的ファイルを作成するものであって、プログラムソースコードを作成するものではなかった。
【0011】
本発明は前記のような事情を考慮してなされたもので、データを直列化及び非直列化する機能を実現するためのプログラムソースコードの生成に要する労力を軽減することが可能なプログラムソースコード生成方法、プログラムソースコード生成プログラムを提供することを目的とする。
【0012】
【課題を解決するための手段】
本発明は、データを直列化及び非直列化する機能を実現するためのプログラムソースコードを生成するプログラムソースコード生成方法であって、データを直列化及び非直列化する単位を示す集合体とこの集合体の中の直列化及び非直列化する要素が定義された情報を参照し、前記集合体に含まれる前記要素をもとに、データを直列化及び非直列化するためのプログラムソースコードを生成し、前記要素をもとに生成されたプログラムソースコードをまとめて、前記集合体に対する直列化及び非直列化するためのプログラムソースコードを生成することを特徴とする。
【0013】
また、前記情報に複数の集合体が定義されている場合に、それぞれの集合体についてプログラムソースコードを生成することを特徴とする。
【0014】
【発明の実施の形態】
以下、図面を参照して本発明の実施の形態について説明する。図1は本実施形態に係わるプログラムソースコード生成方法を実現するための機能構成を示すブロック図である。本実施形態におけるプログラムソースコード生成方法は、プログラムソースコード生成プログラムをコンピュータ上で実行することで実現される。コンピュータは、例えば半導体メモリ、CD−ROM、DVD、磁気ディスク等の記録媒体に記録されたプログラムソースコード生成プログラムを読み込み、このプログラムによって動作が制御される。
【0015】
図1に示すように、プログラムソースコード生成方法は、ソースコード生成処理部10、定義ファイル記憶部12、ソースコードファイル記憶部14、定義ファイル変更部16、及び変更部18の機能が設けられる。
【0016】
ソースコード生成処理部10は、データ構造を定義する情報をもとにプログラムソースコードを生成する処理を実行するもので、プログラムソースコード自動生成部20(20a,20b…)の機能が設けられる。プログラムソースコード自動生成部20は、定義ファイル記憶部12に記憶されたデータ構造の定義ファイル22を参照し、定義ファイル22において定義されたデータ構造に応じた、データをシリアライズ及びストラクチャする機能を実現するためのプログラムソースコードを生成する。
【0017】
なお、ソースコード生成処理部10には、複数のプログラムソースコード自動生成部20a,20b…を設けることができる。各プログラムソースコード自動生成部20a,20b…は、生成の対象とするプログラムソースコードのプログラミング言語の違い、あるいはシリアライズ及びストラクチャの手法の違いに応じたプログラムソースコードを生成する機能が設けられており、何れかが選択されて実行される。
【0018】
定義ファイル記憶部12は、ソースコード生成処理部10(プログラムソースコード自動生成部20)によって生成されるプログラムソースコードのもとになるデータ構造の定義ファイル22が記憶される。データ構造の定義ファイル22では、データをシリアライズ(直列化)及びストラクチャ(非直列化)する単位を示す集合体とこの集合体の中のシリアライズ及びストラクチャする要素が定義された情報が含まれている。
【0019】
ソースコードファイル記憶部14は、ソースコード生成処理部10(プログラムソースコード自動生成部20)によって生成されたプログラムソースコードファイル24を記憶する。
【0020】
定義ファイル変更部16は、定義ファイル記憶部12に記憶されたデータ構造の定義ファイル22に対して変更を加えるもので、異なるデータ構造に対するプログラムソースコードを再生成する場合などにおいて定義ファイル中のデータ構造の定義を変更する。
【0021】
変更部18は、プログラムソースコードのプログラミング言語の違い、あるいはシリアライズ及びストラクチャの手法の違いに応じたプログラムソースコードを生成するために、必要に応じてデータ構造の定義ファイル22をもとにプログラムソースコードファイル24を生成するプログラムソースコード自動生成部20を変更、すなわち複数のプログラムソースコード自動生成部20a,20b…の何れかを選択して実行させる。なお、ソースコード生成処理部10に複数のプログラムソースコード自動生成部20a,20b…を設けておいて何れかを選択して使用するのではなく、必要に応じて変更部18によってプログラムソースコード自動生成部20を変更する、あるいは別のプログラムソースコード自動生成部20に置き換えるものとしても良い。
【0022】
次に、本実施形態におけるプログラムソースコード作成の動作について、図2に示すフローチャートを参照しながら説明する。
【0023】
図3には、プログラムソースコードファイル24の生成のもとになるデータ構造の定義ファイル22に定義される情報の一例を示している。データ構造の定義ファイル22には、データをシリアライズ及びストラクチャする単位を示す集合体と、この集合体の中のシリアライズ及びストラクチャする要素が定義された情報が含まれている。図3に示す例では、1つの集合体「集合体1」が定義され、この「集合体1」には2つの要素「要素A」「要素B」が定義されている。要素には、例えばデータサイズやデータ型(文字列、数値など)の情報が定義されている。
【0024】
まず、プログラムソースコード自動生成部20は、データ構造の定義ファイル22を参照し、このファイル中に定義された集合体について、定義された要素の有無を判別する(ステップA1)。ここで、集合体に要素が定義されている場合にはその要素を読み込む(ステップA2)。図3に示す例では、「集合体1」に「要素A」「要素B」が定義されているので、まず「要素A」の定義を読み込む。
【0025】
プログラムソースコード自動生成部20は、要素の情報(すなわちデータサイズやデータ型)をもとに、所定の手法によりデータをシリアライズ及びストラクチャするためのプログラムソースコード生成する(ステップA3)。
【0026】
例えば、データをシリアライズするプログラムソースコードは、スタックの位置を順次更新しながら、各要素に定義されたデータをスタックに順次格納していく手続きが記述される。また、データをストラクチャするプログラムソースコードは、シリアライズの手続きと逆となるように、スタックに格納されたデータを、スタックの位置を順次更新しながら読み出して、各要素で定義されたデータを構築する手続きが記述される(なお、具体例について、図5及び図6に示す)。
【0027】
次に、プログラムソースコード自動生成部20は、前述と同様にして定義ファイル22を参照し、このファイル中に定義された集合体について、定義された要素の有無を判別し(ステップA1)、集合体に要素が定義されている場合にはその要素を読み込む(ステップA2)。図3に示す例では、次に「要素B」の定義を読み込む。
【0028】
プログラムソースコード自動生成部20は、要素の情報をもとに、所定の手法によりデータをシリアライズ及びストラクチャするためのプログラムソースコード生成する(ステップA3)。
【0029】
以下、同様にして、集合体に定義された要素の数だけ前述した処理を繰り返して実行し、それぞれの要素のデータをシリアライズ及びストラクチャするためのプログラムソースコード生成する(ステップA1〜A3)。
【0030】
こうして、データ構造の定義ファイル22に定義された集合体に含まれる各要素のデータをシリアライズ及びストラクチャするためのプログラムソースコードを生成すると、これらをまとめて集合体をシリアライズ及びストラクチャするためのプログラムソースコードを生成し、プログラムソースコードファイル24としてソースコードファイル記憶部14に記憶させる(ステップA4)。
【0031】
このようにして、プログラムソースコード自動生成部20は、例えば図3に示すデータ構造の定義ファイル22を参照することで、図4に示すような、定義ファイル22に記述された要素A及び要素Bのデータを扱うことができる、集合体1をシリアライズ及びストラクチャするためのプログラムソースコードからなるプログラムソースコードファイル24を自動生成することができる。
【0032】
次に、データをシリアライズ及びストラクチャをするためのプログラムソースコードの具体例について説明する。
図5は、図3に示すデータ構造の定義ファイル22に該当する定義内容の具体例を示す図、図6は、図5に示すデータ構造の定義ファイル22の定義に応じてプログラムソースコード自動生成部20によって生成されるプログラムソースコードファイル24の具体例を示す図である。
【0033】
図5に示すように、データ構造の定義ファイル22には、「要素A」については「<type>long</type>」の記述にあるように、「long」サイズ(例えば、4byte)のデータであることが定義され、「要素B」については「<type>String</type>」の記述にあるように、文字列のデータであることが定義されている。
【0034】
プログラムソースコード自動生成部20は、図5に示す定義ファイル22の記述に対して、図6に示すようなプログラムソースコードファイル24を生成する。図6に示すプログラムソースコードファイル24では、(1)に示すシリアライズのプログラムソースコードと、(2)に示すストラクチャのプログラムソースコードが含まれている。
【0035】
シリアライズのプログラムソースコード(1)には、要素Aのデータに対するソースコード(1A)と要素Bのデータに対するソースコード(1B)が含まれている。
【0036】
ソースコード(1A)には、「stack[count]」によって示すスタック位置に、要素Aのデータを、要素Aのデータ分のデータサイズを確保して格納し(「memcpy…」の行の記述)、スタックの次にデータを格納する位置を要素Aのデータ分更新する(「count=…」の行の記述)ことを表すソースコードが含まれている。
【0037】
また、ソースコード(1B)には、要素Bのデータ(文字列)の長さを定義し(「size=…」の行の記述)、「stack[count]」によって示すスタック位置に、定義した要素Bのデータの長さを示すデータ(「size」)を、このデータ分を確保して格納し(「memcpy(&stack…sizeof(size)」の行の記述)、スタックの次にデータを格納する位置を要素Bのデータの長さを示すデータ分更新する(「count=…」の行の記述)ことを表すソースコードが含まれている。すなわち、要素Bのデータをスタックに格納する前に、要素Bのデータ(文字列)の長さを示すデータを格納するためのソースコードを生成している。次に、「stack[count]」によって示すスタック位置に、要素Bのデータを、要素Bのデータ分のデータサイズを確保して格納し(「memcpy(&stack…size)」の行の記述)、スタックの次にデータを格納する位置を要素Bのデータ分更新する(「count=…」の行の記述)ことを表すソースコードが含まれている。
【0038】
一方、ストラクチャのプログラムソースコード(2)には、要素Aのデータに対するソースコード(2A)と要素Bのデータに対するソースコード(2B)が含まれている。
【0039】
ソースコード(2A)には、要素Aに対するシリアライズのプログラムソースコード(1A)の記述とは逆の手順で、スタックからデータを読み出して要素Aのデータとし、同様にしてソースコード(2B)には、要素Bに対するシリアライズのプログラムソースコード(1B)の記述とは逆の手順でスタックからデータを読み出して要素Bのデータとするプログラムソースコードが含まれている。要素Bのデータについては、先に要素Bのデータ(文字列)の長さを示すデータを読み出し、このデータに従う長さのデータを読み出している。
【0040】
このようにして、図5に示すような内容を持つデータ構造の定義ファイル22を用意することで、この定義ファイル22で定義された内容に従って、図6に示すようなデータをシリアライズ及びストラクチャするためのプログラムソースコードファイルを自動生成することができる。
【0041】
なお、図5に示す定義ファイル22における要素の記述は一例であって、様々な形式による記述が可能である。プログラムソースコード自動生成部20は、それらの様々な記述による定義に応じた、シリアライズ及びストラクチャするためのプログラムソースコードを生成する機能が設けられている。
【0042】
次に、定義ファイル22に複数の集合体を含むデータ構造が定義される場合について説明する。
前述した説明では、集合体が1つの単純なパターンのデータ構造を対象としているが、本実施形態におけるプログラムソースコード自動生成部20は、集合体が複数有り、また集合体中の要素の定義が他の集合体の定義を引用するような複雑なパターンのデータ構造を対象とすることもできる。
【0043】
図7は、本実施形態における複雑なパターンのデータ構造が定義されたデータ構造の定義ファイル22を対象とした場合のプログラムソースコード作成の動作について説明するフローチャートである。
【0044】
図8には、集合体が複数有り、また集合体中の要素の定義が他の集合体の定義を引用するような複雑なパターンのデータ構造の定義ファイル22の一例を示している。データ構造の定義ファイル22には、複数の集合体1,2と、この集合体1,2の中のシリアライズ及びストラクチャする要素が定義された情報が含まれている。図8に示す例では、「集合体1」には2つの要素「要素A」「要素B」が定義され、「集合体2」には3つの要素「要素A」「要素B」「要素C」が定義されている。なお、集合体2の要素Cは、集合体1全体を引用する定義がされているものとする(具体例については図10(23)に示す)。
【0045】
まず、プログラムソースコード自動生成部20は、データ構造の定義ファイル22を参照し、このファイル中に定義された集合体にの有無を判別する(ステップB1)。ここで、集合体が定義されている場合にはその集合体を読み込む(ステップB2)。図8に示す例では、2つの「集合体1」「集合体2」が定義されているので、まず「集合体1」を読み込む。
【0046】
次に、プログラムソースコード自動生成部20は、この読み込んだ集合体について、定義された要素の有無を判別する(ステップB3)。なお、以下の図7に示すステップB3〜B6の処理は、図2に示すフローチャートのステップA1〜A4の処理と同様にして実行されるものとして詳細な説明は省略する。
【0047】
プログラムソースコード自動生成部20は、1つの集合体についてのプログラムソースコードファイル24を生成すると、前述と同様にして定義ファイル22を参照し、このファイル中に他に定義された集合体の有無を判別し(ステップB1)、集合体が定義されている場合にはその集合体を読み込み(ステップB2)。以下同様にして、この集合体に対するプログラムソースコードファイル24を生成する(ステップB3〜B5)。図8に示す例では、次に集合体2を読み込み、この集合体2についてのプログラムソースコードファイル24を生成する。
【0048】
以下、同様にして、集合体の数だけ前述した処理を繰り返して実行し、それぞれの集合体に対するプログラムソースコードファイル24を生成する。
【0049】
このようにして、プログラムソースコード自動生成部20は、例えば図8に示すデータ構造の定義ファイル22を参照することで、図9に示すような、データ構造の定義ファイル22に記述された集合体1,2をそれぞれシリアライズ及びストラクチャするためのプログラムソースコードからなるプログラムソースコードファイル24を自動生成することができる。すなわち、集合体1については要素A,Bのデータを扱うことができ、集合体2については要素A,B,Cのデータを扱うことができる、プログラムソースコードファイル24をそれぞれ生成することができる。
【0050】
次に、図8及び図9に対応する、データをシリアライズ及びストラクチャをするためのプログラムソースコードの具体例について説明する。
図10は、図8に示すデータ構造の定義ファイル22に該当する定義内容の具体例を示す図、図11は、図10に示すデータ構造の定義ファイル22の集合体1についての定義に応じてプログラムソースコード自動生成部20によって生成されるプログラムソースコードファイル24の具体例を示す図、図12は、図10に示すデータ構造の定義ファイル22の集合体2についての定義に応じて生成されるプログラムソースコードファイル24の具体例を示す図である。
【0051】
図10に示すように、データ構造の定義ファイル22には、集合体1についての定義(1)と集合体(2)についての定義(2)が記述されている。
集合体1の定義(1)には、要素Aについての定義(11)と要素Bについての定義(12)が含まれている。なお、要素A,Bの定義(11)(12)の定義の記述は、図5に示すプログラムソースコードファイル24の具体例と同一であるので詳細な説明を省略する。
【0052】
一方、集合体2の定義(2)には、要素Aについての定義(21)と要素Bについての定義(22)、及び要素Cについての定義(23)が含まれている。なお、要素A,Bの定義(21)(22)の定義の記述は、図5に示すプログラムソースコードファイル24の具体例と同一であるので詳細な説明を省略する。要素Cについての定義(23)には、「<className>Class1</className>」の記述にあるように、「Class1」に記述された定義、すなわち集合体1の定義(1)を引用することが定義されている。
【0053】
プログラムソースコード自動生成部20は、図10に示す定義ファイル22の記述に対して、集合体1に対しては図11に示すようなプログラムソースコードファイル24を生成し、集合体2については図12に示すようなプログラムソースコードファイル24を生成する。なお、図11に示すプログラムソースコードファイル24の例は、図6に示す具体例と同一であるので説明を省略する。図12に示すプログラムソースコードファイル24の例では、シリアライズのプログラムソースコード(1)には、要素Aのデータに対するソースコード(1A)と要素Bのデータに対するソースコード(1B)と要素Cのデータに対するソースコード(1C)が含まれている。ソースコード(1C)では、定義ファイル22における定義に従って、集合体1に関係するシリアライズのプログラムソースコード「count=count+elementC.Serialize(&stack[count])」が生成されている。
【0054】
また、ストラクチャのプログラムソースコード(2)には、シリアライズのソースコード(1C)に対応したソースコード(2C)「count=count+elementC.Structure(&stack[count])」が生成されている。
【0055】
図10に示すデータ構造の定義ファイル22は、2つの集合体が定義され、集合体2の要素Cのみが他の記述を引用している例を示しているが、膨大な数の集合体が定義され、引用関係が複雑に定義されていたとしても、プログラムソースコード自動生成部20がそれらの定義を参照して、正確に対応するプログラムソースコードを生成する。
【0056】
このようにして、プログラムソースコード自動生成部20によってデータ構造の定義ファイル22において定義された集合体、及び各集合体における要素の定義をもとに、シリアライズ及びストラクチャするためのプログラムソースコードファイル24を生成することができる。従って、データ構造の定義内容が、集合体及び要素の数が多かったり、さらに図10(23)に示すように、要素の定義が他の集合体の定義を引用するような複雑な定義がされていたりしても、誤り無くプログラムソースコードを生成することができる。プログラムソースコード自動生成部20を用いることで、人手によるソースコードを作成するプログラミング作業を排除することができるので、人為的修正誤りを無くし、作業に要していた手間を大幅に削減することが可能となる。
【0057】
なお、データ構造の定義ファイル22に記述された定義の内容が変更が必要な場合には、定義ファイル変更部16によって変更することができる。定義ファイル22による定義を変更してしまえば、前述したようにプログラムソースコード自動生成部20を実行させることで、変更されたデータ構造の定義ファイル22に応じたプログラムソースコードファイル24を簡単に自動生成することができる。
【0058】
また、データのシリアライズ及びストラクチャの手法を変更する必要がある場合、ソースコード生成処理部10に用意されている複数のプログラムソースコード自動生成部20a,20b…のうち、この変更後の手法に対応しているプログラムソースコード自動生成部20が実行されるように、変更部18によって変更する。これにより、データのシリアライズ及びストラクチャの手法を変更する場合であっても簡単に対応することができる。同様にして、プログラム言語を変更する場合であっても、変更後のプログラム言語に対応するプログラムソースコード自動生成部20が実行されるように変更することで対応することができる。
【0059】
なお、前述した説明では、データ構造の定義ファイル22をもとにプログラムソースコードファイル24を生成するものとして説明しているが、データ構造を定義するために作成された専用のファイルではなく、データ構造を表していれはば他のデータを参照して、プログラムソースコードファイル24を生成するように構成することもできる。
【0060】
また、上述した実施形態において記載した手法は、コンピュータに実行させることのできるプログラムとして、例えば磁気ディスク(フレキシブルディスク、ハードディスク等)、光ディスク(CD−ROM、DVD等)、半導体メモリなどの記録媒体に書き込んで各種装置に提供することができる。また、通信媒体により伝送して各種装置に提供することも可能である。本装置を実現するコンピュータは、記録媒体に記録されたプログラムを読み込み、または通信媒体を介してプログラムを受信し、このプログラムによって動作が制御されることにより、上述した処理を実行する。
【0061】
また、本願発明は、前述した実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。更に、前記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組み合わせにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件から幾つかの構成要件が削除されても効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。
【0062】
【発明の効果】
以上詳述したように本発明によれば、データを直列化及び非直列化する単位を示す集合体とこの集合体の中の直列化及び非直列化する要素が定義された情報を参照し、集合体に含まれる要素をもとに、データを直列化及び非直列化するためのプログラムソースコードを生成し、要素をもとに生成されたプログラムソースコードをまとめて、集合体に対する直列化及び非直列化するためのプログラムソースコードを生成することにより、データを直列化及び非直列化する機能を実現するためのプログラムソースコードの生成に要する労力を軽減することが可能となる。
【図面の簡単な説明】
【図1】本実施形態に係わるプログラムソースコード生成方法を実現するための機能構成を示すブロック図。
【図2】本実施形態におけるプログラムソースコード作成の動作について説明するためのフローチャート。
【図3】プログラムソースコードファイル24の生成のもとになるデータ構造の定義ファイル22に定義される情報の一例を示す図。
【図4】図3に示す定義ファイル22に対応する集合体1をシリアライズ及びストラクチャするためのプログラムソースコードからなるプログラムソースコードファイル24の一例を示す図。
【図5】図3に示すデータ構造の定義ファイル22に該当する定義内容の具体例を示す図。
【図6】図5に示すデータ構造の定義ファイル22の定義に応じて生成されるプログラムソースコードファイル24の具体例を示す図。
【図7】本実施形態における複雑なパターンのデータ構造が定義されたデータ構造の定義ファイル22を対象とした場合のプログラムソースコード作成の動作について説明するフローチャート。
【図8】本実施形態における複雑なパターンのデータ構造の定義ファイル22の一例を示す図。
【図9】図8に示すデータ構造の定義ファイル22に記述された集合体1,2をそれぞれシリアライズ及びストラクチャするためのプログラムソースコードからなるプログラムソースコードファイル24の具体例を示す図。
【図10】図8に示すデータ構造の定義ファイル22に該当する定義内容の具体例を示す図。
【図11】図10に示すデータ構造の定義ファイル22の集合体1についての定義に応じて生成されるプログラムソースコードファイル24の具体例を示す図。
【図12】図10に示すデータ構造の定義ファイル22の集合体2についての定義に応じて生成されるプログラムソースコードファイル24の具体例を示す図。
【符号の説明】
10…ソースコード生成処理部
12…定義ファイル記憶部
14…ソースコードファイル記憶部
16…定義ファイル変更部
18…変更部
20…プログラムソースコード自動生成部
22…データ構造の定義ファイル
24…プログラムソースコードファイル
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a program source code generation method for generating a program source code, and a program source code generation program.
[0002]
[Prior art]
Generally, in an information processing apparatus such as a computer, when data managed on a predetermined data structure and recorded on a recording medium is transmitted through a communication path and recorded on another recording medium, the information processing apparatus has a predetermined data structure. A process is performed in which data is serialized (serialized) and then transmitted through a communication path, and the serialized data is deserialized (structured) and structured to have an original data structure.
[0003]
For example, in a personal computer, when data to be processed is written back to a hard disk device, the data is serialized according to a data structure (for example, a hierarchical structure) managed by the program, and the serialized data is structured. Structuring by
[0004]
Conventionally, when creating a program for serializing and structuring data having such a predetermined data structure, a programmer creates a program source code while referring to a specification or the like in which the definition of the data structure is described. In the definition of the data structure, for example, the definition of an aggregate corresponding to each of the program source code files to be created and information on data (size and data type (character string, numeric value, etc.)) in the aggregate are defined. .
[0005]
In accordance with the definition of the data structure, the programmer writes a program source code for serializing and structuring data by a predetermined method using a target programming language.
[0006]
Japanese Patent Application Laid-Open No. 5-216683 describes a non-language-dependent filing procedure automatic generation method for automatically generating a filing procedure without depending on a program description language. This generation method creates a target file of a target machine from a source program, and refers to configuration definition data that defines files related to the target file defined in the database, and automates the file creation procedure. Means for generating.
[0007]
[Problems to be solved by the invention]
As described above, conventionally, when generating a program source code for realizing a function of serializing and structuring data, a programmer refers to a defined data with reference to a specification or the like in which a definition of a data structure is described. It is necessary to input a program source code corresponding to a structure, that is, a description that defines an aggregate and elements in each aggregate.
[0008]
For this reason, if the number of aggregates and elements is large in the definition of the data structure, or the data structure is a multi-level hierarchical structure or the definition of elements is complicated such that the definition of another aggregate is cited. By the time, programmers had to enter the program source code with great effort.
[0009]
Further, when the definition of the data structure is partially changed, it is necessary to regenerate the program source code or to extract and change the source code that needs to be changed. Further, even when the method of serialization and structuring is changed, or the target programming language is changed, the program source code may need to be regenerated, which requires a great deal of labor.
[0010]
Further, the method for automatically generating a filing procedure disclosed in Japanese Patent Application Laid-Open No. 5-216683 enables human error prevention and time reduction by automating the filing procedure creation. It created the target file for the machine, not the program source code.
[0011]
SUMMARY OF THE INVENTION The present invention has been made in view of the above circumstances, and has a program source code capable of reducing an effort required to generate a program source code for realizing a function of serializing and deserializing data. It is an object to provide a generation method and a program source code generation program.
[0012]
[Means for Solving the Problems]
The present invention is a program source code generation method for generating a program source code for realizing a function of serializing and deserializing data. Referring to the information in which the elements to be serialized and deserialized in the aggregate are defined, a program source code for serializing and deserializing data based on the elements included in the aggregate is referred to. And generating a program source code for serializing and deserializing the set with respect to the aggregate by combining the generated program source codes based on the elements.
[0013]
When a plurality of aggregates are defined in the information, a program source code is generated for each aggregate.
[0014]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a functional configuration for realizing the program source code generation method according to the present embodiment. The program source code generation method according to the present embodiment is realized by executing a program source code generation program on a computer. The computer may be, for example, reads a semiconductor memory, CD-ROM, DVD, program source code generation program recorded in a recording medium such as a magnetic disk, the operation by the program is controlled.
[0015]
As shown in FIG. 1, the program source code generation method includes functions of a source code generation processing unit 10, a definition file storage unit 12, a source code file storage unit 14, a definition file change unit 16, and a change unit 18.
[0016]
The source code generation processing unit 10 executes a process of generating a program source code based on information defining a data structure, and has a function of a program source code automatic generation unit 20 (20a, 20b,...). The program source code automatic generation unit 20 implements a function of referring to the definition file 22 of the data structure stored in the definition file storage unit 12 and serializing and structuring data according to the data structure defined in the definition file 22. Generate program source code for
[0017]
Note that the source code generating unit 10, a plurality of program source code automatic generation unit 20a, a 20b ... provided. Each of the program source code automatic generation units 20a, 20b,... Is provided with a function of generating a program source code according to a difference in a programming language of a program source code to be generated or a difference in a method of serialization and structure. Is selected and executed.
[0018]
The definition file storage unit 12 stores a definition file 22 of a data structure based on a program source code generated by the source code generation processing unit 10 (program source code automatic generation unit 20). The data structure definition file 22 includes an aggregate indicating units for serializing (serializing) and structure (deserializing) data and information defining elements to be serialized and structured in the aggregate. .
[0019]
Source code file storage unit 14 stores a program source code file 24 generated by the source code generation process unit 10 (program source code automatic generation unit 20).
[0020]
The definition file changing unit 16 changes the definition file 22 of the data structure stored in the definition file storage unit 12, and when the program source code for a different data structure is regenerated, the data in the definition file is changed. Change the structure definition.
[0021]
The changing unit 18 generates the program source code according to the difference in the programming language of the program source code or the method of serialization and structure, based on the definition file 22 of the data structure as necessary. changing the program source code automatic generation unit 20 for generating a code file 24, i.e. a plurality of program source code automatic generation unit 20a, 20b ... or selected and to execute the. .. Are provided in the source code generation processing unit 10 and a plurality of program source code automatic generation units 20a, 20b... Are not selected and used. The generator 20 may be changed or replaced with another program source code automatic generator 20.
[0022]
Next, an operation of creating a program source code in the present embodiment will be described with reference to a flowchart shown in FIG.
[0023]
FIG. 3 shows an example of information defined in the definition file 22 of the data structure from which the program source code file 24 is generated. The data structure definition file 22 includes an aggregate indicating units for serializing and structuring data, and information defining elements to be serialized and structured in the aggregate. In the example shown in FIG. 3, one aggregate “aggregate 1” is defined, and two elements “element A” and “element B” are defined in the “aggregate 1”. In the element, for example, information on data size and data type (character string, numerical value, etc.) is defined.
[0024]
First, the program source code automatic generation unit 20 refers to the definition file 22 of the data structure, and determines the presence or absence of the defined element in the aggregate defined in this file (step A1). If an element is defined in the aggregate, the element is read (step A2). In the example shown in FIG. 3, the "element A" to "assembly 1""PartB" is defined, first reads the definition of "element A".
[0025]
The program source code automatic generation unit 20 generates a program source code for serializing and structuring data by a predetermined method based on element information (that is, data size and data type) (step A3).
[0026]
For example, in a program source code for serializing data, a procedure for sequentially storing data defined in each element on the stack while sequentially updating the position of the stack is described. Also, the program source code that structures the data reads the data stored in the stack while sequentially updating the position of the stack so as to reverse the serialization procedure, and constructs the data defined by each element. The procedure is described (note that specific examples are shown in FIGS. 5 and 6).
[0027]
Next, the program source code automatic generation unit 20 refers to the definition file 22 in the same manner as described above, determines the presence or absence of the defined element in the aggregate defined in this file (step A1), If an element is defined in the body, the element is read (step A2). In the example shown in FIG. 3, next, the definition of “element B” is read.
[0028]
The program source code automatic generation unit 20, based on the information elements, the program source code to produce for serializing and structuring the data by a predetermined method (step A3).
[0029]
Hereinafter, similarly, the above-described processing is repeatedly executed by the number of elements defined in the aggregate, and a program source code for serializing and structuring data of each element is generated (steps A1 to A3).
[0030]
In this way, when the program source code for serializing and structuring the data of each element included in the aggregate defined in the data structure definition file 22 is generated, the program source code for serializing and structuring the aggregate collectively is generated. A code is generated and stored in the source code file storage unit 14 as a program source code file 24 (step A4).
[0031]
In this way, the program source code automatic generation unit 20 refers to, for example, the definition file 22 having the data structure shown in FIG. 3, and as shown in FIG. 4, the elements A and B described in the definition file 22. data can handle, it is possible to program source code file 24 of program source code to serialize and structuring the assembly 1 automatically generates.
[0032]
Next, a specific example of a program source code for serializing and structuring data will be described.
FIG. 5 is a diagram showing a specific example of definition contents corresponding to the definition file 22 of the data structure shown in FIG. 3, and FIG. 6 is a program source code automatically generated according to the definition of the definition file 22 of the data structure shown in FIG. FIG. 3 is a diagram showing a specific example of a program source code file 24 generated by a unit 20.
[0033]
As shown in FIG. 5, in the definition file 22 of the data structure, “element A” has data of “long” size (for example, 4 bytes) as described in “<type> long </ type>”. It is defined that “element B” is character string data as described in “<type> String </ type>”.
[0034]
Program source code automatic generation unit 20, to the description of the definition file 22 shown in FIG. 5, to generate a program source code file 24 as shown in FIG. The program source code file 24 shown in FIG. 6 includes the serialized program source code shown in (1) and the structure program source code shown in (2).
[0035]
The serialization of program source code (1), includes a source code (1B) is for the data of the source code (1A) and the element B with respect to the data elements A.
[0036]
In the source code (1A), the data of the element A is stored in the stack position indicated by “stack [count]” while securing the data size for the data of the element A (description of the line “memcpy ...”). includes a source code indicating that the location to store the next data stack data content update element a (described in the line of "count = ...").
[0037]
In the source code (1B), the length of the data (character string) of the element B is defined (description of the line of “size = ...”), and the length is defined at the stack position indicated by “stack [count]”. Data indicating the length of the data of the element B (“size”) is secured and stored for this data (description of the line “memcpy (& stack ... sizeof (size)”)), and the data is stored after the stack Includes a source code indicating that the position to be updated is updated by the data indicating the length of the data of the element B (description of the line of "count = ..."), that is, before the data of the element B is stored in the stack. A source code for storing data indicating the length of the data (character string) of the element B. Next, the source code is stored at the stack position indicated by “stack [count]”. The data of B is stored while securing the data size for the data of the element B (description of the line of “memcpy (& stack ... size)”), and the position where the data is stored next to the stack is updated by the data of the element B. (Description of the line of “count =...”) Is included.
[0038]
On the other hand, the structure of the program source code (2) includes a source code (2B) is for the data of the source code (2A) and the element B with respect to the data elements A.
[0039]
In the source code (2A), data is read from the stack as element A data in a procedure reverse to the description of the program source code (1A) for serializing element A, and similarly, the source code (2B) , A program source code that reads data from the stack and sets it as element B data in a procedure reverse to the description of the serialization program source code (1B) for element B. The data elements B, reads data indicating the length of data of the previous element B (string), and reads out the length of the data in accordance with this data.
[0040]
By preparing the definition file 22 having the data structure as shown in FIG. 5 in this manner, the data as shown in FIG. 6 can be serialized and structured according to the contents defined in the definition file 22. Program source code file can be automatically generated.
[0041]
The description of the elements in the definition file 22 shown in FIG. 5 is merely an example, and can be described in various formats. The program source code automatic generation unit 20 is provided with a function of generating a program source code for serialization and structuring according to the definitions based on these various descriptions.
[0042]
Next, a case where a data structure including a plurality of aggregates is defined in the definition file 22 will be described.
In the above description, the aggregate is directed to the data structure of one simple pattern. However, the program source code automatic generation unit 20 in the present embodiment has a plurality of aggregates, and the definition of the elements in the aggregate is It is also possible to target a complicated pattern data structure that cites the definition of another aggregate.
[0043]
FIG. 7 is a flowchart illustrating an operation of creating a program source code when the definition file 22 having a data structure in which a complicated pattern data structure is defined according to the present embodiment is targeted.
[0044]
FIG. 8 shows an example of a definition file 22 having a complicated pattern data structure in which there are a plurality of aggregates, and the definitions of the elements in the aggregates refer to the definitions of other aggregates. The data structure definition file 22 includes information defining a plurality of aggregates 1 and 2 and elements to be serialized and structured in the aggregates 1 and 2. In the example shown in FIG. 8, two elements “element A” and “element B” are defined in “aggregation 1”, and three elements “element A”, “element B” and “element C” are defined in “aggregation 2”. Is defined. Incidentally, elements C of the assembly 2 (shown in FIG. 10 (23) for example) is assumed to be a definition of reference in its entirety assembly 1.
[0045]
First, the program source code automatic generation unit 20 refers to the definition file 22 of the data structure, and determines the presence or absence of an aggregate defined in this file (step B1). Here, if an aggregate is defined, the aggregate is read (step B2). In the example shown in FIG. 8, the two "assemblies 1", "assembly 2" is defined, first I read the "assembly 1".
[0046]
Then, the program source code automatic generation unit 20, this read assembly, to determine the presence or absence of elements defined (step B3). Note that the following processes of steps B3 to B6 shown in FIG. 7 are executed in the same manner as the processes of steps A1 to A4 of the flowchart shown in FIG.
[0047]
When the program source code automatic generation unit 20 generates the program source code file 24 for one aggregate, the program source code automatic generation unit 20 refers to the definition file 22 in the same manner as described above, and determines whether there is another aggregate defined in this file. It is determined (step B1), and if an aggregate is defined, the aggregate is read (step B2). Similarly, a program source code file 24 for this aggregate is generated (steps B3 to B5). In the example shown in FIG. 8, then load the assembly 2, to generate a program source code file 24 for this assembly 2.
[0048]
In the same manner, and repeatedly executes the processes described above the number of the aggregate to produce the program source code file 24 for each aggregate.
[0049]
In this way, the program source code automatic generation unit 20 refers to, for example, the data structure definition file 22 shown in FIG. 8 and obtains the aggregate described in the data structure definition file 22 as shown in FIG. 1,2 it is possible to automatically generate a program source code file 24 made from program source code to serialize and structure respectively. That is, a program source code file 24 that can handle the data of elements A and B for the aggregate 1 and can handle the data of the elements A, B and C for the aggregate 2 can be generated. .
[0050]
Next, a specific example of a program source code for serializing and structuring data, which corresponds to FIGS. 8 and 9, will be described.
FIG. 10 is a diagram showing a specific example of definition contents corresponding to the definition file 22 of the data structure shown in FIG. 8, and FIG. 11 is a diagram showing the definition of the aggregate 1 of the definition file 22 of the data structure shown in FIG. FIG. 12 shows a specific example of a program source code file 24 generated by the program source code automatic generation unit 20. FIG. 12 is generated according to the definition of the aggregate 2 of the definition file 22 having the data structure shown in FIG. FIG. 3 is a diagram showing a specific example of a program source code file 24.
[0051]
As shown in FIG. 10, the definition file 22 of the data structure describes the definition (1) of the aggregate 1 and the definition (2) of the aggregate (2).
The definition (1) of the aggregate 1 includes a definition (11) for the element A and a definition (12) for the element B. The description of the definitions (11) and (12) of the elements A and B is the same as the specific example of the program source code file 24 shown in FIG.
[0052]
On the other hand, the definition (2) of the aggregate 2 includes a definition (21) for the element A, a definition (22) for the element B, and a definition (23) for the element C. The description of the definitions (21) and (22) of the elements A and B is the same as the specific example of the program source code file 24 shown in FIG. For the definition (23) of the element C, as described in “<className> Class1 </ className>”, refer to the definition described in “Class1”, that is, the definition (1) of the aggregate 1 Is defined.
[0053]
The program source code automatic generation unit 20 generates a program source code file 24 as shown in FIG. 11 for the aggregate 1 with respect to the description of the definition file 22 shown in FIG. A program source code file 24 as shown in FIG. The example of the program source code file 24 shown in FIG. 11 will be omitted since it is identical to the embodiment shown in FIG. In the example of the program source code file 24 shown in FIG. 12, the serialized program source code (1) includes the source code (1A) for the data of the element A, the source code (1B) for the data of the element B, and the data of the element C. Is included in the source code (1C). In the source code (1C), a serialized program source code “count = count + elementC.Serialize (& stack [count])” is generated according to the definition in the definition file 22.
[0054]
In the structure program source code (2), a source code (2C) “count = count + elementC.Structure (& stack [count])” corresponding to the serialization source code (1C) is generated.
[0055]
The definition file 22 of the data structure shown in FIG. 10 shows an example in which two aggregates are defined and only the element C of the aggregate 2 refers to another description. Even if it is defined and the citation relation is complicatedly defined, the program source code automatic generation unit 20 refers to those definitions and generates an exactly corresponding program source code.
[0056]
In this manner, the program source code file 24 for serializing and structuring based on the aggregates defined in the data structure definition file 22 by the program source code automatic generation unit 20 and the element definitions in each aggregate. Can be generated. Therefore, the definition content of the data structure is a complex definition such that the number of aggregates and elements is large, and further, as shown in FIG. 10 (23), the definition of the element refers to the definition of another aggregate. Even if it is, the program source code can be generated without error. By using the program source code automatic generation unit 20, it is possible to eliminate programming work for manually creating source code, thereby eliminating human correction errors and greatly reducing the work required for the work. It becomes possible.
[0057]
Note that when the content of the definition described in the definition file 22 of the data structure need to be changed can be changed by the definition file changing section 16. Once the definition in the definition file 22 has been changed, the program source code automatic generation unit 20 is executed as described above, so that the program source code file 24 corresponding to the changed definition file 22 of the data structure can be easily automatically generated. Can be generated.
[0058]
When it is necessary to change the method of data serialization and structure, among the plurality of program source code automatic generation units 20a, 20b,... The change unit 18 changes the program source code automatic generation unit 20 that executes the program. This makes it possible to easily cope with a case where the data serialization and the structure method are changed. Similarly, even when the program language is changed, it can be dealt with by changing the program source code automatic generation unit 20 corresponding to the changed program language to be executed.
[0059]
In the above description, the program source code file 24 is generated based on the data structure definition file 22. However, it is not a dedicated file created for defining the data structure, but a data file. if the long represents the structure with reference to the other data it can also be configured to generate a program source code file 24.
[0060]
In addition, the method described in the above-described embodiment can be executed on a recording medium such as a magnetic disk (such as a flexible disk or a hard disk), an optical disk (such as a CD-ROM or a DVD), or a semiconductor memory as a program that can be executed by a computer. It can be written and provided to various devices. Further, it is also possible to transmit the data via a communication medium and provide the data to various devices. A computer that realizes the present apparatus reads the program recorded on the recording medium or receives the program via the communication medium, and executes the above-described processing by controlling the operation of the program.
[0061]
Further, the present invention is not limited to the above-described embodiment, and can be variously modified in an implementation stage without departing from the gist of the invention. Furthermore, the embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, in a case where an effect can be obtained even if some components are deleted from all the components shown in the embodiment, a configuration in which the components are deleted can be extracted as an invention.
[0062]
【The invention's effect】
As described in detail above, according to the present invention, referring to information defining an aggregate indicating a unit for serializing and deserializing data and elements for serializing and deserializing in the aggregate, Based on the elements included in the aggregate, generate a program source code for serializing and deserializing data, collect the program source code generated based on the elements, serialize By generating the program source code for deserialization, it is possible to reduce the labor required for generating the program source code for realizing the functions of serializing and deserializing data.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a functional configuration for realizing a program source code generation method according to an embodiment.
FIG. 2 is a flowchart for explaining an operation of creating a program source code in the embodiment.
FIG. 3 is a diagram showing an example of information defined in a definition file 22 of a data structure from which a program source code file 24 is generated.
FIG. 4 is a view showing an example of a program source code file 24 including program source codes for serializing and structuring the aggregate 1 corresponding to the definition file 22 shown in FIG. 3;
5 is a view showing a specific example of definition contents corresponding to a definition file 22 having the data structure shown in FIG. 3;
6 is a view showing a specific example of a program source code file 24 generated according to the definition of the definition file 22 having the data structure shown in FIG. 5;
FIG. 7 is a flowchart for explaining an operation of creating a program source code in a case where a definition file 22 having a data structure in which a complicated pattern data structure is defined according to the embodiment is targeted.
FIG. 8 is a view showing an example of a definition file 22 of a data structure of a complicated pattern according to the embodiment.
9 is a diagram showing a specific example of a program source code file 24 including program source codes for serializing and structuring the aggregates 1 and 2 described in the definition file 22 having the data structure shown in FIG.
10 is a diagram showing a specific example of definition contents corresponding to the definition file 22 having the data structure shown in FIG. 8;
11 is a diagram showing a specific example of a program source code file 24 generated according to the definition of the aggregate 1 of the definition file 22 having the data structure shown in FIG.
12 is a view showing a specific example of a program source code file 24 generated according to the definition of the aggregate 2 of the definition file 22 having the data structure shown in FIG.
[Explanation of symbols]
10 Source code generation processing unit
12. Definition file storage unit
14. Source code file storage
16 ... Definition file change unit
18 ... Change section
20: Program source code automatic generation unit
22: Data structure definition file
24 ... Program source code file

Claims (5)

データを直列化及び非直列化する機能を実現するためのプログラムソースコードを生成するプログラムソースコード生成方法であって、
データを直列化及び非直列化する単位を示す集合体とこの集合体の中の直列化及び非直列化する要素が定義された情報を参照し、
前記集合体に含まれる前記要素をもとに、データを直列化及び非直列化するためのプログラムソースコードを生成し、
前記要素をもとに生成されたプログラムソースコードをまとめて、前記集合体に対する直列化及び非直列化するためのプログラムソースコードを生成することを特徴とするプログラムソースコード生成方法。
A program source code generation method for generating a program source code for realizing a function of serializing and deserializing data,
Refer to the aggregate that indicates the unit to serialize and deserialize the data and the information that defines the elements to serialize and deserialize in this aggregate,
Based on the elements included in the aggregate, generate a program source code for serializing and deserializing data,
A program source code generation method, comprising: combining program source codes generated based on the elements to generate a program source code for serializing and deserializing the aggregate.
前記情報に複数の集合体が定義されている場合に、それぞれの集合体についてプログラムソースコードを生成することを特徴とする請求項1記載のプログラムソースコード生成方法。2. The method according to claim 1, wherein when a plurality of aggregates are defined in the information, a program source code is generated for each aggregate. データを直列化及び非直列化する手法に応じて、生成するプログラムソースコードを変更することを特徴とする請求項1記載のプログラムソースコード生成方法。2. The program source code generation method according to claim 1, wherein a generated program source code is changed according to a method of serializing and deserializing data. プログラムソースコードのプログラミング言語に応じて、生成するプログラムソースコードを変更することを特徴とする請求項1記載のプログラムソースコード生成方法。2. The method according to claim 1, wherein the generated program source code is changed according to the programming language of the program source code. データを直列化及び非直列化する機能を実現するためのプログラムソースコードを生成するプログラムソースコード生成プログラムであって、
コンピュータを、
データを直列化及び非直列化する単位を示す集合体とこの集合体の中の直列化及び非直列化する要素が定義された情報を参照させ、
前記集合体に含まれる前記要素をもとに、データを直列化及び非直列化するためのプログラムソースコードを生成させ、
前記要素をもとに生成されたプログラムソースコードをまとめて、前記集合体に対する直列化及び非直列化するためのプログラムソースコードを生成させるためのプログラムソースコード生成プログラム。
A program source code generation program for generating a program source code for realizing a function of serializing and deserializing data,
Computer
Refer to the aggregate that indicates the unit for serializing and deserializing data and the information that defines the elements to serialize and deserialize in this aggregate,
Based on the elements included in the aggregate, to generate a program source code for serializing and deserializing data,
A program source code generation program for collecting program source codes generated based on the elements to generate a program source code for serializing and deserializing the aggregate.
JP2002191199A 2002-06-28 2002-06-28 Computer, program source code generation method Expired - Fee Related JP4223745B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002191199A JP4223745B2 (en) 2002-06-28 2002-06-28 Computer, program source code generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002191199A JP4223745B2 (en) 2002-06-28 2002-06-28 Computer, program source code generation method

Publications (2)

Publication Number Publication Date
JP2004038319A true JP2004038319A (en) 2004-02-05
JP4223745B2 JP4223745B2 (en) 2009-02-12

Family

ID=31700890

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002191199A Expired - Fee Related JP4223745B2 (en) 2002-06-28 2002-06-28 Computer, program source code generation method

Country Status (1)

Country Link
JP (1) JP4223745B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101165498B1 (en) 2006-06-22 2012-07-13 미쓰비시 세이시 가부시키가이샤 Method for producing conductive material

Also Published As

Publication number Publication date
JP4223745B2 (en) 2009-02-12

Similar Documents

Publication Publication Date Title
AU2011323773A1 (en) Managing data set objects in a dataflow graph that represents a computer program
US10289395B2 (en) Performing a compiler optimization pass as a transaction
JP2005018774A (en) Undo infrastructure
US7290252B2 (en) Method and apparatus for building executable computer programs using compiled program libraries
US8397055B2 (en) Method and system for post-build modification of firmware binaries to support different hardware configurations
JPH09259153A (en) Device and method for generating batch execution control program
JP3802058B2 (en) System, method and compiler preprocessor for conditionally compiling software compilation units
JPH0863342A (en) Program management method and device therefor
US6438514B1 (en) Generation of a system model
CN104881311A (en) Method and apparatus for judging version compatibility
US9454382B2 (en) Verification of UML state machines
JP3562435B2 (en) Automatic component generator
JP2004038319A (en) Program source code generation method and program
US7716653B2 (en) Configurable importers and resource writers for converting data into another format
JP5276094B2 (en) Method for effectively searching for transaction code blocks in a transactional memory system
JP4223746B2 (en) Computer, program source code generation method
JP2009176178A (en) Global variable definition system of plc
CN111340175A (en) Processing method and device for graph rewriting, computing equipment and readable medium
JP2022023631A (en) Assembly instruction conversion program, assembly instruction conversion method, and information processing apparatus
JP2016151973A (en) Management control system, development support device therefor, and management device
JP2018147388A (en) Stub generator, method, and program
JP5539170B2 (en) RIA application execution method and RIA component multiple version support method
JP2006139472A (en) Model drive development device
JPH06168011A (en) Program generating device
JPH0496178A (en) Change method for cad operation characteristic

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040901

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080109

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080115

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080317

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080507

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080707

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080805

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081006

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20081014

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: 20081118

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081120

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111128

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121128

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131128

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees