JP2010224656A - Source code generation device, program and source code generation method - Google Patents

Source code generation device, program and source code generation method Download PDF

Info

Publication number
JP2010224656A
JP2010224656A JP2009068546A JP2009068546A JP2010224656A JP 2010224656 A JP2010224656 A JP 2010224656A JP 2009068546 A JP2009068546 A JP 2009068546A JP 2009068546 A JP2009068546 A JP 2009068546A JP 2010224656 A JP2010224656 A JP 2010224656A
Authority
JP
Japan
Prior art keywords
code
source code
record
file
character string
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
JP2009068546A
Other languages
Japanese (ja)
Inventor
Yuzuru Kanemori
譲 兼森
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.)
NS Solutions Corp
Nippon Steel Stainless Steel Corp
Original Assignee
Nippon Steel and Sumikin Stainless Steel Corp
NS Solutions 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 Nippon Steel and Sumikin Stainless Steel Corp, NS Solutions Corp filed Critical Nippon Steel and Sumikin Stainless Steel Corp
Priority to JP2009068546A priority Critical patent/JP2010224656A/en
Publication of JP2010224656A publication Critical patent/JP2010224656A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the load in development of software for processing a record contained in a file of a character code expressed by two full-width two-bytes or one half-width one-byte with a character code expressed by the same byte number for both full width and half width. <P>SOLUTION: The device includes a generation means for setting, based on file layout information showing the layout of a file composed of a character string record including a plurality of items each composed of a character code of one or two or more byte arrays, setting information to a code converter according to the type corresponding to each item of the character string record, and automatically generating a source code related to conversion of the character code of the character string record. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、ソースコード生成装置、プログラム及びソースコード生成方法に関する。   The present invention relates to a source code generation device, a program, and a source code generation method.

日本語圏のパーソナルコンピュータでは漢字を表現する文字コードとしてShift_JISを代表とする全角2バイト、半角1バイトで表現する文字コードが一般的であった。しかしながら、昨今、アプリケーションのグローバル化が進むにつれ、複数の言語圏に対応するための文字コードが整理され、全角文字も半角文字も1文字として扱う代わりに1文字をnバイトで表現する文字コード(例えば、Unicode等)が増えている。特に、パーソナルコンピュータ(以下、PCともいう)では、このような文字コードを採用するものが増えてきた。   In a Japanese-speaking personal computer, a character code represented by two-byte full-width and one-byte single-byte represented by Shift_JIS is generally used as a character code for representing kanji. However, as the globalization of applications has progressed recently, character codes for dealing with a plurality of linguistic areas have been arranged, and instead of treating single-byte characters and single-byte characters as one character, a character code that represents one character in n bytes For example, Unicode is increasing. In particular, personal computers (hereinafter also referred to as PCs) have increasingly used such character codes.

一方で、ホスト計算機等と連動するレガシーシステムにおいては、文字列の領域を容易に見積もれることもあり、全角2バイト、半角1バイトで表現する文字コードが根強く残っている。COBOLに代表される固定長のデータ構造を扱うプログラム言語では、データのサイズをバイト単位で割り当てる。このため、PCのCOBOLでは固定長で設計のしやすいShift_JISが採用されている。   On the other hand, in a legacy system linked with a host computer or the like, a character string area can be easily estimated, and character codes expressed by 2 full-byte characters and 1 single-byte character remain persistently. In a programming language that handles a fixed-length data structure typified by COBOL, the data size is assigned in bytes. For this reason, Shift_JIS, which has a fixed length and is easy to design, is adopted in the COBOL of the PC.

COBOLではファイルを扱う際にレコードを文字列で表現したものを扱う場合がある。これをSAMファイルと言う。SAMファイルには、対応するレコード定義の情報がバイト単位に連結して記録されている。このため、COBOL以外の言語でSAMファイルを扱う際には、項目ごとの切り出し及び連結等が必要となる。ここで、図1は、レコード定義、Shift_JISコードのレコードデータ、Unicodeのレコードデータ、の一例を示す図である。なお、図1では、レコード定義の一例としてCOBOLの場合を示している。
Shift_JISコードのシステムでは、レコード定義のバイトイメージと文字列の内部表現とが一致しているため切り出しは容易である。しかしながら、図1に示されるように、Unicodeの場合、全角文字と半角文字とのバイト数の違いにより、レコード定義(COBOLレコード定義)のバイトイメージと文字列の内部表現とに乖離が生じる。
In COBOL, when a file is handled, a record representing a character string may be handled. This is called a SAM file. In the SAM file, corresponding record definition information is recorded by being linked in byte units. For this reason, when handling a SAM file in a language other than COBOL, it is necessary to cut out, link, etc. for each item. Here, FIG. 1 is a diagram showing an example of a record definition, Shift_JIS code record data, and Unicode record data. FIG. 1 shows the case of COBOL as an example of the record definition.
In the Shift_JIS code system, since the byte image in the record definition matches the internal representation of the character string, it is easy to cut out. However, as shown in FIG. 1, in the case of Unicode, there is a discrepancy between the byte image of the record definition (COBOL record definition) and the internal representation of the character string due to the difference in the number of bytes between full-width characters and half-width characters.

図1において、例えば、上述したようにSAMファイルで利用されるShift_JISコードでは、全角文字2バイト、半角文字1バイトで表現される。よって、ITEM01に配置される"あA"という文字列は、例えば、あ=82A0、A=41等と表現される。一方、内部表現がUnicodeであるアプリケーション内では、全角であろうが、半角であろうが、1文字2バイトとして扱われる。よって、ITEM01に配置される"あA"という文字列は、例えば、あ=3042、A=0041等と表現される。
このように、Shift_JISでは3バイトで表現される領域がUnicodeでは4バイトで表現される。文字列が長いほどこの乖離は広がっていく。
Unicodeの特に全角データと半角データとが混在するレコードを使用する場合、レコード定義のバイトイメージと一致させるための処理が必要となる。
In FIG. 1, for example, the Shift_JIS code used in the SAM file as described above is represented by 2 bytes of full-width characters and 1 byte of half-width characters. Therefore, the character string “A” arranged in ITEM01 is expressed as, for example, A = 82A0, A = 41, and the like. On the other hand, within an application whose internal representation is Unicode, whether it is full-width or half-width, it is treated as 2 bytes per character. Therefore, the character string “A” arranged in ITEM01 is expressed as, for example, A = 3042, A = 0041, and the like.
In this way, an area represented by 3 bytes in Shift_JIS is represented by 4 bytes in Unicode. The longer the string, the greater the gap.
In particular, when a record in which full-width data and half-width data are mixed is used in Unicode, processing for matching with the byte image of the record definition is required.

特開平5−298065号公報JP-A-5-298065

図2は、従来における、Shift_JISコードのファイルに記載されたレコードをUnicodeのアプリケーションがメモリに読み込み、処理(本来の処理)を行う際に必要となる処理の一例を示す図である。図2の例では、レコードαは、項目A、B、Cを有し、項目Bと項目Cとの間に予備(FILLER)を含むものとしている。
図2に示されるように、従来では、例えば、PCは、Unicodeにおいて、項目からデータを読み出したり、データを書き込んだりするような本来の処理を行う前に、Shift_JISコードのSAMファイルから各項目を切り出し、Shift_JISコードからUnicodeへの文字コードの変換を行うと共に、レコード定義のバイトイメージとUnicodeに変換したデータ(項目)との対応関係をつけ、メモリ上に格納する必要があった。また、PCは、本来の処理を行った後、レコードをSAMファイルに戻す際は、UnicodeからShift_JISコードへの変換を行った後、項目を結合させ、SAMファイルに書き込む必要があった。これら切り出しや、変換、結合等の処理は、本来の処理に付随する処理である。しかしながら、レコードの種類、項目数等に比例し、前記付随する処理を実現させるためのコーディング量は増大する。このため、アプリケーション(ソフトウェア)の開発効率を悪化させる要因の一つとなると共に、保守効率を悪化させる要因の一つともなっていた。
FIG. 2 is a diagram illustrating an example of processing that is required when a Unicode application reads a record written in a Shift_JIS code file into a memory and performs processing (original processing). In the example of FIG. 2, the record α includes items A, B, and C, and includes a reserve (FILLER) between the items B and C.
As shown in FIG. 2, conventionally, for example, the PC reads each item from the SAM file of the Shift_JIS code before performing an original process such as reading or writing data from the item in Unicode. It was necessary to cut out and convert the character code from Shift_JIS code to Unicode, and to associate the byte image of the record definition with the data (item) converted to Unicode and store it in the memory. Further, when the PC returns the record to the SAM file after performing the original processing, it is necessary to convert the Unicode to the Shift_JIS code, combine the items, and write the data to the SAM file. These processes such as cutout, conversion, and combination are processes accompanying the original process. However, the amount of coding for realizing the accompanying processing increases in proportion to the type of record, the number of items, and the like. For this reason, it has become one of the factors that deteriorate the development efficiency of applications (software) and one of the factors that deteriorates maintenance efficiency.

また、図1に示されるように、従来の方法では、例えばレコードの項目の間等に予備が含まれる場合、この予備を排除したり、追加したりする処理のためのコーディングも必要となる。また、従来の方法では、後述する集団項目を扱うような処理のためのコーディングも別途、必要となる。   Also, as shown in FIG. 1, in the conventional method, for example, when a spare is included between items of a record, coding for processing to eliminate or add this spare is also necessary. In addition, the conventional method also requires coding for processing that handles group items described later.

本発明はこのような問題点に鑑みなされたもので、全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェアの開発の負荷を軽減することを目的とする。   The present invention has been made in view of such a problem, and software for processing a record included in a character code file expressed by 2 full-width characters and 1 single-byte character by using a character code expressing the same number of bytes. The purpose is to reduce the development load.

そこで、本発明は、1又は複数のバイト配列の文字コードで構成される項目を複数含む文字列レコードで構成されるファイルのレイアウトを示すファイルレイアウト情報に基づいて、前記文字列レコードの項目に対応した型別のコード変換器に設定情報を設定し、前記型別のコード変換器を組み合わせることによって、前記文字列レコードの文字コードの変換に係るソースコードを自動生成する生成手段を有することを特徴とする。   Therefore, the present invention corresponds to the item of the character string record based on the file layout information indicating the layout of the file composed of the character string record including a plurality of items composed of one or more byte array character codes. A setting unit configured to automatically generate a source code related to conversion of a character code of the character string record by setting setting information in the code converter for each type and combining the code converter for each type And

係る構成とすることにより、ファイルレイアウト情報に基づいて、文字列レコードの文字コードの変換に係るソースコードが自動生成される。全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェアの開発者は、自動生成されたソースコードを用いて、前記ソフトウェアを作成する。よって、全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェアの開発の負荷を軽減することができる。   With this configuration, a source code related to conversion of the character code of the character string record is automatically generated based on the file layout information. Software developers who process records contained in character code files that are represented by 2 bytes and 1 byte can be processed using the same number of bytes. Create the software. Therefore, it is possible to reduce the development load of software for processing records included in a character code file expressed by 2 bytes and 1 byte by using the same number of bytes.

なお、生成手段は、例えば、後述する変換装置等に対応する。また、ファイルレイアウト情報は、例えば、後述するレコード定義等に対応する。   The generation unit corresponds to, for example, a conversion device described later. The file layout information corresponds to, for example, a record definition described later.

また、本発明は、プログラム及びソースコード生成方法としてもよい。   Further, the present invention may be a program and a source code generation method.

本発明によれば、全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェアの開発の負荷を軽減することができる。   According to the present invention, it is possible to reduce the load of software development for processing records included in a character code file expressed by 2 full-byte and 1 single-byte characters by using a character code expressed by the same number of bytes. it can.

レコード定義、Shift_JISコードのレコードデータ、Unicodeのレコードデータ、の一例を示す図である。It is a figure which shows an example of a record definition, the record data of Shift_JIS code, and the record data of Unicode. 従来における、Shift_JISコードのファイルに記載されたレコードをUnicodeのアプリケーションがメモリに読み込み、処理(本来の処理)を行う際に必要となる処理の一例を示す図である。It is a figure which shows an example of the process required when the application of Unicode reads the record described in the file of the Shift_JIS code | cord | chord in the past, and performs a process (original process). 本実施形態のシステムのシステム構成の一例を示す図である。It is a figure which shows an example of the system configuration | structure of the system of this embodiment. レコード原始プログラムコード生成装置2のハードウェア構成の一例を示す図である。2 is a diagram illustrating an example of a hardware configuration of a record source program code generation device 2. FIG. レコード原始プログラムコード生成処理に係る一例のシーケンス図である。It is a sequence diagram of an example concerning a record source program code generation process. 本実施形態のシステムの機能の一例を示すクラス図である。It is a class diagram which shows an example of the function of the system of this embodiment. コード変換器の一例を示す図である。It is a figure which shows an example of a code converter. 集団項目変換器の一例を示す図である。It is a figure which shows an example of a group item converter. 9型変換器の一例を示す図である。It is a figure which shows an example of a 9-type converter. X型変換器の一例を示す図である。It is a figure which shows an example of an X-type converter. FILLERの一例を示す図である。It is a figure which shows an example of FILLER. S9型変換器の一例を示す図である。It is a figure which shows an example of a S9 type | mold converter. 図2と対比させ、本実施形態を説明するための図である。FIG. 3 is a diagram for explaining this embodiment in comparison with FIG. 2.

以下、本発明の実施形態について図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図3は、本実施形態のシステムのシステム構成の一例を示す図である。図3に示されるように、システムは、レコード定義レポジトリ装置1と、レコード原始プログラムコード生成装置2と、開発者装置3と、クライアント装置4と、がネットワーク5を介して接続されている。なお、図3では、クライアント装置4がネットワーク5に接続されているとして説明を行っているが、クライアント装置4は、ネットワーク5に接続されていなくてもよい。
レコード定義レポジトリ装置1は、図1に示したようなレコード定義を複数、記憶している。レコード原始プログラムコード生成装置2は、開発者装置3からの生成要求に基づいて、レコード定義レポジトリ装置1からレコード定義を取得し、取得したレコード定義に基づいて、図1に示されるSAMファイルに含まれるレコードの項目に対応した型別のコード変換器に設定情報を設定し、前記型別のコード変換器を組み合わせることによって、前記レコードの文字コードの変換に係るレコード原始プログラムコードを自動生成する。
FIG. 3 is a diagram illustrating an example of a system configuration of the system according to the present embodiment. As shown in FIG. 3, in the system, a record definition repository device 1, a record source program code generation device 2, a developer device 3, and a client device 4 are connected via a network 5. In FIG. 3, the client device 4 is described as being connected to the network 5, but the client device 4 may not be connected to the network 5.
The record definition repository apparatus 1 stores a plurality of record definitions as shown in FIG. The record source program code generation device 2 acquires the record definition from the record definition repository device 1 based on the generation request from the developer device 3, and includes it in the SAM file shown in FIG. 1 based on the acquired record definition. Setting information is set in the code converter for each type corresponding to the record item to be recorded, and the record code for converting the character code of the record is automatically generated by combining the code converter for each type.

開発者装置3は、レコード原始プログラムコード生成装置2によって自動生成されたレコード原始プログラムコードを取得する。開発者は、開発者装置3を操作し、自動生成されたレコード原始プログラムコードを用いて、全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェア(以下、単にソフトウェアという)を作成する。
なお、後述する図7〜図12を用いて詳細に説明するが、コード変換器は、例えば、ソフトウェアからデータを書き込むよう指示されると、UnicodeのデータをShift_JISのデータへと変換し、設定情報で設定されているレコードの位置に前記データを書き込む。また、型別のコード変換器は、ソフトウェアからデータを読み込むよう指示されると、設定情報で設定されているレコードの位置からShift_JISのデータを読み込んで、Unicodeのデータへと変換する。
The developer device 3 acquires the record source program code automatically generated by the record source program code generation device 2. The developer operates the developer device 3 and uses the automatically generated record source program code to record the records included in the character code file represented by 2 bytes and 1 byte as the same number of bytes. The software (hereinafter simply referred to as software) to be processed with the character code expressed in (1) is created.
As will be described in detail with reference to FIGS. 7 to 12 described later, for example, when the code converter is instructed to write data from software, it converts Unicode data into Shift_JIS data and sets information. The data is written at the position of the record set in. When the code converter for each type is instructed to read data from the software, it reads Shift_JIS data from the position of the record set in the setting information and converts it to Unicode data.

開発者装置3で作成されたソフトウェア及び型別のコード変換器は、ネットワークを介して、又は記憶媒体等を介してクライアント装置4に配布され、例えば、Unicodeのクライアント装置4で実行される。   The software created by the developer device 3 and the code converter for each type are distributed to the client device 4 via a network or a storage medium, and executed by the client device 4 of Unicode, for example.

図4は、レコード原始プログラムコード生成装置2のハードウェア構成の一例を示す図である。
図4に示されるようにレコード原始プログラムコード生成装置2は、ハードウェア構成として、CPU11を含む。CPU11が、記憶装置13に記憶されているプログラムに基づき処理を行うことによって、変換装置の機能を実現する。
CPU11には、バス10を介して、入力装置12、記憶装置13及び表示装置14が接続されている。記憶装置13は、例えば、ROM、RAM、ハードディスク装置等からなり、上述した各プログラム以外に、プログラムに基づく処理で用いられるデータを記憶する。表示装置14は、情報を表示する例えばディスプレイ等である。入力装置12は、情報を入力する例えば操作キー等である。
なお、レコード定義レポジトリ装置1、開発者装置3、クライアント装置4のハードウェア構成も図4に示すレコード原始プログラムコード生成装置2のハードウェア構成と同様である。
なお、入力装置12及び表示装置14は、レコード原始プログラムコード生成装置2の必須の構成要素ではない。
FIG. 4 is a diagram illustrating an example of a hardware configuration of the record source program code generation device 2.
As shown in FIG. 4, the record source program code generation device 2 includes a CPU 11 as a hardware configuration. The CPU 11 realizes the function of the conversion device by performing processing based on the program stored in the storage device 13.
An input device 12, a storage device 13, and a display device 14 are connected to the CPU 11 via the bus 10. The storage device 13 includes, for example, a ROM, a RAM, a hard disk device, and the like, and stores data used in processing based on the program in addition to the above-described programs. The display device 14 is, for example, a display that displays information. The input device 12 is, for example, an operation key for inputting information.
The hardware configuration of the record definition repository device 1, developer device 3, and client device 4 is the same as that of the record source program code generation device 2 shown in FIG.
The input device 12 and the display device 14 are not essential components of the record source program code generation device 2.

図5は、レコード原始プログラムコード生成処理に係る一例のシーケンス図である。
SQ10において、開発者装置3は、SAMファイルを識別する識別情報を含むレコード原始プログラムコード生成要求をレコード原始プログラムコード生成装置2に対して送信する。
レコード原始プログラムコード生成装置2は、記憶装置13等にSAMファイルとレコード定義とを対応付ける対応付け情報を保持しており、前記レコード原始プログラムコード生成要求に含まれるSAMファイルの識別情報に基づいて、前記SAMファイルに対応するレコード定義を特定する。
レコード原始プログラムコード生成装置2は、特定したレコード定義を識別する識別情報を含む検索要求をレコード定義レポジトリ装置1に送信し、前記識別情報で識別されるレコード定義の取得をレコード定義レポジトリ装置1に対して要求する。
FIG. 5 is a sequence diagram illustrating an example of the record source program code generation process.
In SQ 10, the developer device 3 transmits a record source program code generation request including identification information for identifying the SAM file to the record source program code generator 2.
The record source program code generation device 2 holds association information for associating the SAM file with the record definition in the storage device 13 or the like, and based on the identification information of the SAM file included in the record source program code generation request, A record definition corresponding to the SAM file is specified.
The record source program code generation device 2 transmits a search request including identification information for identifying the identified record definition to the record definition repository device 1, and obtains the record definition identified by the identification information to the record definition repository device 1. Request.

なお、開発者装置3は、レコード定義を識別する識別情報を含むレコード原始プログラムコード生成要求をレコード原始プログラムコード生成装置2に対して送信するようにしてもよい。このような場合、レコード原始プログラムコード生成装置2は、前記レコード原始プログラムコード生成要求に含まれるレコード定義を識別する識別情報を含む検索要求をレコード定義レポジトリ装置1に送信し、前記識別情報で識別されるレコード定義の取得をレコード定義レポジトリ装置1に対して要求する。   The developer apparatus 3 may transmit a record source program code generation request including identification information for identifying the record definition to the record source program code generation apparatus 2. In such a case, the record source program code generation device 2 transmits a search request including identification information for identifying the record definition included in the record source program code generation request to the record definition repository device 1 and is identified by the identification information. The record definition repository apparatus 1 is requested to acquire the record definition to be executed.

図6は、本実施形態のシステムの機能の一例を示すクラス図である。
図6に示されるように、本実施形態のシステムは、機能として、変換装置と、コード変換器と、を含む。コード変換器は、集団項目変換器と、9型変換器と、S9型変換器と、X型変換器と、を含む。なお、変換装置は、レコード原始プログラムコード生成装置2で実行されるプログラムである。また、コード変換器は、クライアント装置4等で実行されるプログラムである。また、変換器が上述した変換器以外の変換器を含んでもよい。
FIG. 6 is a class diagram showing an example of the functions of the system of this embodiment.
As shown in FIG. 6, the system of the present embodiment includes a conversion device and a code converter as functions. The code converter includes a group item converter, a type 9 converter, an S9 type converter, and an X type converter. The conversion device is a program executed by the record source program code generation device 2. The code converter is a program executed by the client device 4 or the like. Further, the converter may include a converter other than the converter described above.

変換装置は、レコード定義に基づいて、SAMファイルに含まれるレコードの項目に対応した型別のコード変換器(例えば、集団項目変換器、9型変換器、S9型変換器、X型変換器等)に設定情報(例えば、後述する図7に示されるID、データ、開始位置、長さ、整数長、小数長等)を設定し、前記型別のコード変換器を組み合わせることによって、前記レコードの文字コードの変換に係るレコード原始プログラムコードを自動生成する。
なお、以降、図7〜図12に示されるコード変換器には、変換装置が図1に示されるレコード定義に基づいて設定した設定情報やコード変換器の組み合わせの例を示している。
Based on the record definition, the conversion device is a code converter for each type corresponding to the item of the record included in the SAM file (for example, a group item converter, a 9-type converter, an S9-type converter, an X-type converter, etc. ) In the setting information (for example, ID, data, start position, length, integer length, decimal length, etc. shown in FIG. 7 to be described later), and by combining the code converters by type, A record source program code related to character code conversion is automatically generated.
In the following, the code converters shown in FIGS. 7 to 12 show examples of combinations of setting information and code converters set by the conversion device based on the record definition shown in FIG.

図7は、コード変換器の一例を示す図である。コード変換器は、COBOL文法におけるレコードに相当する。コード変換器は、データ部を参照するための要素を保持する。
図8は、集団項目変換器の一例を示す図である。集団項目変換器は、COBOL文法における集団項目に相当する。集団項目変換器は、データ部を参照するための要素を保持し、データをまとめることができる。
図9は、9型変換器の一例を示す図である。9型変換器は、COBOL文法における9タイプに相当する。9型変換器は、内部表現として数値をShift_JISの文字列で保持し、入出力の際に、数値とShift_JIS文字列との変換を行う。9型変換器は、データ領域を整数部と小数部とで表現された固定小数点として管理しており、精度を超える入力に対しては丸めを行う。
FIG. 7 is a diagram illustrating an example of a code converter. The code converter corresponds to a record in the COBOL grammar. The code converter holds an element for referring to the data part.
FIG. 8 is a diagram illustrating an example of a group item converter. The group item converter corresponds to a group item in the COBOL grammar. The group item converter holds elements for referring to the data part and can collect data.
FIG. 9 is a diagram illustrating an example of a 9-type converter. The 9-type converter corresponds to 9 types in the COBOL grammar. The 9-type converter holds a numerical value as an internal representation as a Shift_JIS character string, and converts the numerical value and the Shift_JIS character string at the time of input / output. The 9-type converter manages the data area as a fixed point expressed by an integer part and a decimal part, and performs rounding for an input exceeding the precision.

図10は、X型変換器の一例を示す図である。X型変換器は、COBOL文法におけるXタイプに相当する。X型変換器は、内部表現として数値をShift_JISの文字コードで保持し、入出力の際に対象処理系コード(例えば、Unicode)とShift_JISコードの変換を行う。
図11は、FILLERの一例を示す図である。FILLERに対応する変換器は存在しない。9型変換器、S9型変換器、X型変換器等の直接値を現す変換器によって管理されていない領域がFILLERである。
図12は、S9型変換器の一例を示す図である。S9型変換器は、COBOL文法におけるS9タイプに相当する。S9型変換器は、内部表現として数値をShift_JISコードの文字列で保持し、入出力の際に、数値とShift_JIS文字列との変換を行う。S9型変換器は、データ領域を整数部と小数部とで表現された固定小数点として管理しており、精度を超える入力に対しては丸めを行う。S9型変換器と、9型変換器と、の違いは、S9型変換器は、符号が管理できることであり、負の数の場合、0x40を足すことで表現する。
FIG. 10 is a diagram illustrating an example of an X-type converter. The X-type converter corresponds to the X type in the COBOL grammar. The X-type converter holds a numerical value as an internal representation as a Shift_JIS character code, and converts an object processing system code (for example, Unicode) and a Shift_JIS code at the time of input / output.
FIG. 11 is a diagram illustrating an example of FILLER. There is no converter corresponding to FILLER. An area not managed by a converter that expresses a direct value such as a 9-type converter, an S9-type converter, or an X-type converter is FILLER.
FIG. 12 is a diagram illustrating an example of the S9 type converter. The S9 type converter corresponds to the S9 type in the COBOL grammar. The S9 type converter holds a numerical value as a shift_JIS code character string as an internal representation, and performs conversion between the numerical value and the Shift_JIS character string at the time of input / output. The S9 type converter manages the data area as a fixed point expressed by an integer part and a decimal part, and rounds an input exceeding the precision. The difference between the S9 type converter and the 9 type converter is that the S9 type converter can manage the sign, and in the case of a negative number, it is expressed by adding 0x40.

図13は、図2と対比させ、本実施形態を説明するための図である。図13に示されるように、本実施形態では、変換装置が、レコード定義に基づいて、変換に係るソースコードを自動生成するので、開発者による個別のコーディングは不要となる。また、コーディングが不要であるため、レコードや項目数が増えても問題ない。また、開発者が、予備の部分を考慮する必要もなく、集団項目を扱うためのコーディングをする必要もない。
本実施形態によれば、例えば内部表現がUnicodeのクライアント装置4のメモリに、Shift_JISコードの文字列が格納される。そして、各コード変換器が、アプリケーション等から呼び出され、データを書き込んだり、読み込んだりする度に、順次、変換に係る処理を実行する。
FIG. 13 is a diagram for explaining this embodiment in comparison with FIG. As shown in FIG. 13, in the present embodiment, the conversion device automatically generates the source code related to the conversion based on the record definition, so that individual coding by the developer is unnecessary. In addition, since no coding is required, there is no problem even if the number of records or items increases. Also, developers do not need to consider spare parts and do not need to code to handle group items.
According to the present embodiment, for example, the character string of the Shift_JIS code is stored in the memory of the client device 4 whose internal representation is Unicode. Each code converter is called from an application or the like, and sequentially executes processing related to conversion each time data is written or read.

以上、上述したように本実施形態によれば、全角2バイト、半角1バイトで表現する文字コードのファイルに含まれるレコードを全角、半角共に同じバイト数で表現する文字コードで処理するソフトウェアの開発の負荷を軽減することができる。
また、本実施形態によれば、開発者が、自動生成されたソースコードを用いてソフトウェアを開発する際に、例えば、コード変換器に対してデータの書き込みを指示する実装(コーディング)を行う際に、例えば誤った型のデータ等の書き込みを指示した場合、コンパイル時等にエラーが表示されるため、修正を行うことができる。一方、図2に示したような従来例の場合、例え上述したような誤ったコーディングをした場合であっても、コンパイル時等にエラーは表示されない。
As described above, according to the present embodiment, as described above, the development of software that processes records included in a character code file expressed by 2 full-width characters and 1 single-byte character by a character code expressing both full-width and half-width characters by the same number of bytes. Can reduce the load.
In addition, according to the present embodiment, when a developer develops software using automatically generated source code, for example, when performing implementation (coding) instructing the code converter to write data. In addition, for example, when an instruction to write wrong type data or the like is given, an error is displayed at the time of compilation or the like, so that correction can be performed. On the other hand, in the case of the conventional example as shown in FIG. 2, no error is displayed at the time of compilation or the like even if the coding is incorrect as described above.

以上、本発明の好ましい実施形態について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   The preferred embodiments of the present invention have been described in detail above, but the present invention is not limited to such specific embodiments, and various modifications can be made within the scope of the gist of the present invention described in the claims.・ Change is possible.

2 レコード原始プログラムコード生成装置
11 CPU
12 入力装置
13 記憶装置
14 表示装置
2 record source program code generator 11 CPU
12 Input device 13 Storage device 14 Display device

Claims (7)

1又は複数のバイト配列の文字コードで構成される項目を複数含む文字列レコードで構成されるファイルのレイアウトを示すファイルレイアウト情報に基づいて、前記文字列レコードの項目に対応した型別のコード変換器に設定情報を設定し、前記文字列レコードの文字コードの変換に係るソースコードを自動生成する生成手段を有することを特徴とするソースコード生成装置。   Code conversion according to type corresponding to the item of the character string record based on the file layout information indicating the layout of the file composed of the character string record including a plurality of items composed of one or more byte array character codes A source code generation apparatus comprising: generation means for setting setting information in a device and automatically generating a source code relating to conversion of a character code of the character string record. 前記生成手段は、前記ファイルレイアウト情報に基づいて、前記文字列レコードの項目に対応した型別のコード変換器に設定情報を設定すると共に前記型別のコード変換器を組み合わせることによって、前記文字列レコードの文字コードの変換に係るソースコードを自動生成することを特徴とする請求項1に記載のソースコード生成装置。   The generating means sets the setting information in a code converter for each type corresponding to the item of the character string record based on the file layout information, and combines the code converter for each type to combine the character string. 2. The source code generation apparatus according to claim 1, wherein a source code relating to conversion of a character code of the record is automatically generated. 前記ファイルを識別する識別情報を含むソースコード生成要求を受信する受信手段と、
前記受信手段で受信した前記ソースコード生成要求に含まれる前記識別情報で識別される前記ファイルに基づいて、前記ファイルのレイアウトを示すファイルレイアウト情報を記憶装置より検索する検索手段と、
を更に有し、
前記生成手段は、前記検索手段で検索した結果、取得したファイルレイアウト情報に基づいて、前記ファイルを構成するレコードの文字コードの変換に係るソースコードを自動生成することを特徴とする請求項1又は2に記載のソースコード生成装置。
Receiving means for receiving a source code generation request including identification information for identifying the file;
Search means for searching file layout information indicating a layout of the file from a storage device based on the file identified by the identification information included in the source code generation request received by the receiving means;
Further comprising
The generation unit automatically generates a source code related to conversion of a character code of a record constituting the file, based on the file layout information acquired as a result of the search by the search unit. The source code generation device according to 2.
前記生成手段は、前記ファイルレイアウト情報に基づいて、前記型別のコード変換器に、前記文字列レコードを参照する参照情報、前記項目に係るバイト配列の開始位置、前記項目に係るバイト配列の長さを設定情報として設定することを特徴とする請求項1乃至3の何れか1項に記載のソースコード生成装置。   The generation means, based on the file layout information, in the code converter by type, reference information for referring to the character string record, the start position of the byte array related to the item, the length of the byte array related to the item The source code generation apparatus according to any one of claims 1 to 3, wherein the length is set as setting information. 前記文字列レコードには、予備部分が含まれることを特徴とする請求項4に記載のソースコード生成装置。   The source code generation apparatus according to claim 4, wherein the character string record includes a spare part. コンピュータを、
1又は複数のバイト配列の文字コードで構成される項目を複数含む文字列レコードで構成されるファイルのレイアウトを示すファイルレイアウト情報に基づいて、前記文字列レコードの項目に対応した型別のコード変換器に設定情報を設定し、前記文字列レコードの文字コードの変換に係るソースコードを自動生成する生成手段として機能させることを特徴とするプログラム。
Computer
Code conversion according to type corresponding to the item of the character string record, based on file layout information indicating the layout of a file composed of a character string record including a plurality of items composed of one or more byte array character codes A program characterized in that setting information is set in a device and functions as a generating means for automatically generating a source code relating to conversion of a character code of the character string record.
ソースコード生成装置におけるソースコード生成方法であって、
1又は複数のバイト配列の文字コードで構成される項目を複数含む文字列レコードで構成されるファイルのレイアウトを示すファイルレイアウト情報に基づいて、前記文字列レコードの項目に対応した型別のコード変換器に設定情報を設定し、前記文字列レコードの文字コードの変換に係るソースコードを自動生成する生成ステップを有することを特徴とするソースコード生成方法。
A source code generation method in a source code generation device,
Code conversion according to type corresponding to the item of the character string record, based on file layout information indicating the layout of a file composed of a character string record including a plurality of items composed of one or more byte array character codes A source code generation method comprising: a generation step of setting setting information in a device and automatically generating a source code related to conversion of a character code of the character string record.
JP2009068546A 2009-03-19 2009-03-19 Source code generation device, program and source code generation method Pending JP2010224656A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009068546A JP2010224656A (en) 2009-03-19 2009-03-19 Source code generation device, program and source code generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009068546A JP2010224656A (en) 2009-03-19 2009-03-19 Source code generation device, program and source code generation method

Publications (1)

Publication Number Publication Date
JP2010224656A true JP2010224656A (en) 2010-10-07

Family

ID=43041807

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009068546A Pending JP2010224656A (en) 2009-03-19 2009-03-19 Source code generation device, program and source code generation method

Country Status (1)

Country Link
JP (1) JP2010224656A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016031959A1 (en) * 2014-08-29 2016-03-03 株式会社日立公共システム Migration support device
WO2016121509A1 (en) * 2015-01-28 2016-08-04 株式会社日立公共システム Information processing device and information processing method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07334399A (en) * 1994-06-13 1995-12-22 Nec Corp Code conversion system for fixed length record
JPH096588A (en) * 1995-06-19 1997-01-10 Mitsubishi Electric Corp Data conversion processing system
JP2002351706A (en) * 2001-05-22 2002-12-06 Ntt Comware Corp Method/program for presenting binary file and recording medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07334399A (en) * 1994-06-13 1995-12-22 Nec Corp Code conversion system for fixed length record
JPH096588A (en) * 1995-06-19 1997-01-10 Mitsubishi Electric Corp Data conversion processing system
JP2002351706A (en) * 2001-05-22 2002-12-06 Ntt Comware Corp Method/program for presenting binary file and recording medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CSND200001392009; 出井一: 'インターネットツールコレクション98' internet ASCII 第3巻、第8号, 19980801, p.303, 株式会社アスキー *
CSND200601284011; 矢嶋聡: 'データ入出力に欠かせないストリームの使い方を覚える' 日経ソフトウエア 第9巻、第8号, 20060624, pp.122-130, 日経BP社 *
JPN6012039109; 出井一: 'インターネットツールコレクション98' internet ASCII 第3巻、第8号, 19980801, p.303, 株式会社アスキー *
JPN6013009593; 矢嶋聡: 'データ入出力に欠かせないストリームの使い方を覚える' 日経ソフトウエア 第9巻、第8号, 20060624, pp.122-130, 日経BP社 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016031959A1 (en) * 2014-08-29 2016-03-03 株式会社日立公共システム Migration support device
JP2016051235A (en) * 2014-08-29 2016-04-11 株式会社日立公共システム Migration support system
WO2016121509A1 (en) * 2015-01-28 2016-08-04 株式会社日立公共システム Information processing device and information processing method
JP2016139294A (en) * 2015-01-28 2016-08-04 株式会社日立公共システム Information processor, and information processing method
CN107209672A (en) * 2015-01-28 2017-09-26 日立公共系统有限公司 Information processor and information processing method

Similar Documents

Publication Publication Date Title
Kohonen et al. LVQ PAK: The learning vector quantization program package
US8245203B2 (en) Logging system and method for computer software
US8521756B2 (en) Data converting apparatus, method, and computer product
CN106874244B (en) Method for constructing automatic document generation model based on work sequence
JP2005115931A (en) Computer-aided query to task mapping
CN1672150A (en) Views for software atomization
KR20060093018A (en) Relationship modeling
CN101553779B (en) Migration apparatus which convert application program of mainframe system into application program of open system and method for thereof
CN1829987A (en) Term database extension for label system
CN1826586A (en) Software atomization
US20140074840A1 (en) System and method for classifying data dump data
Zender NCO user’s guide
JP2010224656A (en) Source code generation device, program and source code generation method
CN103886095B (en) Cross-platform file destination multiplexing method
CN104412255A (en) Document processing system, electronic document, document processing method, and program
JP6209901B2 (en) Character data processing method, program, and information processing apparatus
Liu et al. MatrixConverter: Facilitating construction of phenomic character matrices
JP6491438B2 (en) Migration support device
CN101553800B (en) Migration apparatus which convert SAM/VSAM files of mainframe system into SAM/VSAM files of open system and method for thereof
JP3994854B2 (en) Data mapping rule reuse device, method, and program in electronic catalog conversion system
US9128807B2 (en) Module structural analysis supporting device and program
JP2011154495A (en) Character code conversion device, character code conversion method and character code conversion program
KR100846203B1 (en) Method for generating mobile application and record media recorded program for realizing the same
JPH11353164A (en) System and method for source program generation, and system and method for chart generation
US9792197B2 (en) Apparatus and program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120329

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120410

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120525

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120731

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121001

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130305