JP2008226010A - Compile method and compile device - Google Patents
Compile method and compile device Download PDFInfo
- Publication number
- JP2008226010A JP2008226010A JP2007065330A JP2007065330A JP2008226010A JP 2008226010 A JP2008226010 A JP 2008226010A JP 2007065330 A JP2007065330 A JP 2007065330A JP 2007065330 A JP2007065330 A JP 2007065330A JP 2008226010 A JP2008226010 A JP 2008226010A
- Authority
- JP
- Japan
- Prior art keywords
- source program
- character code
- profile information
- profile
- program corresponding
- 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
Links
Images
Landscapes
- Stored Programmes (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
本発明は、コンパイル方法及びコンパイル装置に係り、特に、特に、マルチバイト文字を固定長で表す文字コード(以下、固定長文字コード)のデータによるソースプログラムを、マルチバイト文字を可変長で表す文字コード(以下、可変長文字コード)のデータによるソースプログラムに変換するコンパイル方法及びコンパイル装置に関する。 The present invention relates to a compiling method and a compiling device, and in particular, a source program based on data of a character code (hereinafter referred to as a fixed-length character code) that represents a multibyte character in a fixed length, and a character that represents a multibyte character in a variable length. The present invention relates to a compiling method and a compiling apparatus for converting into a source program based on data of a code (hereinafter, variable length character code).
近年、官公庁、民間企業の情報システムは、文字コードとして、国際標準になりつつあるUnicodeを採用する例が増加している。従来、日本国内の情報システムは、文字コードとしてシフトJIS(マルチバイト文字を固定長文字コードで表す)を採用することが多かった。そのため、国内の情報システムにおけるシフトJISに対応したプラットフォームからUnicodeを採用したプラットフォームに移行させること事例が増加している。 In recent years, information systems for public offices and private companies are increasingly using Unicode, which is becoming an international standard, as a character code. Conventionally, information systems in Japan often employ Shift JIS (representing multibyte characters as fixed-length character codes) as character codes. For this reason, there are an increasing number of cases in which a platform that supports shift JIS in domestic information systems is shifted to a platform that employs Unicode.
Unicodeの代表的なエンコーディングに、UTF−8と呼ばれるものがあるが、UTF−8のマルチバイト文字は、2バイト固定長のシフトJISと異なり、2バイトから6バイトの可変長で表現される。例えば、COBOL等で書かれたマルチバイト文字を多用する業務プログラムは、従来のシフトJIS対応からUTF−8対応に移行する場合、ソースプログラムに多量の修正(変換)を必要とする。このソースプログラムの修正方法、修正量は、業務プログラムが実行に使うデータ群に依存する。 A typical Unicode encoding is called UTF-8, but a UTF-8 multi-byte character is represented by a variable length of 2 to 6 bytes, unlike a 2-byte fixed-length shift JIS. For example, a business program that frequently uses multibyte characters written in COBOL or the like requires a large amount of correction (conversion) in the source program when shifting from conventional shift JIS support to UTF-8 support. The correction method and the correction amount of the source program depend on the data group used for execution by the business program.
ソースプログラムを効率よく編集、修正する方法として、コンパイラ要素技術を利用することがあるが、多くの場合、構文解析をベースとした方法が利用されている。この種の方法に関する従来技術として、例えば、特許文献1等に記載された技術が知られている。この従来技術は、ソフトウェアベンダーが規定しているコーディング規則等の規約情報に基づいて、ソースプログラムに対して構文解析を実施し、その解析結果をもとにソースプログラムを修正するというものである。
前述した従来技術は、実行に使用するデータ群により、修正方法、修正量が変わる場合には、対応することができないという問題点を有している。そして、文字コードが異なるプラットフォーム間の移行では、実行するデータ群によっては、ほとんど修正がいらないケースもあるため、ソースプログラムを効率的に修正するためには、実行データの性質を有効に利用する必要がある。 The above-described conventional technique has a problem that it cannot cope with the case where the correction method and the correction amount change depending on the data group used for execution. And when migrating between platforms with different character codes, there are cases where almost no modification is required depending on the data group to be executed. Therefore, in order to modify the source program efficiently, it is necessary to effectively use the nature of the execution data. There is.
本発明の目的は、前述したような点に鑑み、シフトJISからUTF−8というような文字コードが異なるプラットフォーム間の移行において、ソースプログラムを効率的に修正(変換)することができるコンパイル方法及びコンパイル装置を提供することにある。 SUMMARY OF THE INVENTION In view of the above-described points, an object of the present invention is to provide a compiling method capable of efficiently correcting (converting) a source program in transition between platforms having different character codes such as Shift JIS to UTF-8. To provide a compiling device.
本発明によれば前記目的は、第1の文字コードに対応したソースプログラムを第2の文字コードに対応したソースプログラムに変換する情報処理装置におけるコンパイル方法において、前記情報処理装置内に、プロファイル情報出力手段と、プロファイル更新処理埋込手段と、コンパイル実行手段とを構成し、前記プロファイル情報出力手段は、前記第1の文字コードに対応したソースプログラムのプロファイル情報を解析して第1のプロファイル情報を生成して出力し、前記プロファイル更新処理埋込手段は、ロードモジュールの実行時に必要なプロファイル更新処理を、前記第1の文字コードに対応したソースプログラムからロードモジュールを生成する過程で埋め込み、前記コンパイル実行手段は、前記ロードモジュールを実行し、該ロードモジュールの実行時に実行されるプロファイル更新処理は、前記第1のプロファイル情報を更新して第2のプロファイル情報を生成して出力することにより、さらに、前記情報処理装置内に、ソースプログラム変換手段をさらに備えし、該ソースプログラム変換手段は、前記第2のプロファイル情報に基づいて、前記第1の文字コードに対応したソースプログラムを前記第2の文字コードに対応したソースプログラムに変換することにより達成される。 According to the present invention, the object is to provide a compile method in an information processing apparatus for converting a source program corresponding to a first character code into a source program corresponding to a second character code. An output unit, a profile update processing embedding unit, and a compile execution unit are configured. The profile information output unit analyzes the profile information of the source program corresponding to the first character code, and generates first profile information. The profile update processing embedding means embeds the profile update processing required when executing the load module in the process of generating the load module from the source program corresponding to the first character code, Compile execution means executes the load module, and The profile update process executed at the time of execution of the load module generates a second profile information by updating the first profile information, and further outputs a source program conversion means in the information processing apparatus. The source program converting means is further provided by converting a source program corresponding to the first character code into a source program corresponding to the second character code based on the second profile information. Is done.
本発明によれば、文字コードが異なる新しいプラットフォームへの移行に際して、文字コードが異なることに起因する実行データの性質の差異を気にすることなく、ターゲットとする実行データ群に対応して、文字コードの異なるソースプログラム間でのプログラムの変更を行うことができる。 According to the present invention, when migrating to a new platform having a different character code, the character corresponding to the target execution data group can be handled without worrying about the difference in the nature of the execution data caused by the different character code. Program changes can be made between source programs with different codes.
以下、本発明によるコンパイル方法及びコンパイル装置の実施形態を図面により詳細に説明する。 Embodiments of a compiling method and compiling apparatus according to the present invention will be described below in detail with reference to the drawings.
図1は本発明の一実施形態によるコンパイル装置の機能構成を示すブロック図である。ここで説明する本発明の実施形態は、固定長文字コード(図面では、文字コードA)によるプログラムで書かれたソースプログラム101を、可変長文字コード(図面では、文字コードB)によるソースプログラムに変換するものとしている。また、ここでは、COBOL言語を用いたソースプログラムを例とする。なお、本発明の実施形態でのコンパイルプログラムは、文字コードA向けソースプログラム101だけを取り扱うことが可能なものであるとする。
FIG. 1 is a block diagram showing a functional configuration of a compiling device according to an embodiment of the present invention. In the embodiment of the present invention described here, a
本発明の実施形態によるコンパイル装置は、図1に示すように、コンパイル装置としての機能を実現するためのコンパイルプログラム102により構成される。このコンパイルプログラム102は、コンパイラ(コンパイル部)103と、コンパイラ(実行部)110と、ソースプログラム変換部113と、文字列長変換テーブル(MTBL)108とを有して構成されている。コンパイラ(コンパイル部)103は、プロファイル情報出力部104とプロファイル更新処理埋込部105とを有している。
As shown in FIG. 1, a compiling device according to an embodiment of the present invention is configured by a compiling
そして、コンパイルプログラム102は、全体として、文字コードA向けソースプログラム101、文字コードA向け実行データ109及びカスタマイズ情報111を入力とし、プロファイル情報テーブルB112と文字コードB向けソースプログラム114とを出力する処理を実行する。
Then, the
コンパイラ(コンパイル部)103は、文字コードA向けソースプログラム101と文字列長変換テーブル108とを入力とし、プロファイル情報テーブルA106とロードモジュール107とを出力する。詳細には、プロファイル情報出力部104は、文字コードA向けソースプログラム101を入力とし、プロファイル情報テーブルA106を出力する。また、プロファイル更新処理埋込部105は、コンパイラ(コンパイル部)103が、文字コードA向けソースプログラム101からロードモジュール107を生成する際に、プロファイル解析可能な処理を文字コードA向けソースプログラム101に埋め込んで、ロードモジュール107を生成する。本発明の本実施形態では、ソースプログラム中の手続き処理で更新されている変数(以下、「更新変数」と呼ぶ)またはファイル読み込みを含む処理の直後に、「更新変数」またはファイル変数に対応したプロファイル解析処理(図6により後述する処理)を埋め込むこととしている。すなわち、ファイル読み込みを含む処理(図7の例では18行目の処理)の場合、埋め込まれるファイル変数全てに対応したプロファイル解析処理を埋め込む。
The compiler (compiler) 103 receives the character code A
図9はコンパイルプログラム102が文字コードA向けソースプログラム101をコンパイルした直後に生成したプロファイル情報テーブルA106の構成例を示す図である。このプロファイル情報テーブルA106は、文字コードA向けソースプログラム101を文字コードB向けソースプログラム114に変換するのに必要な情報を持つ。図9には、入力項目の一例を示しており、各項目はいずれも、文字コードA向けソースプログラム101に現れるものとする。
FIG. 9 is a diagram showing a configuration example of the profile information table A106 generated immediately after the
図9に示すプロファイル情報テーブル106は、項番、変数名、行番号、属性、定義長、更新レベル、最大長、ファイル名、レコード名の各項目からなる複数のレコードを有して構成される。このテーブルにおいて、「項番」は、テーブル106に格納されるレコードに順に付与された番号であり、「変数名」は、文字コードA向けソースプログラム101から抽出された変数名、「行番号」は、その変数が存在する文字コードA向けソースプログラム101の行番号である。
The profile information table 106 shown in FIG. 9 includes a plurality of records including items of item number, variable name, line number, attribute, definition length, update level, maximum length, file name, and record name. . In this table, “item number” is a number assigned to the records stored in the table 106 in order, and “variable name” is a variable name extracted from the
また、図9の項目のうち、「属性」は、変数の属性を示す。図9に示す例では、「X」は、英数字項目、図示していないが「N」は日本語項目を示す。「定義長」は、変数が定義されている長さ(単位はバイト)を示す。「更新レベル」は、コンパイラ(コンパイル部)103とコンパイラ(実行部)110とのどちらで当該変数の修正内容を決めるかを判別するフラグである。図示例では、「0」のときは、コンパイラ(コンパイル部)103で、「1」のときは、コンパイラ(実行部)110で、当該変数の修正内容を決めることを示している。「最大長」は、当該変数を更新する文字列群の中で文字コードBに変換したときに最大となる長さを示す。「ファイル」は、ファイル変数が属するプログラム上のファイル名を示し、図9に示す例では、後述する文字コードA向けソースプログラム101の9行目で定義された「FOO」が該当する。「レコード」は、ファイル変数が属するプログラム上のレコード名を示し、図9に示す例では、文字コードA向けソースプログラム101の10行目で定義された「FOOR」が該当する。
In addition, among the items in FIG. 9, “attribute” indicates an attribute of a variable. In the example shown in FIG. 9, “X” indicates an alphanumeric item, and although not shown, “N” indicates a Japanese item. “Definition length” indicates the length (unit: bytes) in which the variable is defined. The “update level” is a flag for determining whether the compiler (compile unit) 103 or the compiler (execution unit) 110 determines the modification contents of the variable. In the illustrated example, when “0”, the compiler (compile unit) 103 determines the correction contents of the variable, and when “1”, the compiler (execution unit) 110 determines the correction contents of the variable. “Maximum length” indicates the maximum length when the variable is converted to the character code B in the character string group to be updated. “File” indicates the file name on the program to which the file variable belongs. In the example shown in FIG. 9, “FOO” defined in the ninth line of the
図4はコンパイルプログラム102がアクセスする文字列変換テーブル108の構成例を示す図である。文字列長変換テーブル108は、コンパイルプログラム102で取り扱い可能な文字に対して、文字コードAの場合の長さと文字コードBの場合の長さとを示している。図4に示す例では、「項番」、「文字」、「長さ(文字コードA)」、「長さ(文字コードB)」の各項目からなるレコードにより、文字毎の文字コードAの場合の長さと文字コードBの場合の長さとを示している。
FIG. 4 is a diagram showing a configuration example of the character string conversion table 108 accessed by the
コンパイラ(実行部)110は、プロファイル情報テーブルA106、ロードモジュール107、文字列長変換テーブル108を入力とし、プロファイル情報テーブルB112を出力する。また、ソースプログラム変換部113は、文字コードA向けソースプログラム101、カスタマイズ情報111、プロファイル情報テーブルB112を入力として、文字コードB向けソースプログラム114を出力する。カスタマイズ情報111は、プロファイル情報テーブルB112の内容を加工する情報を有するもので、よく知られているように、定義長を設定し直すために利用される。
The compiler (execution unit) 110 receives the profile information table A106, the
図2はプロファイル情報出力部104の構成を示すブロック図である。プロファイル情報出力部104は、データ定義処理部201と手続き処理部202とを有して構成されている。データ定義処理部201は、文字コードA向けソースプログラム101と文字列長変換テーブル108とを入力として、プロファイル情報テーブルA106を出力する。手続き処理部202は、文字コードA向けソースプログラム101、データ定義処理部201から出力されたプロファイル情報テーブルA106と文字列長変換テーブル108とを入力として、プロファイル情報テーブルA106を更新する。
FIG. 2 is a block diagram showing a configuration of the profile
図7は文字コードA向けソースプログラム101の例を示す図、図8は文字コードA向けの実行データの例109を示す図であり、ここで、本発明の実施形態で変換しようとしている文字コードA向けソースプログラム101について説明する。
7 is a diagram showing an example of the
文字コードA向けソースプログラム101は、図7に示すように、各行に順に行番号が付与され、行番号とその行での処理の内容等を示す情報とを1つの行として、多数の行が行番号順に記述されて構成されている。そして、このソースプログラム101は、7行目から15行目までのデータ定義部701と、16行目から25行目までの手続き部702とを持って構成されている。
In the
このようなソースプログラム101に含まれる変数により決まる実行データは、図8に示すように、「data.txt」というファイル名で定義されており、図8に示す例では、ソースプログラム101内の変数A1、A2のそれぞれが、実行データとして、「XpXsXu」、「XpXuXu」という文字列で定義され、ソースプログラム101は、「data.txt」というファイル名で、この実行データ109を読み込む。
Execution data determined by such variables included in the
図3はデータ定義処理部201での処理動作を説明するフローチャートであり、次に、これについて説明する。
FIG. 3 is a flowchart for explaining the processing operation in the data
(1)データ定義処理部201は、処理を開始すると、文字コードA向けソースプログラム101のデータ定義部701の変数を行単位に検索していく。変数の検索で、変数がヒットしたら、その変数がファイル変数であるか否かを判別する。変数の検索及びその変数がファイル変数であるか否かの判別は、各行を構文解析することにより、その行に含まれる変数を抽出して、判別する処理である(ステップ301、302)。
(1) When the process is started, the data
(2)ステップ302の判別で、変数がファイル変数であった場合、その変数に依存した内容である「行番号」、「属性」、「定義長」をプロファイル情報テーブルA106に登録すると共に、対応する「ファイル」、「レコード」が存在するので、それらの名前を記入する。また、「更新レベル」には「1」、「最大長」には「0」を入力する(ステップ303)。
(2) If it is determined in
(3)ステップ302の判別で、変数がファイル変数でなかった場合、ステップ303での処理の場合と同様に、その変数に依存した内容である「行番号」、「属性」、「定義長」をプロファイル情報テーブルA106に登録すると共に、「ファイル」、「レコード」には「NULL」を入力し、「更新レベル」には「0」、「最大長」には、初期値がある場合、文字列長変換テーブル108を参照して、文字コードBに変換したときの文字列長を計算してセットする。また、初期値がない場合、「最大長」には、「0」をセットする(ステップ304)。
(3) If it is determined in
(4)ステップ303の処理、または、ステップ304の処理により、当該変数のプロファイル情報テーブル106への登録が完了した後、文字コードA向けソースプログラム101のデータ定義部701の処理が終了しているか否かを判別し、終了していなかった場合、次の変数を検索して、ステップ302からの処理に戻って処理を続け、終了していた場合、ここでの処理を終了する(ステップ305、306)。
(4) Whether the processing of the
図5は手続き処理部202での処理動作を説明するフローチャートであり、次に、これについて説明する。
FIG. 5 is a flowchart for explaining the processing operation in the
(1)手続き処理部202は、処理を開始すると、文字コードA向けソースプログラム101の手続き部702の先頭行(図7では、16行目)から順に処理を進めることとし、変数Kを手続き部702の先頭行Jに設定する(ステップ501)。
(1) When the processing is started, the
(2)次に、処理対象となっている行に変数が存在しているか否かを判別し、変数が存在していた場合、当該変数が参照だけの変数であるかを判定し、参照だけの変数であれば何もしない(ステップ502、503)。
(2) Next, it is determined whether or not a variable exists in the row to be processed. If a variable exists, it is determined whether or not the variable is a reference-only variable, and only the reference If it is a variable, nothing is done (
(3)ステップ502の判断で、変数が存在していて、参照だけの変数ではなかった場合、その変数が変数で更新されるものであるかを判定し、変数で更新されるものであれば、プロファイル情報テーブルA106の更新レベルに「1」をセットする(ステップ504)。
(3) If it is determined in
(4)また、ステップ502の判断で、変数が存在していて、参照だけの変数ではなく、変数で更新されるものもなかった場合、次に、当該変数が定数で更新されるものであるかを判定し、定数で更新されるものであれば、文字列長変換テーブル108を参照して、定数を文字コードBに変換したときの文字列長を計算し、プロファイル情報テーブルA106の当該変数の最大長欄よりも大きい値の場合、最大長欄の値を更新する(ステップ505)。
(4) If it is determined in
(5)ステップ505での処理の終了後、あるいは、ステップ502の判断で、該当行に変数が存在していなかった場合、処理を行った手続き部の行が最終行であるか否かを判定し、最終行でなかった場合、変数KをK+1として次の行を処理することとして、ステップ502からの処理に戻って処理を続け、最終行であった場合、ここでの処理を終了する(ステップ506、507)。
(5) After completion of the processing in
図3により説明したデータ定義処理部201での処理と、図5により説明した手続き処理部202での処理から判るように、最初に、データ定義処理部201の処理で作成されたプロファイル情報テーブルA106は、手続き処理部202での処理により更新されることになり、図9に示しているプロファイル情報テーブルA106は、手続き処理部202での処理により更新された後のものである。ちなみに、データ定義処理部201の処理で作成されたプロファイル情報テーブルA106は、項番「3」の更新レベルが「0」となっており、手続き処理部202での処理により「1」に更新されている。
As can be seen from the processing in the data
また、ステップ503〜505の各処理において、変数がどのようなものかを判断しているが、この判断は、各行の構文解析の結果から行うことができる。
Further, in each process of
図6はプロファイル更新処理埋込部105で文字コードA向けソースプログラム101に埋め込まれるプロファイル更新処理の動作を説明するフローチャートであり、次に、これについて説明する。ここでの処理は、文字コードA向けソースプログラム101からロードモジュール107を生成する際に、文字コードA向けソースプログラム101の手続き部702の中で、プロファイル情報テーブル106の「更新レベル」が「1」となっている変数を含む処理の直後に埋め込まれるプロファイル更新処理であり、コンパイラ(実行部)110がロードモジュール107を処理するときに実行される処理である。
FIG. 6 is a flowchart for explaining the operation of the profile update process embedded in the
(1)この処理が開始されると、埋め込まれたプロファイル更新処理は、まず、文字列長変換テーブル108を参照して、更新対象変数のデータを文字コードBに変換したときの長さを計算する(ステップ601)。 (1) When this process is started, the embedded profile update process first calculates the length when the update target variable data is converted to the character code B with reference to the character string length conversion table 108 (Step 601).
(2)ステップ601の処理で計算した文字列長が、プロファイル情報テーブルA106の当該変数に対応した最大長欄の値より大きいか否かを判別し、最大長欄の値より大きかった場合、最大長欄の数値を更新し、最大長欄の値より大きくなかった場合、なにもせずに、そのまま終了する(ステップ602、603)。
(2) It is determined whether or not the character string length calculated in the process of
次に、図4に示す文字列変換テーブル108の例と、図7に示す文字コードA向けソースプログラム101の例と、図8に示す実行データ109の例と、図9に示すプロファイル情報テーブルA106の項目とを用いて、コンパイルプログラム102の一連の処理の流れを具体的に説明する。なお、以下では、前述したフローにおけるステップの番号をも付与して説明する。
Next, the example of the character string conversion table 108 shown in FIG. 4, the example of the
まず、プロファイル情報出力部104のデータ定義処理部201は、文字コードA向けソースプログラム例101と文字列長変換テーブル108とを入力する。そして、データ定義処理部201は、文字コードA向けソースプログラム101の7行目から変数検索を開始し(ステップ301)、11、12、14、15行目にそれぞれ変数A1、A2、B1、B2が見つかるので、順にプロファイル情報テーブルA106へその内容を登録していく。4つの変数のうち、A1、A2は、ファイル変数であることがわかるので(ステップ302)、プロファイル情報テーブルA106の「ファイル」、「レコード」の欄にそれぞれ「FOO」、「FOOR」をセットする。また、「更新レベル」に「1」、「最大長」に「0」をセットする(ステップ303)。
First, the data
B1、B2は、ファイル変数ではないと判断できるので、「ファイル」、「レコード」の欄には「NULL」を登録する。また、B1は、初期値が定義されていないため、「最大長」の欄に「0」を登録する(ステップ304)。B2は、初期値「XsXsXuXu」が定義されているため、文字列長変換テーブル108を参照して、文字コードBに対応した長さ(3+3+4+4=14)を計算し、その計算結果の値を「最大長」の欄にセットする(ステップ304)。 Since it can be determined that B1 and B2 are not file variables, “NULL” is registered in the “file” and “record” fields. In addition, since the initial value of B1 is not defined, “0” is registered in the “maximum length” field (step 304). Since the initial value “XsXsXuXu” is defined for B2, the length (3 + 3 + 4 + 4 = 14) corresponding to the character code B is calculated with reference to the character string length conversion table 108, and the value of the calculation result is expressed as “ It is set in the “maximum length” field (step 304).
次に、手続き処理部202は、文字コードA向けソースプログラム101とデータ定義処理部201で作成したプロファイル情報テーブルA106とを入力とし、文字コードA向けソースプログラム101の16行目から処理を開始する(ステップ501)。そして、図5に示した処理を実行することにより、データ定義処理部201で作成したプロファイル情報テーブルA106の項番「3」の更新レベルが「0」から「1」に更新される。
Next, the
一方、プロファイル更新処理埋込部105は、18行目の直後にA1、A2に対応した図6で示すプロファイル更新処理を埋め込み、19行目の直後にB1に対応した図6で示すプロファイル更新処理を埋め込み、21行目の直後にB1に対応した図6で示すプロファイル更新処理を埋め込む。
On the other hand, the profile update
コンパイラ(コンパイル部)103での処理が完了すると、コンパイラ(実行部)110へ処理が遷移する。コンパイラ(実行部)110は、ロードモジュール107の実行を開始し、図8に示す文字コードA向け実行データ109をロードモジュール107に読み込む。最初に、A1に実行データ「XpXsXu」が入り、プロファイル更新処理埋込部105で埋め込まれた処理により、文字列長変換テーブル108を参照して「XpXsXu」を文字コードBに変換したときの長さを(1+3+4=8)として計算する(ステップ601)。計算値「8」は、プロファイル情報テーブルA106の項番「1」の変数名A1の最大長の欄にセットしてある値「0」よりも大きいので(ステップ602)、最大長の欄を「8」に更新する(ステップ603)。同様に、A2の最大長の欄を「9」に更新する。次に、B1のプロファイル更新処理を実行する。B1には、A1の文字列「XpXsXu」が入ってくるので、A1の処理と同様となり、B1の最大長の欄を「8」に更新する。21行目では、B1を再度、A2で更新しているため、B1のプロファイル更新処理を実行し、B1の最大長欄を「9」に更新する。以上で、文字コードA向けソースプログラム例101のプロファイル更新処理が完了する。
When the processing in the compiler (compile unit) 103 is completed, the processing transitions to the compiler (execution unit) 110. The compiler (execution unit) 110 starts execution of the
図11はプロファイル更新処理完了後のプロファイル情報テーブルB112の構成例を示す図である。この図11から判るように、各変数の最大長の欄に、文字コードBに変換したときの長さの値が格納される。 FIG. 11 is a diagram illustrating a configuration example of the profile information table B112 after the profile update process is completed. As can be seen from FIG. 11, the value of the length when converted to the character code B is stored in the maximum length column of each variable.
その後、ソースプログラム変換部113は、カスタマイズ情報111、プロファイル情報テーブルB112をもとに、文字コードA向けソースプログラム101を文字コードB向けソースプログラム114に変換する。カスタマイズ情報111には、定数Tが格納されているものとする。ソースプログラム変換部113は、プロファイル情報テーブルB112の更新レベル欄「1」の変数の最大長欄の数値に対して、定数T(説明している例の場合、T=1とする)を掛けて、プロファイル情報テーブルB112の最大長欄を更新する。
After that, the source
プロファイル情報テーブルB112の例は、変数A1、A2、B1、B2の4つの変数の全てにおいて、「定義長」よりも「最大長」が大きい結果となっているので、文字コードA向けソースプログラム101で定義されている長さを「最大長」の値に変換する。この変換後の結果が文字コードB向けソースプログラム114となる。以上で、コンパイルプログラム102の処理が完了する。
In the example of the profile information table B112, the “maximum length” is larger than the “definition length” in all the four variables A1, A2, B1, and B2. Therefore, the
図10は文字コードB向けソースプログラム114の例を示す図である。この文字コードB向けソースプログラム114では、文字コードA向けソースプログラム101における各変数の属性Xとして記述されている変数の定義長が変更されたものとなっている。
FIG. 10 shows an example of the
図12は本発明の実施形態によるコンパイル装置が構築される情報処理装置のハードウェア構成を示すブロック図である。図12に示すように、本発明の実施形態によるコンパイル装置を構築する情報処理システム1201は、プロセッサ1202、ハードディスクドライブ1203、メインメモリ1204を備えて構成される。メインメモリ1204には、コンパイルプログラム102が格納され、プロセッサ1202により実行されて、前述で説明したような処理を行う。ハードディスクドライブ1203には、ソースファイル101、プロファイル情報テーブル106、文字列長変換テーブル108が格納されている。
FIG. 12 is a block diagram showing a hardware configuration of the information processing apparatus in which the compiling apparatus according to the embodiment of the present invention is constructed. As shown in FIG. 12, an
前述した本発明の実施形態での各処理は、すでに説明したように、プログラムにより構成し、本発明が備えるCPUに実行させることができ、また、それらのプログラムは、FD、CDROM、DVD等の記録媒体に格納して提供することができ、また、ネットワークを介してディジタル情報により提供することができる。 Each process in the above-described embodiment of the present invention is configured by a program as described above, and can be executed by a CPU included in the present invention. These programs include FD, CDROM, DVD, and the like. It can be provided by being stored in a recording medium, or can be provided by digital information via a network.
101 文字コードA向けソースプログラム
102 コンパイルプログラム
103 コンパイラ(コンパイル部)
104 プロファイル情報出力部
105 プロファイル更新処理埋込部
106 プロファイル情報テーブルA
107 ロードモジュール
108 文字列長変換テーブル
109 文字コードA向け実行データ
110 コンパイラ(実行部)
111 カスタマイズ情報
112 プロファイル情報テーブルB
113 ソースプログラム変換部
114 文字コードB向けソースプログラム
201 データ定義処理部
202 手続き処理部
1201 情報処理システム
1202 プロセッサ
1203 ハードディスクドライブ
1204 メインメモリ
101 Source program for
104 profile
107
111
113 Source
Claims (5)
前記情報処理装置内に、プロファイル情報出力手段と、プロファイル更新処理埋込手段と、コンパイル実行手段とを構成し、
前記プロファイル情報出力手段は、前記第1の文字コードに対応したソースプログラムのプロファイル情報を解析して第1のプロファイル情報を生成して出力し、
前記プロファイル更新処理埋込手段は、ロードモジュールの実行時に必要なプロファイル更新処理を、前記第1の文字コードに対応したソースプログラムからロードモジュールを生成する過程で埋め込み、
前記コンパイル実行手段は、前記ロードモジュールを実行し、該ロードモジュールの実行時に実行されるプロファイル更新処理は、前記第1のプロファイル情報を更新して第2のプロファイル情報を生成して出力することを特徴とするコンパイル方法。 In a compiling method in an information processing apparatus for converting a source program corresponding to a first character code into a source program corresponding to a second character code,
In the information processing apparatus, a profile information output unit, a profile update process embedding unit, and a compile execution unit are configured.
The profile information output means analyzes the profile information of the source program corresponding to the first character code to generate and output first profile information;
The profile update process embedding unit embeds a profile update process required when executing the load module in a process of generating a load module from a source program corresponding to the first character code,
The compile execution means executes the load module, and the profile update process executed when the load module is executed updates the first profile information to generate and output second profile information. Feature compilation method.
情報処理装置内に、プロファイル情報出力手段と、プロファイル更新処理埋込手段と、コンパイル実行手段と、ソースプログラム変換手段とを備え、
前記プロファイル情報出力手段は、前記第1の文字コードに対応したソースプログラムのプロファイル情報を解析して第1のプロファイル情報を生成して出力し、
前記プロファイル更新処理埋込手段は、ロードモジュールの実行時に必要なプロファイル更新処理を、前記第1の文字コードに対応したソースプログラムからロードモジュールを生成する過程で埋め込み、
前記コンパイル実行手段は、前記ロードモジュールを実行し、該ロードモジュールの実行時に実行されるプロファイル更新処理は、前記第1のプロファイル情報を更新して第2のプロファイル情報を生成して出力し、
前記ソースプログラム変換手段は、前記第2のプロファイル情報に基づいて、前記第1の文字コードに対応したソースプログラムを前記第2の文字コードに対応したソースプログラムに変換することを特徴とするコンパイル装置。 In an information processing apparatus for converting a source program corresponding to a first character code into a source program corresponding to a second character code,
The information processing apparatus includes profile information output means, profile update processing embedding means, compilation execution means, and source program conversion means.
The profile information output means analyzes the profile information of the source program corresponding to the first character code to generate and output first profile information;
The profile update process embedding unit embeds a profile update process required when executing the load module in a process of generating a load module from a source program corresponding to the first character code,
The compile execution means executes the load module, and the profile update process executed when the load module is executed updates the first profile information to generate and output second profile information,
The source program conversion means converts a source program corresponding to the first character code into a source program corresponding to the second character code based on the second profile information. .
前記第1の文字コードに対応したソースプログラムのプロファイル情報を解析して第1のプロファイル情報を生成して出力するステップと、
ロードモジュールの実行時に必要なプロファイル更新処理を、前記第1の文字コードに対応したソースプログラムからロードモジュールを生成する過程で埋め込むステップと、
前記ロードモジュールを実行し、該ロードモジュールの実行時に実行されるプロファイル更新処理が、前記第1のプロファイル情報を更新して第2のプロファイル情報を生成して出力するステップと、
前記第2のプロファイル情報に基づいて、前記第1の文字コードに対応したソースプログラムを前記第2の文字コードに対応したソースプログラムに変換するステップとを、前記情報処理装置に実行させることを特徴とするコンパイルプログラム。 A compiling program for causing an information processing apparatus to execute a source program corresponding to a first character code to convert it into a source program corresponding to a second character code,
Analyzing the profile information of the source program corresponding to the first character code to generate and output the first profile information;
Embedding profile update processing required when executing the load module in the process of generating the load module from the source program corresponding to the first character code;
Executing the load module, and updating the first profile information to generate and output the second profile information by executing a profile update process executed when the load module is executed;
Converting the source program corresponding to the first character code into a source program corresponding to the second character code based on the second profile information. A compile program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007065330A JP2008226010A (en) | 2007-03-14 | 2007-03-14 | Compile method and compile device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007065330A JP2008226010A (en) | 2007-03-14 | 2007-03-14 | Compile method and compile device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008226010A true JP2008226010A (en) | 2008-09-25 |
JP2008226010A5 JP2008226010A5 (en) | 2010-03-11 |
Family
ID=39844529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007065330A Pending JP2008226010A (en) | 2007-03-14 | 2007-03-14 | Compile method and compile device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008226010A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010108076A (en) * | 2008-10-28 | 2010-05-13 | Internatl Business Mach Corp <Ibm> | Source code conversion method, server system, and server program |
JP2015191272A (en) * | 2014-03-27 | 2015-11-02 | 富士通株式会社 | Execution control method, execution control program, and execution control device |
WO2016031959A1 (en) * | 2014-08-29 | 2016-03-03 | 株式会社日立公共システム | Migration support device |
JP2016191977A (en) * | 2015-03-30 | 2016-11-10 | 新日鉄住金ソリューションズ株式会社 | Information processing apparatus, information processing method, and program |
CN110333870A (en) * | 2019-06-28 | 2019-10-15 | 潍柴动力股份有限公司 | Processing method, device and the equipment of Simulink model variable distribution |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06236295A (en) * | 1992-03-16 | 1994-08-23 | Nippon Telegr & Teleph Corp <Ntt> | Program transplant supporting system |
JPH07281883A (en) * | 1994-04-06 | 1995-10-27 | Fujitsu Ltd | Device and method for supporting program correction |
JPH08190479A (en) * | 1995-01-05 | 1996-07-23 | Mitsubishi Electric Corp | Data base shift system |
JPH1165837A (en) * | 1997-08-27 | 1999-03-09 | Oki Electric Ind Co Ltd | Data exception detecting method for external file data and storage medium where data exception detection program for external file data is recorded |
JP2004252890A (en) * | 2003-02-21 | 2004-09-09 | Fujitsu Ltd | Text data creation method, text data creation device and computer program |
-
2007
- 2007-03-14 JP JP2007065330A patent/JP2008226010A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06236295A (en) * | 1992-03-16 | 1994-08-23 | Nippon Telegr & Teleph Corp <Ntt> | Program transplant supporting system |
JPH07281883A (en) * | 1994-04-06 | 1995-10-27 | Fujitsu Ltd | Device and method for supporting program correction |
JPH08190479A (en) * | 1995-01-05 | 1996-07-23 | Mitsubishi Electric Corp | Data base shift system |
JPH1165837A (en) * | 1997-08-27 | 1999-03-09 | Oki Electric Ind Co Ltd | Data exception detecting method for external file data and storage medium where data exception detection program for external file data is recorded |
JP2004252890A (en) * | 2003-02-21 | 2004-09-09 | Fujitsu Ltd | Text data creation method, text data creation device and computer program |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010108076A (en) * | 2008-10-28 | 2010-05-13 | Internatl Business Mach Corp <Ibm> | Source code conversion method, server system, and server program |
JP2015191272A (en) * | 2014-03-27 | 2015-11-02 | 富士通株式会社 | Execution control method, execution control program, and execution control device |
WO2016031959A1 (en) * | 2014-08-29 | 2016-03-03 | 株式会社日立公共システム | Migration support device |
JP2016051235A (en) * | 2014-08-29 | 2016-04-11 | 株式会社日立公共システム | Migration support system |
JP2016191977A (en) * | 2015-03-30 | 2016-11-10 | 新日鉄住金ソリューションズ株式会社 | Information processing apparatus, information processing method, and program |
CN110333870A (en) * | 2019-06-28 | 2019-10-15 | 潍柴动力股份有限公司 | Processing method, device and the equipment of Simulink model variable distribution |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8645350B2 (en) | Dictionary compilations | |
US8601368B2 (en) | Processing method and device for the coding of a document of hierarchized data | |
JP2004530188A (en) | Method for compressing / decompressing structured documents | |
JP2007226452A (en) | Structured document management device, structured document management program and structured document management method | |
JP2005018775A (en) | Distributed processing method and distributed processing system | |
US20070271553A1 (en) | Method and system for translating assembler code to a target language | |
JP2004518231A (en) | Method for compressing a structured description of a document | |
JP2016207161A (en) | Information processor, compilation method and compilation program | |
US20040154009A1 (en) | Structuring program code | |
JP2008226010A (en) | Compile method and compile device | |
JP5325921B2 (en) | Decoder compiler, program and communication equipment | |
CN114489647A (en) | Method, device, equipment and medium for building small program in modular mode | |
CN110990055B (en) | Pull Request function classification method based on program analysis | |
CN1525317A (en) | System and method for defining and using subclasses declaratively within markup | |
US20090235054A1 (en) | Disassembling an executable binary | |
WO2004051470A1 (en) | Program automatic converting method and program automatic converting device | |
CN114791811B (en) | Assembler realization method based on meta-function template | |
JP2009048259A (en) | Program conversion method and program for conversion | |
JP2011244447A (en) | Method of storing huffman tree and method of decoding data in array | |
JP5488792B2 (en) | Database operation device, database operation method, and program | |
JP2011154495A (en) | Character code conversion device, character code conversion method and character code conversion program | |
JP7059757B2 (en) | API processing method, terminal, API processing program | |
JP2005063121A (en) | Device, method and program for converting source code and storage medium | |
JP5596517B2 (en) | Internationalized screen generation system and program | |
JP2014149587A (en) | Information processing apparatus and compiler program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100121 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100121 |
|
A977 | Report on retrieval |
Effective date: 20120427 Free format text: JAPANESE INTERMEDIATE CODE: A971007 |
|
A131 | Notification of reasons for refusal |
Effective date: 20120515 Free format text: JAPANESE INTERMEDIATE CODE: A131 |
|
A02 | Decision of refusal |
Effective date: 20120918 Free format text: JAPANESE INTERMEDIATE CODE: A02 |