JP6458196B1 - Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method - Google Patents

Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method Download PDF

Info

Publication number
JP6458196B1
JP6458196B1 JP2018181138A JP2018181138A JP6458196B1 JP 6458196 B1 JP6458196 B1 JP 6458196B1 JP 2018181138 A JP2018181138 A JP 2018181138A JP 2018181138 A JP2018181138 A JP 2018181138A JP 6458196 B1 JP6458196 B1 JP 6458196B1
Authority
JP
Japan
Prior art keywords
instance
program
source program
cache
data
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.)
Active
Application number
JP2018181138A
Other languages
Japanese (ja)
Other versions
JP2020052707A (en
Inventor
宏樹 熊谷
宏樹 熊谷
敦詞 奥
敦詞 奥
俊郎 宮崎
俊郎 宮崎
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.)
TIS Inc
Original Assignee
TIS Inc
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 TIS Inc filed Critical TIS Inc
Priority to JP2018181138A priority Critical patent/JP6458196B1/en
Application granted granted Critical
Publication of JP6458196B1 publication Critical patent/JP6458196B1/en
Publication of JP2020052707A publication Critical patent/JP2020052707A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

【課題】サブプログラム呼び出しに関するCOBOLの言語仕様を再現する。【解決手段】プログラム変換システムは、COBOLソースプログラムのデータ部におけるデータ定義を順次読み込むデータ定義読み取り部と、データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力するデータ定義コード出力部と、データ定義が、初期値が設定されているデータ項目を含む場合、クラスにおいてデータ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力する初期化メソッド出力部と、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する初期化属性出力部と、を備える。【選択図】図6A COBOL language specification for calling a subprogram is reproduced. A program conversion system outputs a data definition reading unit that sequentially reads data definitions in a data unit of a COBOL source program, and a source code for generating an instance of a class for realizing the data definition in a Java source program If the data definition code output part and the data definition include the data item for which the initial value is set, the first source code for calling the method for initializing the data item to the initial value in the class is output. And an initialization attribute output unit that outputs a second source code of a method for outputting information indicating whether or not the COBOL source program has an initialization attribute. [Selection] Figure 6

Description

本発明は、プログラム変換システム、変換プログラム実行システム、情報処理システム、プログラム変換方法、変換プログラム実行方法、及び情報処理方法に関する。   The present invention relates to a program conversion system, a conversion program execution system, an information processing system, a program conversion method, a conversion program execution method, and an information processing method.

基幹システムのオープン化に伴い、COBOLソースプログラムのJava(登録商標)ソースプログラムへの変換が注目されている。例えば、特許文献1には、COBOLソースプログラムから変換されたJavaソースプログラムの実行時における、集団項目単位でのデータ転送の処理コストを削減する手法が開示されている。   With the opening of the core system, attention is focused on conversion of a COBOL source program into a Java (registered trademark) source program. For example, Patent Document 1 discloses a technique for reducing the processing cost of data transfer in units of group items when executing a Java source program converted from a COBOL source program.

特開2016−115070号公報JP 2016-1115070 A

ところで、COBOLの言語仕様では、実行時に最初に起動されるプログラム(メインプログラム)及びCALL文で呼び出されるサブプログラムの集合を実行単位とした場合、各サブプログラムは、実行単位内で最初に呼び出された時に、当該サブプログラムの初期化処理が行われる。初期化処理では、WORKING−STORAGE SECTION(作業場所節)で定義されたデータ項目が初期化される。すなわち、VALUE句が指定されたデータ項目は、当該VALUE句の値で初期化される。   By the way, in the COBOL language specification, when the execution unit is a set of a program (main program) that is first activated at the time of execution and a subprogram called by a CALL statement, each subprogram is called first in the execution unit. At that time, initialization processing of the subprogram is performed. In the initialization process, data items defined in WORKING-STORAGE SECTION (working place section) are initialized. That is, the data item in which the VALUE phrase is specified is initialized with the value of the VALUE phrase.

そして、実行単位内におけるサブプログラムの2回目以降の呼び出し時には、WORKING−STORAGE SECTIONで定義されたデータ項目は初期化されず、直前の状態を引き継ぐこととなる。ただし、実行単位内における2回目以降の呼び出し時であっても、サブプログラムの見出し部にINITIAL句が指定されている場合、又はサブプログラムを指定したCANCEL文が実行されている場合には、WORKING−STORAGE SECTIONで定義されたデータ項目が初期化される。   When the subprogram is called for the second time or later in the execution unit, the data item defined by the WORKING-STORE SECTION is not initialized, and the previous state is taken over. However, even at the second and subsequent calls in the execution unit, if the INITIAL phrase is specified in the header part of the subprogram, or if the CANCEL statement specifying the subprogram is being executed, WORKING -The data item defined by the STORAGE SECTION is initialized.

COBOLソースプログラムから変換されたJavaソースプログラムを実行する際には、COBOLの上記言語仕様を再現することが求められる。   When executing a Java source program converted from a COBOL source program, it is required to reproduce the language specification of COBOL.

本発明はこのような事情に鑑みてなされたものであり、COBOLソースプログラムから変換されたJavaソースプログラムを実行するシステムにおいて、サブプログラム呼び出しに関するCOBOLの言語仕様を再現することを目的とする。   The present invention has been made in view of such circumstances, and an object of the present invention is to reproduce COBOL language specifications related to subprogram calls in a system that executes a Java source program converted from a COBOL source program.

本発明の一側面に係るプログラム変換システムは、COBOLソースプログラムのデータ部におけるデータ定義を順次読み込むデータ定義読み取り部と、データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力するデータ定義コード出力部と、データ定義が、初期値が設定されているデータ項目を含む場合、クラスにおいてデータ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力する初期化メソッド出力部と、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する初期化属性出力部と、を備える。   A program conversion system according to one aspect of the present invention includes a data definition reading unit that sequentially reads data definitions in a data portion of a COBOL source program, and a source for generating an instance of a class for realizing the data definition in a Java source program A data definition code output unit for outputting a code and a first source for calling a method for initializing a data item to an initial value in a class when the data definition includes a data item for which an initial value is set An initialization method output unit that outputs a code, and an initialization attribute output unit that outputs a second source code of a method for outputting information indicating whether or not the COBOL source program has an initialization attribute.

また、本発明の一側面に係る変換プログラム実行システムは、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持するインスタンスキャッシュ部と、CALL文から変換された第1の命令が実行されると、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスが、キャッシュに存在しない場合は、当該インスタンスを新たに生成し、キャッシュに存在する場合は、第2のソースコードの実行結果に基づいて、COBOLソースプログラムが、初期化属性を有する場合は、第1のソースコードを実行することによりデータ項目の初期化を行ったうえで、キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合はデータ項目の初期化を行わずにキャッシュ内の当該インスタンスを再利用するインスタンス管理部と、を備える。   In addition, a conversion program execution system according to one aspect of the present invention includes an instance cache unit that holds a cache of an instance of a class of a Java source program corresponding to a subprogram called by a CALL statement in a COBOL source program, and a conversion from the CALL statement When the generated first instruction is executed, if an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, the instance is newly generated. If the instance exists in the cache, the second is generated. If the COBOL source program has an initialization attribute based on the execution result of the source code, the data item is initialized by executing the first source code, and then the instance in the cache is Reuse and initialize genus If no comprises, and an instance manager to reuse the instances in the cache without initializing the data item.

また、本発明の一側面に係る情報処理システムは、COBOLソースプログラムのデータ部におけるデータ定義を順次読み込むデータ定義読み取り部と、データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力するデータ定義コード出力部と、データ定義が、初期値が設定されているデータ項目を含む場合、クラスにおいてデータ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力する初期化メソッド出力部と、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する初期化属性出力部と、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持するインスタンスキャッシュ部と、CALL文から変換された第1の命令が実行されると、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスが、キャッシュに存在しない場合は、当該インスタンスを新たに生成し、キャッシュに存在する場合は、第2のソースコードの実行結果に基づいて、COBOLソースプログラムが、初期化属性を有する場合は、第1のソースコードを実行することによりデータ項目の初期化を行ったうえで、キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合はデータ項目の初期化を行わずにキャッシュ内の当該インスタンスを再利用するインスタンス管理部と、を備える。   An information processing system according to an aspect of the present invention generates a data definition reading unit that sequentially reads data definitions in a data portion of a COBOL source program, and an instance of a class for realizing the data definition in a Java source program. A data definition code output section for outputting the source code of the first and a first for calling a method for initializing the data item to the initial value in the class when the data definition includes a data item for which the initial value is set An initialization method output unit for outputting a source code of the COBOL, an initialization attribute output unit for outputting a second source code of a method for outputting information indicating whether or not the COBOL source program has an initialization attribute, and COBOL A subroutine called by a CALL statement in the source program When the instance cache unit that holds the cache of the instance of the class of the Java source program corresponding to Gram and the first instruction converted from the CALL statement are executed, the instance of the class of the Java source program corresponding to the subprogram is obtained. If the COBOL source program has an initialization attribute based on the execution result of the second source code, the instance is newly generated when the COBOL source program does not exist in the cache. After initializing the data item by executing the source code, the instance in the cache is reused, and if there is no initialization attribute, the data item is not initialized and the cached item is not initialized. An instance management unit for reusing the instance.

また、本発明の一側面に係るプログラム変換方法は、コンピュータが、COBOLソースプログラムのデータ部におけるデータ定義を順次読み込み、データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力し、データ定義が、初期値が設定されているデータ項目を含む場合、クラスにおいてデータ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力し、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する。   According to another aspect of the present invention, there is provided a program conversion method in which a computer sequentially reads data definitions in a data portion of a COBOL source program and generates an instance of a class for realizing the data definition in a Java source program. When the code is output and the data definition includes a data item having an initial value set, the first source code for calling a method for initializing the data item to the initial value in the class is output, and COBOL A second source code of a method for outputting information indicating whether the source program has an initialization attribute is output.

また、本発明の一側面に係る変換プログラム実行方法は、プログラム変換方法により出力されたJavaソースプログラムを実行するコンピュータが、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持し、CALL文から変換された第1の命令が実行されると、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスが、キャッシュに存在しない場合は、当該インスタンスを新たに生成し、キャッシュに存在する場合は、第2のソースコードの実行結果に基づいて、COBOLソースプログラムが、初期化属性を有する場合は、第1のソースコードを実行することによりデータ項目の初期化を行ったうえで、キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合はデータ項目の初期化を行わずにキャッシュ内の当該インスタンスを再利用する。   According to another aspect of the present invention, there is provided a conversion program execution method comprising: a Java source program class corresponding to a subprogram called by a CALL statement in a COBOL source program by a computer executing the Java source program output by the program conversion method; When the first instruction converted from the CALL statement is executed and the instance of the Java source program class corresponding to the subprogram does not exist in the cache, the instance is newly added. If the COBOL source program has an initialization attribute based on the execution result of the second source code if it is generated and exists in the cache, the data item is initialized by executing the first source code if it has the initialization attribute After doing Reusing the instances in the cache, if no initialization attribute reuses the instance in the cache without initializing the data item.

また、本発明の一側面に係る情報処理方法は、COBOLソースプログラムのデータ部におけるデータ定義を順次読み込み、データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力し、データ定義が、初期値が設定されているデータ項目を含む場合、クラスにおいてデータ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力し、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力し、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持し、CALL文から変換された第1の命令が実行されると、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスが、キャッシュに存在しない場合は、当該インスタンスを新たに生成し、キャッシュに存在する場合は、第2のソースコードの実行結果に基づいて、COBOLソースプログラムが、初期化属性を有する場合は、第1のソースコードを実行することによりデータ項目の初期化を行ったうえで、キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合はデータ項目の初期化を行わずにキャッシュ内の当該インスタンスを再利用する。   Also, an information processing method according to one aspect of the present invention sequentially reads data definitions in the data part of a COBOL source program, and outputs source code for generating an instance of a class for realizing the data definition in a Java source program. If the data definition includes a data item for which an initial value is set, the first source code for calling a method for initializing the data item to the initial value in the class is output, and the COBOL source program A second source code of a method for outputting information indicating whether or not it has an initialization attribute is output, and an instance cache of a Java source program class corresponding to a subprogram called by a CALL statement in a COBOL source program is stored. Hold and CALL statement When the converted first instruction is executed, if an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, the instance is newly generated. If the instance exists in the cache, If the COBOL source program has an initialization attribute based on the execution result of the second source code, the data item is initialized by executing the first source code, and then the data item in the cache is If the instance is reused and does not have the initialization attribute, the instance in the cache is reused without initializing the data item.

なお、本発明において、「部」とは、単に物理的手段を意味するものではなく、その「部」が有する機能をソフトウェアによって実現する場合も含む。また、1つの「部」や装置が有する機能が2つ以上の物理的手段や装置により実現されても、2つ以上の「部」や装置の機能が1つの物理的手段や装置により実現されてもよい。   In the present invention, the “part” does not simply mean a physical means, but includes a case where the function of the “part” is realized by software. Also, even if the functions of one “unit” or device are realized by two or more physical means or devices, the functions of two or more “units” or devices are realized by one physical means or device. May be.

本発明によれば、COBOLソースプログラムから変換されたJavaソースプログラムを実行するシステムにおいて、サブプログラム呼び出しに関するCOBOLの言語仕様を再現することが可能となる。   According to the present invention, in a system that executes a Java source program converted from a COBOL source program, it is possible to reproduce the COBOL language specifications related to subprogram calls.

プログラム変換が行われるシステム全体の概略を示す図である。It is a figure which shows the outline of the whole system in which program conversion is performed. プログラム変換システム100が備える機能の一例を示すブロック図である。It is a block diagram which shows an example of the function with which the program conversion system 100 is provided. 変換プログラム実行システム120が備える機能の一例を示すブロック図である。It is a block diagram which shows an example of the function with which the conversion program execution system 120 is provided. プログラム変換システム100におけるデータ型の変換規則の一例を示す図である。It is a figure which shows an example of the conversion rule of the data type in the program conversion system. 図4に示した変換規則に基づいてCOBOLのデータ定義を変換した一例を示す図である。FIG. 5 is a diagram illustrating an example in which a COBOL data definition is converted based on the conversion rule shown in FIG. 4. COBOLのデータ定義の変換処理の一例を示すフローチャートである。10 is a flowchart illustrating an example of a conversion process of a COBOL data definition. 変換処理において出力されるコードの一例を示す図である。It is a figure which shows an example of the code output in a conversion process. COBOLソースプログラムからJavaソースプログラムへの変換の一例を示す図である。It is a figure which shows an example of the conversion from a COBOL source program to a Java source program. COBOLソースプログラムからJavaソースプログラムへの変換の一例を示す図である。It is a figure which shows an example of the conversion from a COBOL source program to a Java source program. COBOLにおけるサブプログラム(モジュール)の呼び出しの一例を示す図である。It is a figure which shows an example of the call of the subprogram (module) in COBOL. CALL文を含むCOBOLソースプログラムのJavaソースプログラムへの変換の一例を示す図である。It is a figure which shows an example of conversion to the Java source program of the COBOL source program containing a CALL sentence. サブプログラムを呼び出すCOBOLソースプログラムを変換したJavaソースプログラムを実行するための機構の一例を示す図である。It is a figure which shows an example of the mechanism for performing the Java source program which converted the COBOL source program which calls a subprogram. サブプログラムに対応するインスタンスを再利用する処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process which reuses the instance corresponding to a subprogram.

以下、図面を参照して本発明の一実施形態について説明する。図1は、プログラム変換が行われるシステム全体の概略を示す図である。本システムでは、プログラム変換システム100により、ホストコンピュータ110で稼働するプログラムが、変換プログラム実行システム120で稼働するプログラムに変換される。具体的には、ホストコンピュータ110では、COBOLプログラム130が動作している。プログラム変換システム100は、COBOLプログラム130のソースコードであるCOBOLソースプログラム140をJavaソースプログラム150に変換する。Javaソースプログラム150は、コンパイルされてJavaバイトコード160となる。そして、Javaバイトコード160は、変換プログラム実行システム120で実行される。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing an outline of the entire system in which program conversion is performed. In this system, the program conversion system 100 converts a program that runs on the host computer 110 into a program that runs on the conversion program execution system 120. Specifically, a COBOL program 130 is running on the host computer 110. The program conversion system 100 converts a COBOL source program 140, which is a source code of the COBOL program 130, into a Java source program 150. The Java source program 150 is compiled into Java byte code 160. The Java byte code 160 is executed by the conversion program execution system 120.

図2は、プログラム変換システム100が備える機能の一例を示すブロック図である。プログラム変換システム100は、変換規則記憶部200、プログラム変換部210、COBOLソースプログラム記憶部220、及びJavaソースプログラム記憶部230を備える。また、プログラム変換部210は、データ定義読み取り部211、項目定義コード出力部212、初期化メソッド出力部213及び初期化属性出力部214を含む。また、項目定義コード出力部212は、集団項目定義コード出力部215、第1の基本項目定義コード出力部216、及び第2の基本項目定義コード出力部217を含む。プログラム変換システム100は、例えば、1台または複数台のコンピュータを用いて構成される。プログラム変換システム100を構成する各部は、例えば、メモリやハードディスク等の記憶領域を用いたり、記憶領域に格納されたプログラムをプロセッサが実行したりすることにより実現される。   FIG. 2 is a block diagram illustrating an example of functions provided in the program conversion system 100. The program conversion system 100 includes a conversion rule storage unit 200, a program conversion unit 210, a COBOL source program storage unit 220, and a Java source program storage unit 230. The program conversion unit 210 includes a data definition reading unit 211, an item definition code output unit 212, an initialization method output unit 213, and an initialization attribute output unit 214. The item definition code output unit 212 includes a group item definition code output unit 215, a first basic item definition code output unit 216, and a second basic item definition code output unit 217. The program conversion system 100 is configured using, for example, one or a plurality of computers. Each unit constituting the program conversion system 100 is realized, for example, by using a storage area such as a memory or a hard disk, or by a processor executing a program stored in the storage area.

変換規則記憶部200は、COBOLソースプログラムをJavaソースプログラムに変換するための変換規則を記憶する。   The conversion rule storage unit 200 stores a conversion rule for converting a COBOL source program into a Java source program.

プログラム変換部210は、変換規則に基づいて、COBOLソースプログラムをJavaソースプログラムに変換する。   The program conversion unit 210 converts the COBOL source program into a Java source program based on the conversion rule.

データ定義読み取り部211は、COBOLソースプログラムのDATA DIVISION(データ部)におけるWORKING−STORAGE SECTION(作業場所節)の変換のために、WORKING−STORAGE SECTIONにおけるデータ定義を順次読み込む。   The data definition reading unit 211 sequentially reads the data definitions in the WORKING-STORAGE SECTION for conversion of the WORKING-STORAGE SECTION (working place section) in the DATA DIVISION (data unit) of the COBOL source program.

データ定義コード出力部212は、データ定義読み取り部212が読み込んだデータ定義をJavaソースプログラムにおいて実現するためのソースコードを出力する。   The data definition code output unit 212 outputs a source code for realizing the data definition read by the data definition reading unit 212 in the Java source program.

集団項目定義コード出力部215は、COBOLソースプログラムにおけるデータ定義が集団項目の定義である場合、Javaソースプログラムにおいて当該集団項目を実現するためのクラス(CGrp)のインスタンスを生成するソースコードを出力する。   When the data definition in the COBOL source program is a definition of a group item, the group item definition code output unit 215 outputs a source code that generates an instance of a class (CGrp) for realizing the group item in the Java source program. .

第1の基本項目定義コード出力部216は、COBOLソースプログラムにおけるデータ定義が基本項目の定義であり、かつ、レベルが最上位(例えば「01」)である場合、Javaソースプログラムにおいて当該基本項目を実現するためのクラス(Javaラッパークラス)のインスタンスを生成するソースコードを出力する。   When the data definition in the COBOL source program is the definition of the basic item and the level is the highest level (for example, “01”), the first basic item definition code output unit 216 displays the basic item in the Java source program. A source code for generating an instance of a class (Java wrapper class) to be realized is output.

第2の基本項目定義コード出力部217は、COBOLソースプログラムにおけるデータ定義が基本項目の定義であり、かつ、レベルが最上位でない場合、当該基本項目を、集団項目を実現するためのクラス(CGrp)のメンバ変数とするソースコードを出力する。   When the data definition in the COBOL source program is the definition of the basic item and the level is not the highest level, the second basic item definition code output unit 217 sets the basic item as a class (CGrp) for realizing the group item. ) Is output as a member variable.

なお、集団項目を実現するためのクラス(CGrp)及び基本項目を実現するためのクラス(Javaラッパークラス)には、データ項目を初期値に初期化するメソッド(resetForReuse)が実装されている。   Note that a method (resetForReuse) that initializes data items to initial values is implemented in a class (CGrp) for realizing group items and a class (Java wrapper class) for realizing basic items.

データ定義読み取り部211及びデータ定義コード出力部212の詳細については、具体例を用いて後述する。   Details of the data definition reading unit 211 and the data definition code output unit 212 will be described later using a specific example.

初期化メソッド出力部213は、COBOLソースプログラムのデータ定義において初期値が設定されているデータ項目が存在する場合に、当該データ項目を実現するクラスにおいてデータ項目を初期値に初期化するメソッド(resetForReuse)を呼び出すためのメソッド(resetForReuse)のソースコードを出力する。   When there is a data item for which an initial value is set in the data definition of the COBOL source program, the initialization method output unit 213 initializes the data item to the initial value in the class that realizes the data item (resetForReuse). ) For calling the method (resetForReuse).

初期化属性出力部214は、COBOLソースプログラムが初期化属性を有するかどうかを判定する。具体的には、初期化属性出力部214は、COBOLソースプログラムの見出し部において、INITIAL句が指定されているかどうかを判定する。COBOLの言語仕様では、初期化属性を有する(INITIAL句が指定されている)プログラムは、呼び出されるたびに変数の初期化が行われる。初期化属性出力部214は、COBOLソースプログラムから変換されたJavaソースプログラムにおいて、初期化属性の有無を判断可能とするための情報を出力する。具体的には、初期化属性出力部214は、初期化属性の有無を示す情報を出力するためのメソッド(isInitial)のソースコードを出力する。   The initialization attribute output unit 214 determines whether or not the COBOL source program has an initialization attribute. Specifically, the initialization attribute output unit 214 determines whether or not the INITIAL phrase is specified in the heading part of the COBOL source program. In the COBOL language specification, a program having an initialization attribute (in which an INITIAL clause is specified) initializes variables each time it is called. The initialization attribute output unit 214 outputs information for making it possible to determine whether or not there is an initialization attribute in the Java source program converted from the COBOL source program. Specifically, the initialization attribute output unit 214 outputs a source code of a method (isInitial) for outputting information indicating the presence / absence of the initialization attribute.

COBOLソースプログラム記憶部220は、変換前のCOBOLソースプログラムを記憶する。   The COBOL source program storage unit 220 stores a COBOL source program before conversion.

Javaソースプログラム記憶部230は、変換後のJavaソースプログラムを記憶する。   The Java source program storage unit 230 stores the Java source program after conversion.

図3は、変換プログラム実行システム120が備える機能の一例を示すブロック図である。変換プログラム実行システム120は、JavaVM実行部300、Javaバイトコード記憶部310、及びプログラム実行部320を含む。また、プログラム実行部320は、インスタンスキャッシュ部321及びインスタンス管理部322を含む。変換プログラム実行システム120は、例えば、1台または複数台のコンピュータを用いて構成される。変換プログラム実行システム120を構成する各部は、例えば、メモリやハードディスク等の記憶領域を用いたり、記憶領域に格納されたプログラムをプロセッサが実行したりすることにより実現される。   FIG. 3 is a block diagram illustrating an example of functions provided in the conversion program execution system 120. The conversion program execution system 120 includes a Java VM execution unit 300, a Java bytecode storage unit 310, and a program execution unit 320. The program execution unit 320 includes an instance cache unit 321 and an instance management unit 322. The conversion program execution system 120 is configured using, for example, one or a plurality of computers. Each unit constituting the conversion program execution system 120 is realized, for example, by using a storage area such as a memory or a hard disk, or by executing a program stored in the storage area.

JavaVM実行部300は、Javaバイトコードを実行するためのプラットフォームであるJavaVMを実行する。   The JavaVM execution unit 300 executes JavaVM, which is a platform for executing Java bytecode.

Javaバイトコード記憶部310は、変換されたJavaソースプログラムをコンパイルしたJavaバイトコードを記憶する。   The Java byte code storage unit 310 stores a Java byte code obtained by compiling the converted Java source program.

プログラム実行部320は、Javaバイトコードを実行する。プログラム実行部320は、Javaバイトコードを実行するための各種ライブラリ(クラスライブラリ等)を含む。   The program execution unit 320 executes Java bytecode. The program execution unit 320 includes various libraries (class library or the like) for executing Java bytecode.

インスタンスキャッシュ部321は、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応する、Javaのインスタンスのキャッシュを保持する。   The instance cache unit 321 holds a Java instance cache corresponding to a subprogram called by a CALL statement in the COBOL source program.

インスタンス管理部322は、サブプログラムを呼び出すCALL文から変換された命令が実行されると、当該サブプログラムに対応するインスタンスが、キャッシュに存在しない場合は、当該インスタンスを新たに生成し、キャッシュに存在する場合は、キャッシュ内の当該インスタンスを再利用する。   When an instruction converted from a CALL statement that calls a subprogram is executed, if the instance corresponding to the subprogram does not exist in the cache, the instance management unit 322 newly creates the instance and exists in the cache If so, reuse the instance in the cache.

インスタンスキャッシュ部321及びインスタンス管理部322の詳細については、具体例を用いて後述する。   Details of the instance cache unit 321 and the instance management unit 322 will be described later using a specific example.

図4は、プログラム変換システム100におけるデータ型の変換規則の一例を示す図である。図4において、左側の欄には、COBOLのデータ型が示されており、右側の欄には、COBOLのデータ型と同等の機能を実現するためのJavaラッパークラスが示されている。例えば、1〜9桁の符号無し整数(PIC 9(1)〜PIC 9(9))は、CIntというJavaラッパークラスに変換される。   FIG. 4 is a diagram illustrating an example of a data type conversion rule in the program conversion system 100. In FIG. 4, the left column shows the COBOL data type, and the right column shows the Java wrapper class for realizing the same function as the COBOL data type. For example, an unsigned integer of 1 to 9 digits (PIC 9 (1) to PIC 9 (9)) is converted into a Java wrapper class called CInt.

図5は、図4に示した変換規則に基づいてCOBOLのデータ定義を変換した一例を示す図である。例えば、COBOLでは、「01 NUM01 PIC S9(003) COMP−3 VALUE 060.」により、符号付きパック形式の3桁の整数(初期値「60」)として、変数「NUM01」が定義されている。この定義をJavaに変換したものが、「public CInt NUM01=new CInt(3, S, COMP3).VALUE(60);」である。ここで、CIntの引数(3, S, COMP3)は、順に、桁数、符号付き、パック形式を表している。また、CIntのメソッドVALUE(60)は、変数NUM01に初期値「60」をセットするものである。   FIG. 5 is a diagram showing an example of converting the COBOL data definition based on the conversion rule shown in FIG. For example, in COBOL, “01 NUM01 PIC S9 (003) COMP-3 VALUE 060.” defines a variable “NUM01” as a three-digit integer (initial value “60”) in a signed pack format. This definition is converted to Java as “public CInt NUM01 = new CInt (3, S, COMP3) .VALUE (60);”. Here, the arguments (3, S, COMP3) of CInt represent the number of digits, a signed code, and a pack format in this order. The CINT method VALUE (60) sets the initial value “60” to the variable NUM01.

図6は、COBOLのデータ定義の変換処理の一例を示すフローチャートである。図7は、変換処理において出力されるコードの一例を示す図である。図8A及び図8Bは、COBOLソースプログラムからJavaソースプログラムへの変換の一例を示す図である。図7、図8A及び図8Bを参照しつつ、図6の処理について説明する。   FIG. 6 is a flowchart illustrating an example of the conversion processing of the COBOL data definition. FIG. 7 is a diagram illustrating an example of a code output in the conversion process. 8A and 8B are diagrams showing an example of conversion from a COBOL source program to a Java source program. The process of FIG. 6 will be described with reference to FIGS. 7, 8A, and 8B.

まず、データ定義読み取り部211は、COBOLソースプログラムのデータ部におけるデータ定義を1行読み込む(S601)。   First, the data definition reading unit 211 reads one line of the data definition in the data part of the COBOL source program (S601).

データ定義が終了でない場合(S602:N)、集団項目定義コード出力部215は、データ定義が集団項目の定義であるかどうか確認する(S603)。集団項目の定義である場合(S603:Y)、集団項目定義コード出力部215は、集団項目用のラッパークラスCGrpを継承したクラスとして、当該集団項目を定義するソースコードを出力する(S604)。例えば、図7(a)には、集団項目GRP1を定義するソースコードの一例が示されている。具体的には、クラスCGrpを継承したクラスとしてCGRP1が定義され、当該CGRP1のオブジェクトとして、GRP1が定義されている。   If the data definition is not complete (S602: N), the group item definition code output unit 215 checks whether the data definition is a group item definition (S603). If the definition is a group item definition (S603: Y), the group item definition code output unit 215 outputs the source code defining the group item as a class inheriting the wrapper class CGrp for the group item (S604). For example, FIG. 7A shows an example of source code for defining the group item GRP1. Specifically, CGRP1 is defined as a class that inherits the class CGRP, and GRP1 is defined as an object of the CGRP1.

集団項目の定義ではない(即ち、基本項目である)場合(S603:N)、第1の基本項目定義コード出力部216は、データ定義がレベル01であるかどうか確認する(S605)。レベル01である場合(S605:Y)、基本項目用のラッパークラスのオブジェクトとして当該基本項目を定義するソースコードを出力する(S606)。例えば、図7(b)には、基本項目IDX1を定義するソースコードの一例が示されている。具体的には、クラスCIntのオブジェクトとして、IDX1が定義されている。   If the definition is not a group item definition (that is, a basic item) (S603: N), the first basic item definition code output unit 216 checks whether the data definition is level 01 (S605). If the level is 01 (S605: Y), the source code defining the basic item is output as an object of the wrapper class for the basic item (S606). For example, FIG. 7B shows an example of source code defining the basic item IDX1. Specifically, IDX1 is defined as an object of class CInt.

基本項目であり(S603:N)、かつ、レベル01でない場合(S605:N)、第2の基本項目定義コード出力部217は、当該基本項目を、当該基本項目が属する集団項目のクラスのメンバ変数として定義するソースコードを出力する(S607)。例えば、図7(c)には、集団項目GRP1に属する基本項目GRP1_IDX1を定義するソースコードの一例が示されている。ここで、図7(c)に示すソースコードは、図7(a)に示すソースコードに、クラスCGRP1のメンバ変数として追加される。   If it is a basic item (S603: N) and is not level 01 (S605: N), the second basic item definition code output unit 217 sets the basic item as a member of the class of the group item to which the basic item belongs. Source code defined as a variable is output (S607). For example, FIG. 7C shows an example of source code that defines the basic item GRP1_IDX1 belonging to the group item GRP1. Here, the source code shown in FIG. 7C is added as a member variable of the class CGRP1 to the source code shown in FIG.

データ定義が終了すると(S602:Y)、初期化メソッド出力部213は、COBOLソースプログラムのデータ定義において初期値が設定されているデータ項目が存在する場合に、当該データ項目を実現するクラスにおいてデータ項目を初期値に初期化するメソッドを呼び出すためのメソッドのソースコードを出力する(S608)。   When the data definition is completed (S602: Y), the initialization method output unit 213 receives data in a class that realizes the data item when an initial value is set in the data definition of the COBOL source program. A source code of a method for calling a method for initializing an item to an initial value is output (S608).

また、初期化属性出力部214は、COBOLソースプログラムにおける初期化属性の有無を示す情報を出力するためのメソッドのソースコードを出力する(S609)。   Further, the initialization attribute output unit 214 outputs a source code of a method for outputting information indicating the presence / absence of the initialization attribute in the COBOL source program (S609).

図8A及び図8Bには、図6に示した処理による変換の一例が示されている。ここで、図8Aは、変換元のCOBOLソースプログラムの一例、図8Bは、変換後のJavaソースプログラムの一例を示している。図8Bに示すように、集団項目GRP1は、クラスCGrpを継承したクラスCGRP1のオブジェクトとして定義されている。そして、集団項目GRP1に属する基本項目GRP1_IDX1,GRP1_IDX2,GRP1_IDS1は、クラスCGRP1のメンバ変数として定義されている。また、集団項目に属しない基本項目IDX1は、クラスCIntのオブジェクトとして定義されている。   8A and 8B show an example of conversion by the process shown in FIG. Here, FIG. 8A shows an example of the conversion source COBOL source program, and FIG. 8B shows an example of the converted Java source program. As shown in FIG. 8B, the group item GRP1 is defined as an object of the class CGRP1 that inherits the class CGRP. The basic items GRP1_IDX1, GRP1_IDX2, and GRP1_IDS1 belonging to the group item GRP1 are defined as member variables of the class CGRP1. The basic item IDX1 that does not belong to the group item is defined as an object of class CInt.

また、図8Aに示すCOBOLソースプログラムでは、集団項目GRP1に属する基本項目GPR1_IDS1は、初期値’00’が設定されている。また、集団項目に属しない基本項目IDS1は、初期値’99’が設定されている。これに対応して、図8Bに示すように、集団項目GRP1を実現するクラスにおいてデータ項目を初期値に初期化するためのメソッド(GRP1.resetForReuse())及び基本項目IDS1を実現するクラスにおいてデータ項目を初期値に初期化するためのメソッド(IDS1.resetForReuse())を呼び出すためのメソッド(resetForReuse())のソースコードが出力されている。   In the COBOL source program shown in FIG. 8A, an initial value “00” is set in the basic item GPR1_IDS1 belonging to the group item GRP1. The basic item IDS1 that does not belong to the group item is set to an initial value “99”. Correspondingly, as shown in FIG. 8B, a method (GRP1.resetForReuse ()) for initializing data items in the class that realizes the group item GRP1 and data in the class that realizes the basic item IDS1 Source code of a method (resetForReuse ()) for calling a method (IDS1.resetForReuse ()) for initializing items to initial values is output.

また、図8Bに示すように、Javaソースプログラムには、初期化属性の有無を示す情報を出力するためのメソッド(isInitial)のソースコードが出力されている。図8Aに示すCOBOLソースプログラムは、見出し部においてINITIAL句が指定されており、初期化属性を有している。そのため、図8Bに示す例では、メソッドisInitialが、初期化属性を有することを示す情報として値trueを返す仕様となっている。初期化属性を有しないCOBOLソースプログラムの場合であれば、これとは異なる値(false)を返せばよい。   As shown in FIG. 8B, a source code of a method (isInitial) for outputting information indicating the presence / absence of an initialization attribute is output to the Java source program. In the COBOL source program shown in FIG. 8A, the INITIAL phrase is specified in the header section and has an initialization attribute. Therefore, in the example shown in FIG. 8B, the method isInitial has a specification that returns a value “true” as information indicating that it has an initialization attribute. In the case of a COBOL source program having no initialization attribute, a different value (false) may be returned.

次に、変換プログラム実行システム120において、サブプログラムを実行する際の処理負荷を軽減する手法について説明する。   Next, a method for reducing the processing load when the subprogram is executed in the conversion program execution system 120 will be described.

図9は、COBOLにおけるサブプログラムの呼び出しの一例を示す図である。図9に示すように、メインプログラム(例えば、プログラムMAIN01)において、CALL文により、サブプログラム(例えば、サブプログラムSUB01)を呼び出すことができる。   FIG. 9 is a diagram illustrating an example of calling a subprogram in COBOL. As shown in FIG. 9, in a main program (for example, program MAIN01), a subprogram (for example, subprogram SUB01) can be called by a CALL statement.

図10は、CALL文を含むCOBOLソースプログラムのJavaソースプログラムへの変換の一例を示す図である。図8Bにも示したように、サブプログラムは、クラスCblSubのオブジェクトとして実現される。   FIG. 10 is a diagram illustrating an example of conversion of a COBOL source program including a CALL sentence into a Java source program. As shown in FIG. 8B, the subprogram is realized as an object of class CblSub.

図11は、サブプログラムを呼び出すCOBOLソースプログラムを変換したJavaソースプログラムを実行するための機構の一例を示す図である。メインプログラム(例えば、プログラムMAIN01)は、クラスCblBaseのインスタンスとして実現されている。サブプログラム(例えば、サブプログラムSUB01)は、サブブログラム名(例えば、「SUB01」)を引数として、クラスFactoryのメソッドcreateを実行することにより呼び出すことができる。   FIG. 11 is a diagram showing an example of a mechanism for executing a Java source program obtained by converting a COBOL source program that calls a subprogram. The main program (for example, the program MAIN01) is realized as an instance of the class CblBase. A subprogram (for example, subprogram SUB01) can be called by executing method create of class Factory with a subprogram name (for example, “SUB01”) as an argument.

サブプログラムは、クラスCblSubのインスタンスとして実現される。サブプログラムのインスタンスは、生成されると、インスタンスキャッシュ部321にキャッシュされる。そして、メソッドcreateによりサブプログラムが呼び出されると、インスタンス管理部322は、当該キャッシュに保持されているインスタンスのリストをサブプログラム名で検索する。呼び出し対象のサブプログラムに対応するインスタンスがキャッシュに存在する場合、インスタンス管理部322は、当該インスタンスを、必要に応じてメンバ変数の値を初期化したうえで再利用する。メンバ変数の初期化については後述する。また、呼び出し対象のサブプログラムに対応するインスタンスがキャッシュに存在しない場合、インスタンス管理部322は、当該インスタンスを新たに生成し、キャッシュに登録する。   The subprogram is realized as an instance of the class CblSub. When the instance of the subprogram is generated, it is cached in the instance cache unit 321. When the subprogram is called by the method create, the instance management unit 322 searches the list of instances held in the cache by the subprogram name. When an instance corresponding to the subprogram to be called exists in the cache, the instance management unit 322 reuses the instance after initializing the value of the member variable as necessary. The initialization of member variables will be described later. Further, when the instance corresponding to the subprogram to be called does not exist in the cache, the instance management unit 322 newly generates the instance and registers it in the cache.

図12は、サブプログラムに対応するインスタンスを再利用する処理の一例を示すフローチャートである。サブプログラムの呼び出しに対応するメソッド(例えば、「Factory.create(“SUB01”)」が実行されると、インスタンス管理部322は、サブプログラムに対応するインスタンスのキャッシュのリストを、指定されたクラス名(例えば、「SUB01」)で検索する(S1201)。   FIG. 12 is a flowchart illustrating an example of processing for reusing an instance corresponding to a subprogram. When a method (for example, “Factory.create (“ SUB01 ”)”) corresponding to the subprogram call is executed, the instance management unit 322 displays a list of caches of instances corresponding to the subprogram with the specified class name. (For example, “SUB01”) (S1201).

リストに存在しない場合(S1202:N)、インスタンス管理部322は、指定されたクラス名(例えば、「SUB01」)でインスタンスを生成する(S1203)。なお、インスタンス生成の際には、COBOLソースプログラムのVALUE句に対応する初期値の設定処理も行われる。そして、インスタンス管理部322は、生成したインスタンスをキャッシュのリストに追加する(S1204)。   If not present in the list (S1202: N), the instance management unit 322 generates an instance with the specified class name (for example, “SUB01”) (S1203). At the time of instance generation, an initial value setting process corresponding to the VALUE phrase of the COBOL source program is also performed. Then, the instance management unit 322 adds the generated instance to the cache list (S1204).

リストに存在する場合(S1202:Y)、インスタンス管理部322は、呼び出されたサブプログラムが、初期化属性を有しているか、またはCANCEL文が事前に実行されているかどうかを確認する(S1205)。なお、初期化属性の有無については、メソッドisInitialを実行することにより確認することができる。また、インスタンスキャッシュ部321は、キャッシュされている各インスタンスについて、CANCEL文が事前に実行されているかどうかを示す情報を記憶しておくことができる。インスタンス管理部322は、当該情報を参照することにより、CANCEL文が事前に実行されているかどうかを確認することができる。   If it exists in the list (S1202: Y), the instance management unit 322 checks whether the called subprogram has an initialization attribute or whether a CANCEL statement has been executed in advance (S1205). . Note that the presence or absence of the initialization attribute can be confirmed by executing the method isInitial. Further, the instance cache unit 321 can store information indicating whether a CANCEL statement has been executed in advance for each cached instance. The instance management unit 322 can check whether the CANCEL statement has been executed in advance by referring to the information.

初期化属性が無く、かつ、CANCEL文が事前に実行されていない場合(S1205:N)、インスタンス管理部322は、初期化処理を行わずにインスタンスを再利用する。他方、初期化属性があるか、またはCANCEL文が事前に実行されている場合(S1205:Y)、インスタンス管理部322は、キャッシュに存在するインスタンスに対してメソッドresetForReuse()を実行し、インスタンスのメンバ変数のデータをCOBOLソースプログラムのVALUE句に対応する初期値に初期化したうえで、インスタンスを再利用する(S1206)。   If there is no initialization attribute and the CANCEL statement has not been executed in advance (S1205: N), the instance management unit 322 reuses the instance without performing initialization processing. On the other hand, if there is an initialization attribute or the CANCEL statement has been executed in advance (S1205: Y), the instance management unit 322 executes the method resetForReuse () for the instance existing in the cache, and The member variable data is initialized to an initial value corresponding to the VALUE clause of the COBOL source program, and the instance is reused (S1206).

このように、変換プログラム実行システム120では、サブプログラムに対応するインスタンスがキャッシュで管理され、再利用される。これにより、COBOLソースプログラムから変換されたJavaソースプログラムを実行するシステムにおいて、サブプログラム呼び出しに関するCOBOLの言語仕様を再現するとともに、サブプログラム呼び出し時の負荷を軽減することが可能となる。   As described above, in the conversion program execution system 120, the instances corresponding to the subprograms are managed in the cache and reused. As a result, in the system that executes the Java source program converted from the COBOL source program, it is possible to reproduce the COBOL language specifications related to the subprogram call and to reduce the load when the subprogram is called.

以上、本発明の一実施形態であるプログラム変換システム100及び変換プログラム実行システム120について説明した。   In the above, the program conversion system 100 and the conversion program execution system 120 which are one Embodiment of this invention were demonstrated.

プログラム変換システム100では、データ定義が、初期値が設定されているデータ項目を含む場合、当該データ項目を初期値に初期化するためのメソッドを呼び出すための第1のソースコードが出力される。さらに、プログラム変換システム100では、COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードが出力される。これにより、COBOLにおけるサブプログラムの初期化に関する言語仕様を再現することが可能となる。   In the program conversion system 100, when the data definition includes a data item for which an initial value is set, a first source code for calling a method for initializing the data item to the initial value is output. Further, the program conversion system 100 outputs a second source code of a method for outputting information indicating whether the COBOL source program has an initialization attribute. As a result, it is possible to reproduce the language specification related to the initialization of the subprogram in COBOL.

また、変換プログラム実行システム120では、COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュが保持される。そして、変換プログラム実行システム120では、CALL文から変換された第1の命令が実行されると、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスがキャッシュに存在しない場合は、当該インスタンスが新たに生成される。他方、キャッシュに存在する場合は、第2のソースコードの実行結果に基づいて、COBOLソースプログラムが、初期化属性を有する場合は、第1のソースコードを実行することによりデータ項目の初期化を行ったうえで、キャッシュ内の当該インスタンスが再利用され、初期化属性を有しない場合はデータ項目の初期化を行わずに当該インスタンスが再利用される。これにより、COBOLにおけるサブプログラムの初期化に関する言語仕様を再現するとともに、プログラム呼び出し時の負荷を軽減することが可能となる。   Further, the conversion program execution system 120 holds a cache of instances of Java source program classes corresponding to subprograms called by CALL statements in the COBOL source program. Then, in the conversion program execution system 120, when the first instruction converted from the CALL statement is executed, if an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, the instance is newly added. Generated. On the other hand, if it exists in the cache, based on the execution result of the second source code, if the COBOL source program has the initialization attribute, the data item is initialized by executing the first source code. After that, the instance in the cache is reused. If the instance does not have the initialization attribute, the instance is reused without initializing the data item. As a result, it is possible to reproduce the language specification related to the initialization of the subprogram in COBOL and reduce the load at the time of calling the program.

さらに、変換プログラム実行システム120では、各インスタンスについて、CANCEL文が事前に呼ばれたかどうかを示す情報が記憶される。そして、変換プログラム実行システム120では、サブプログラムに対応するJavaソースプログラムのクラスのインスタンスがキャッシュに存在する場合は、COBOLソースプログラムが初期化属性を有する場合、または当該インスタンスについてCANCEL文が事前に呼ばれている場合に、データ項目の初期化が行われる。これにより、COBOLにおけるサブプログラムの初期化に関する言語仕様を再現するとともに、プログラム呼び出し時の負荷を軽減することが可能となる。   Further, the conversion program execution system 120 stores information indicating whether a CANCEL statement has been called in advance for each instance. In the conversion program execution system 120, if an instance of the class of the Java source program corresponding to the subprogram exists in the cache, the COBOL source program has the initialization attribute, or the CANCEL statement is called in advance for the instance. If so, the data item is initialized. As a result, it is possible to reproduce the language specification related to the initialization of the subprogram in COBOL and reduce the load at the time of calling the program.

なお、本実施形態は、本発明の理解を容易にするためのものであり、本発明を限定して解釈するためのものではない。本発明は、その趣旨を逸脱することなく、変更/改良され得るととともに、本発明にはその等価物も含まれる。   Note that this embodiment is intended to facilitate understanding of the present invention and is not intended to limit the present invention. The present invention can be changed / improved without departing from the spirit thereof, and the present invention includes equivalents thereof.

100 プログラム変換システム
110 ホストコンピュータ
120 変換プログラム実行システム
130 COBOLプログラム
140 COBOLソースプログラム
150 Javaソースプログラム
160 Javaバイトコード
200 変換規則記憶部
210 プログラム変換部
211 データ定義読み取り部
212 データ定義コード出力部
213 初期化メソッド出力部
214 初期化属性出力部
215 集団項目定義コード出力部
216 第1の基本項目定義コード出力部
217 第2の基本項目定義コード出力部
220 COBOLソースプログラム記憶部
230 Javaソースプログラム記憶部
300 JavaVM実行部
310 Javaバイトコード記憶部
320 プログラム実行部
321 インスタンスキャッシュ部
322 インスタンス管理部
DESCRIPTION OF SYMBOLS 100 Program conversion system 110 Host computer 120 Conversion program execution system 130 COBOL program 140 COBOL source program 150 Java source program 160 Java bytecode 200 Conversion rule memory | storage part 210 Program conversion part 211 Data definition reading part 212 Data definition code output part 213 Initialization Method output unit 214 Initialization attribute output unit 215 Group item definition code output unit 216 First basic item definition code output unit 217 Second basic item definition code output unit 220 COBOL source program storage unit 230 Java source program storage unit 300 JavaVM Execution unit 310 Java bytecode storage unit 320 Program execution unit 321 Instance cache unit 322 IN Chest of drawers management unit

Claims (7)

COBOLソースプログラムのデータ部におけるデータ定義を順次読み込むデータ定義読み取り部と、
前記データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力するデータ定義コード出力部と、
前記データ定義が、初期値が設定されているデータ項目を含む場合、前記クラスにおいて前記データ項目を前記初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力する初期化メソッド出力部と、
前記COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する初期化属性出力部と、
を備えるプログラム変換システム。
A data definition reading section for sequentially reading data definitions in the data section of the COBOL source program;
A data definition code output unit for outputting a source code for generating an instance of a class for realizing the data definition in a Java source program;
When the data definition includes a data item for which an initial value is set, an initialization method for outputting first source code for calling a method for initializing the data item to the initial value in the class An output section;
An initialization attribute output unit for outputting a second source code of a method for outputting information indicating whether the COBOL source program has an initialization attribute;
A program conversion system comprising:
請求項1に記載されたプログラム変換システムから出力されたJavaソースプログラムを実行する変換プログラム実行システムであって、
前記COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持するインスタンスキャッシュ部と、
前記CALL文から変換された第1の命令が実行されると、
前記サブプログラムに対応する前記Javaソースプログラムのクラスのインスタンスが、前記キャッシュに存在しない場合は、当該インスタンスを新たに生成し、
前記キャッシュに存在する場合は、前記第2のソースコードの実行結果に基づいて、前記COBOLソースプログラムが、初期化属性を有する場合は、前記第1のソースコードを実行することにより前記データ項目の初期化を行ったうえで、前記キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合は前記データ項目の初期化を行わずに前記キャッシュ内の当該インスタンスを再利用するインスタンス管理部と、
を備える変換プログラム実行システム。
A conversion program execution system for executing a Java source program output from the program conversion system according to claim 1,
An instance cache unit that holds an instance cache of a Java source program class corresponding to a subprogram called by a CALL statement in the COBOL source program;
When the first instruction converted from the CALL statement is executed,
If an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, a new instance is generated,
If the COBOL source program has an initialization attribute based on the execution result of the second source code if it exists in the cache, the first source code is executed by executing the first source code. An instance management unit that reuses the instance in the cache after initialization and reuses the instance in the cache without initializing the data item if it does not have an initialization attribute When,
A conversion program execution system comprising:
請求項2に記載の変換プログラム実行システムであって、
前記インスタンスキャッシュ部は、各インスタンスについて、CANCEL文が事前に呼ばれたかどうかを示す情報を記憶し、
前記インスタンス管理部は、前記サブプログラムに対応する前記Javaソースプログラムのクラスのインスタンスが、前記キャッシュに存在する場合は、前記COBOLソースプログラムが初期化属性を有する場合、または当該インスタンスについてCANCEL文が事前に呼ばれている場合に、前記データ項目の初期化を行う、
変換プログラム実行システム。
A conversion program execution system according to claim 2,
The instance cache unit stores, for each instance, information indicating whether a CANCEL statement has been called in advance;
When the instance of the class of the Java source program corresponding to the subprogram exists in the cache, the instance management unit has a CANCEL statement in advance when the COBOL source program has an initialization attribute, or for the instance. The data item is initialized when called by
Conversion program execution system.
COBOLソースプログラムのデータ部におけるデータ定義を順次読み込むデータ定義読み取り部と、
前記データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力するデータ定義コード出力部と、
前記データ定義が、初期値が設定されているデータ項目を含む場合、前記クラスにおいて前記データ項目を前記初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力する初期化メソッド出力部と、
前記COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する初期化属性出力部と、
前記COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持するインスタンスキャッシュ部と、
前記CALL文から変換された第1の命令が実行されると、
前記サブプログラムに対応する前記Javaソースプログラムのクラスのインスタンスが、前記キャッシュに存在しない場合は、当該インスタンスを新たに生成し、
前記キャッシュに存在する場合は、前記第2のソースコードの実行結果に基づいて、前記COBOLソースプログラムが、初期化属性を有する場合は、前記第1のソースコードを実行することにより前記データ項目の初期化を行ったうえで、前記キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合は前記データ項目の初期化を行わずに前記キャッシュ内の当該インスタンスを再利用するインスタンス管理部と、
を備える情報処理システム。
A data definition reading section for sequentially reading data definitions in the data section of the COBOL source program;
A data definition code output unit for outputting a source code for generating an instance of a class for realizing the data definition in a Java source program;
When the data definition includes a data item for which an initial value is set, an initialization method for outputting first source code for calling a method for initializing the data item to the initial value in the class An output section;
An initialization attribute output unit for outputting a second source code of a method for outputting information indicating whether the COBOL source program has an initialization attribute;
An instance cache unit that holds an instance cache of a Java source program class corresponding to a subprogram called by a CALL statement in the COBOL source program;
When the first instruction converted from the CALL statement is executed,
If an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, a new instance is generated,
If the COBOL source program has an initialization attribute based on the execution result of the second source code if it exists in the cache, the first source code is executed by executing the first source code. An instance management unit that reuses the instance in the cache after initialization and reuses the instance in the cache without initializing the data item if it does not have an initialization attribute When,
An information processing system comprising:
コンピュータが、
COBOLソースプログラムのデータ部におけるデータ定義を順次読み込み、
前記データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力し、
前記データ定義が、初期値が設定されているデータ項目を含む場合、前記クラスにおいて前記データ項目を前記初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力し、
前記COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力する、
プログラム変換方法。
Computer
Read the data definitions in the data part of the COBOL source program sequentially,
Outputting a source code for generating an instance of a class for realizing the data definition in a Java source program;
When the data definition includes a data item having an initial value set, the first definition code for calling a method for initializing the data item to the initial value in the class is output.
Outputting a second source code of a method for outputting information indicating whether the COBOL source program has an initialization attribute;
Program conversion method.
請求項5に記載されたプログラム変換方法により出力されたJavaソースプログラムを実行するコンピュータが、
前記COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持し、
前記CALL文から変換された第1の命令が実行されると、
前記サブプログラムに対応する前記Javaソースプログラムのクラスのインスタンスが、前記キャッシュに存在しない場合は、当該インスタンスを新たに生成し、
前記キャッシュに存在する場合は、前記第2のソースコードの実行結果に基づいて、前記COBOLソースプログラムが、初期化属性を有する場合は、前記第1のソースコードを実行することにより前記データ項目の初期化を行ったうえで、前記キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合は前記データ項目の初期化を行わずに前記キャッシュ内の当該インスタンスを再利用する
変換プログラム実行方法。
A computer that executes the Java source program output by the program conversion method according to claim 5,
In the COBOL source program, a cache of an instance of a class of a Java source program corresponding to a subprogram called by a CALL statement is held.
When the first instruction converted from the CALL statement is executed,
If an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, a new instance is generated,
If the COBOL source program has an initialization attribute based on the execution result of the second source code if it exists in the cache, the first source code is executed by executing the first source code. After initializing, the instance in the cache is reused, and when there is no initialization attribute, the instance in the cache is reused without initializing the data item .
Conversion program execution method.
コンピュータが、
COBOLソースプログラムのデータ部におけるデータ定義を順次読み込み、
前記データ定義をJavaソースプログラムにおいて実現するためのクラスのインスタンスを生成するためのソースコードを出力し、
前記データ定義が、初期値が設定されているデータ項目を含む場合、前記クラスにおいて前記データ項目を前記初期値に初期化するためのメソッドを呼び出すための第1のソースコードを出力し、
前記COBOLソースプログラムが初期化属性を有するかどうかを示す情報を出力するためのメソッドの第2のソースコードを出力し、
前記COBOLソースプログラムにおいてCALL文で呼び出されるサブプログラムに対応するJavaソースプログラムのクラスのインスタンスのキャッシュを保持し、
前記CALL文から変換された第1の命令が実行されると、
前記サブプログラムに対応する前記Javaソースプログラムのクラスのインスタンスが、前記キャッシュに存在しない場合は、当該インスタンスを新たに生成し、
前記キャッシュに存在する場合は、前記第2のソースコードの実行結果に基づいて、前記COBOLソースプログラムが、初期化属性を有する場合は、前記第1のソースコードを実行することにより前記データ項目の初期化を行ったうえで、前記キャッシュ内の当該インスタンスを再利用し、初期化属性を有しない場合は前記データ項目の初期化を行わずに前記キャッシュ内の当該インスタンスを再利用する
情報処理方法。
Computer
Read the data definitions in the data part of the COBOL source program sequentially,
Outputting a source code for generating an instance of a class for realizing the data definition in a Java source program;
When the data definition includes a data item having an initial value set, the first definition code for calling a method for initializing the data item to the initial value in the class is output.
Outputting a second source code of a method for outputting information indicating whether the COBOL source program has an initialization attribute;
In the COBOL source program, a cache of an instance of a class of a Java source program corresponding to a subprogram called by a CALL statement is held.
When the first instruction converted from the CALL statement is executed,
If an instance of the class of the Java source program corresponding to the subprogram does not exist in the cache, a new instance is generated,
If the COBOL source program has an initialization attribute based on the execution result of the second source code if it exists in the cache, the first source code is executed by executing the first source code. After initializing, the instance in the cache is reused, and when there is no initialization attribute, the instance in the cache is reused without initializing the data item .
Information processing method.
JP2018181138A 2018-09-27 2018-09-27 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method Active JP6458196B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018181138A JP6458196B1 (en) 2018-09-27 2018-09-27 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018181138A JP6458196B1 (en) 2018-09-27 2018-09-27 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method

Publications (2)

Publication Number Publication Date
JP6458196B1 true JP6458196B1 (en) 2019-01-23
JP2020052707A JP2020052707A (en) 2020-04-02

Family

ID=65037161

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018181138A Active JP6458196B1 (en) 2018-09-27 2018-09-27 Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method

Country Status (1)

Country Link
JP (1) JP6458196B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
US20060031820A1 (en) * 2004-08-09 2006-02-09 Aizhong Li Method for program transformation and apparatus for COBOL to Java program transformation
JP2010086218A (en) * 2008-09-30 2010-04-15 Internatl Business Mach Corp <Ibm> Computer system executing program including java (r) code converted from cobol code, its method, and computer program
JP2016115070A (en) * 2014-12-12 2016-06-23 Tis株式会社 Program conversion system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006011756A (en) * 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
US20060031820A1 (en) * 2004-08-09 2006-02-09 Aizhong Li Method for program transformation and apparatus for COBOL to Java program transformation
JP2010086218A (en) * 2008-09-30 2010-04-15 Internatl Business Mach Corp <Ibm> Computer system executing program including java (r) code converted from cobol code, its method, and computer program
JP2016115070A (en) * 2014-12-12 2016-06-23 Tis株式会社 Program conversion system

Also Published As

Publication number Publication date
JP2020052707A (en) 2020-04-02

Similar Documents

Publication Publication Date Title
EP1178404B1 (en) Method and system for compiling multiple languages
US7380242B2 (en) Compiler and software product for compiling intermediate language bytecodes into Java bytecodes
US9690554B2 (en) Unified data type system and method
US8607206B2 (en) Automatic synchronous-to-asynchronous software application converter
US8756590B2 (en) Binding data parallel device source code
US8904366B2 (en) Use of vectorization instruction sets
US8464232B2 (en) Compiler compiler system with syntax-controlled runtime and binary application programming interfaces
US8141035B2 (en) Method for accessing internal states of objects in object oriented programming
CN110059456B (en) Code protection method, code protection device, storage medium and electronic equipment
JP4652680B2 (en) Compiling method and apparatus, and compiler
KR20080038306A (en) Nullable and late binding
JP6251158B2 (en) Program conversion system
JP4768984B2 (en) Compiling method, compiling program, and compiling device
JP6458196B1 (en) Program conversion system, conversion program execution system, information processing system, program conversion method, conversion program execution method, and information processing method
JP6651974B2 (en) Information processing apparatus, compiling method and compiler program
US10599406B2 (en) Generating executable files through compiler optimization
Schildt The art of java
Srivastava et al. C in Depth
JP6475888B1 (en) Program conversion system
Bancila et al. Learn C# Programming: A guide to building a solid foundation in C# language for writing efficient programs
JP7295466B2 (en) Class generation program and class generation method
van Weelden et al. A functional shell that dynamically combines compiled code
Milanesi et al. Object-Oriented Programming
KR20080018025A (en) Method for generating mobile application and record media recorded program for realizing the same
Kurniawan Java 7: A Beginner’s Tutorial Third Edition

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181009

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20181009

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20181010

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20181112

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181121

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181221

R150 Certificate of patent or registration of utility model

Ref document number: 6458196

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250