JPH0362226A - Source program conversion system - Google Patents

Source program conversion system

Info

Publication number
JPH0362226A
JPH0362226A JP19820389A JP19820389A JPH0362226A JP H0362226 A JPH0362226 A JP H0362226A JP 19820389 A JP19820389 A JP 19820389A JP 19820389 A JP19820389 A JP 19820389A JP H0362226 A JPH0362226 A JP H0362226A
Authority
JP
Japan
Prior art keywords
source
conversion
program
record
output
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
JP19820389A
Other languages
Japanese (ja)
Inventor
Chikako Yonezawa
米澤 千賀子
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP19820389A priority Critical patent/JPH0362226A/en
Publication of JPH0362226A publication Critical patent/JPH0362226A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain the automatic conversion of a source program by performing the source conversion as necessary based on the retrieving result of a conversion information data base and outputting the result of the source conversion to an output file. CONSTITUTION:A source input means 2 reads the source record out of a file which stores a source program performing the transplantation. Then a source decomposing means 3 decomposes the source record read by the means 2 into each word. A retrieving means 4 retrieves a conversion information data base 5 as long as the word decomposed by the means 3 seves as a key word for the source conversion. A source conversion means 6 discriminates whether the source conversion is required or not based on the retrieving result of the base 5 obtained by the means 4. When the source conversion is required, the means 6 carries out the source conversion. Then a source output means 7 outputs the source record received from the means 6 to an output source file 8. Consequently, the source program is automatically converted.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はソースプログラム変換方式に関し、特に異なる
オペレーティングシステム(以下、O8と略記する)間
でプログラムを移植する場合のソースプログラム変換方
式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a source program conversion method, and particularly to a source program conversion method for porting a program between different operating systems (hereinafter abbreviated as O8).

〔従来の技術〕[Conventional technology]

従来、異なるO3間でプログラムを移植する場合のソー
スプログラムの変換(以下、単にソース変換という)の
方法としては、人手でソースプログラムの1ステツプず
つの判断を行いソース変換する方法や、プログラム内に
変換情報を組み込んだソース変換プログラムによって自
動的にソース変換を行う方法などがあった。
Conventionally, methods for converting source programs (hereinafter simply referred to as source conversion) when porting programs between different O3s include methods that manually judge each step of the source program and convert the source, and There was a method of automatically converting sources using a source conversion program that incorporated conversion information.

(発明が解決しようとする課題〕 上述した従来のソースプログラム変換方式では、異なる
O3間でプログラムを移植する場合に人手でソースステ
ップの判定および変換を行うようにした場合には、ソー
ス変換に時間がかかるとともに変換ミスが起こる可能性
が高いという欠点がある。
(Problems to be Solved by the Invention) In the conventional source program conversion method described above, if the source steps are manually determined and converted when a program is ported between different O3s, it takes a long time to convert the source. The drawback is that it takes a lot of time and there is a high possibility that conversion errors will occur.

また、プログラム内に変換情報を持ったソース変換プロ
グラムでソース変換を行う場合には、人手によるミスは
解消されるが、ソース変換プログラム内に変換情報が含
まれるので、変換情報の追加、修正、削除等が発生した
ときにそのつとソース変換プログラムの修正およびテス
トを行わなければならなくなるという欠点がある。
In addition, if source conversion is performed using a source conversion program that has conversion information within the program, manual errors are eliminated, but since the conversion information is included in the source conversion program, it is necessary to add, modify, and edit the conversion information. This method has the disadvantage that when a deletion or the like occurs, the source conversion program must be modified and tested.

本発明の目的は、上述の点に鑑み、異なるO8間でプロ
グラムの変換を行う場合に人手でソース変換を行うので
はなく、またプログラム内に変換情報を組み込んだソー
ス変換プログラムによってソース変換を行うのではなし
に、ソースプログラムの自動変換を実現するようにした
ソースプログラム変換方式を提供することにある。
In view of the above-mentioned points, an object of the present invention is to perform source conversion by using a source conversion program that incorporates conversion information into the program, instead of converting the source manually when converting programs between different O8s. The object of the present invention is to provide a source program conversion method that realizes automatic conversion of source programs.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のソースプログラム変換方式は、異なるオペレー
ティングシステム間でプログラムの移植を行う場合のソ
ースプログラム変換方式において、移植を行うソースプ
ログラムが格納されているファイルからソースレコード
を読み込むソース入力手段と、このソース入力手段によ
って読み込まれたソースレコードを単語単位に分解する
ソース分解手段と、このソース分解手段によって分解さ
れた単語がソース変換を行うためのキーワードであるな
らば変換情報データベースを検索する検索手段と、この
検索手段による前記変換情報データベースの検索結果に
基づいてソース変換を行う必要があるかどうかを判断し
変換の必要がある場合にはソース変換を行うソース変換
手段と、このソース変換手段から渡されたソースレコー
ドを出力ファイルに出力するソース出力手段とを有する
The source program conversion method of the present invention is a source program conversion method for porting a program between different operating systems, and includes a source input means for reading a source record from a file in which a source program to be ported is stored; a source decomposition means that decomposes the source record read by the input means into words; a search means that searches a conversion information database if the word decomposed by the source decomposition means is a keyword for performing source conversion; A source conversion means that determines whether or not it is necessary to perform source conversion based on the search result of the conversion information database by this search means, and performs source conversion if conversion is necessary; and a source output means for outputting the source record to an output file.

〔作用〕[Effect]

本発明のソースプログラム変換方式では、ソース入力手
段が移植を行うソースプログラムが格納されているファ
イルからソースレコードを読み込み、ソース分解手段が
ソース入力手段によって読み込まれたソースレコードを
単語単位に分解し、検索手段がソース分解手段によって
分解された単語がソース変換を行うためのキーワードで
あるならば変換情報データベースを検索し、ソース変換
手段が検索手段による変換情報データベースの検索結果
に基づいてソース変換を行う必要があるかどうかを判断
し変換の必要がある場合にはソース変換を行い、ソース
出力手段がソース変換手段から渡されたソースレコード
を出力ファイルに出力する。
In the source program conversion method of the present invention, a source input means reads a source record from a file in which a source program to be ported is stored, a source decomposition means decomposes the source record read by the source input means into words, If the word decomposed by the source decomposition means is a keyword for source conversion, the search means searches the conversion information database, and the source conversion means performs source conversion based on the search result of the conversion information database by the search means. It is determined whether or not conversion is necessary, and if conversion is necessary, the source is converted, and the source output means outputs the source record passed from the source conversion means to an output file.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は、本発明の一実施例に係るソースプログラム変
換方式の構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of a source program conversion method according to an embodiment of the present invention.

本実施例のソースプログラム変換方式は、変換を行うソ
ースプログラムが格納されている入力ツースファイル1
と、入力ツースファイルlよりソースレコードを読み込
むソース入力手段2と、ソース入力手段2によって読み
込まれたソースレコードを単語単位に分解するソース分
解手段3と、ソース分解手段3によって分解された単語
がソース変換を行うためのキーワードかどうかを判定し
変換情報データベース5を検索する検索手段4と、検索
手段4による検索結果に基づいてソース変換を行うかど
うかを判定しソース変換が必要な場合はソース変換を行
いソースレコードを作成するソース変換手段6と、ソー
ス変換手段6によって作成されたソースレコードを出力
ツースファイル8に出力するソース出力手段7とから構
成されている。
The source program conversion method of this embodiment is based on an input tooth file 1 in which a source program to be converted is stored.
, a source input means 2 that reads a source record from an input tooth file l, a source decomposition means 3 that decomposes the source record read by the source input means 2 into words, and the words decomposed by the source decomposition means 3 as sources. a search means 4 that determines whether the keyword is a keyword for conversion and searches the conversion information database 5; and a search means 4 that determines whether or not to perform source conversion based on the search results by the search means 4, and if source conversion is necessary, converts the source. The source conversion means 6 includes a source conversion means 6 which performs the above operations and creates a source record, and a source output means 7 which outputs the source record created by the source conversion means 6 to an output tooth file 8.

第2図を参照すると、ソース入力手段2は、変換を行う
ソースプログラムが格納されている入力ツースファイル
1よりソースレコードを読み出す入力部202と、ソー
スレコードを読み込んだときの状態および読み込んだソ
ースレコードの内容を判定して分解手段3にソースレコ
ード204を渡す判定部203とから構成されている。
Referring to FIG. 2, the source input means 2 includes an input section 202 that reads source records from the input tooth file 1 in which the source program to be converted is stored, and the state when the source records are read and the read source records. and a determination section 203 that determines the contents of the source record 204 and passes the source record 204 to the decomposition means 3.

第3図を参照すると、ソース分解手段3は、ソ−ス入力
手段2から送られてきたソースレコード204を区切り
文字情報302をもとに単語ごとに分解する分解部30
3と、分解部303で分解された単語情報をもとにキー
ワード識別情報304を参照して分解情報306を作成
する編集部305とから構成されている。
Referring to FIG. 3, the source decomposition means 3 includes a decomposition unit 30 that decomposes the source record 204 sent from the source input means 2 into words based on the delimiter information 302.
3, and an editing section 305 that creates decomposition information 306 by referring to keyword identification information 304 based on the word information decomposed by the decomposition section 303.

第4図を参照すると、検索手段4は、ソース分解手段3
で作成された分解情報306を見てソース変換のための
キーワードがあればその情報をもとに変換情報データベ
ース5を検索する検索部402と、キーワードに対する
変換情報が複数検索されたときにどの変換情報があては
まるかを判定する判定部404と、判定部404での判
定結果を分解情報306に付加する編集部405とから
構成されている。
Referring to FIG. 4, the search means 4 includes the source decomposition means 3.
A search unit 402 searches the conversion information database 5 based on the keyword for source conversion by looking at the decomposition information 306 created in , and searches the conversion information database 5 based on that information. It is composed of a determining unit 404 that determines whether the information is applicable, and an editing unit 405 that adds the determination result of the determining unit 404 to the decomposition information 306.

第5図を参照すると、ソース変換・手段6は、検索手段
4より送られてきた分解情報406を見てどのような変
換を行うかを判定する判定部502と、分解情報406
をもとにソース変換を行い出力ツースファイル8に出力
するソースレコード504を作成する編集部503とか
ら構成されている。
Referring to FIG. 5, the source conversion means 6 includes a determination unit 502 that looks at the decomposition information 406 sent from the search means 4 and determines what kind of conversion to perform;
and an editing section 503 that performs source conversion based on the information and creates a source record 504 to be output to the output tooth file 8.

第6図を参照すると、ソース出力手段7は、ソースレコ
ード504を出力ツースファイル8に出力する出力部6
02と、出力状態等を判定する判定部604とから構成
されている。
Referring to FIG. 6, the source output means 7 includes an output section 6 that outputs the source record 504 to the output tooth file 8.
02, and a determination unit 604 that determines the output state and the like.

次に、このように構成された本実施例のソースプログラ
ム変換方式の動作について説明する。
Next, the operation of the source program conversion method of this embodiment configured as described above will be explained.

ソース入力手段2の入力部202では、ソースプログラ
ムが格納されている入力ツースファイル1よりソースレ
コードを読み込む、読み込まれたソースレコードは、判
定部203に送られる0判定部203では、まずソース
レコードを読み込んだときに入力障害が発生したかどう
かを判定する。
The input section 202 of the source input means 2 reads source records from the input tooth file 1 in which the source program is stored.The read source records are sent to the judgment section 203.The judgment section 203 first reads the source records. Determine whether an input failure occurred when reading.

判定の結果、入力障害が発生した場合には、処理終了(
異常終了〉とする0次に、ソースレコードの終了かどう
かを判定し、ソースレコードの終了の場合には正常終了
する。入力障害およびソースレコードの終了のどちらで
もない場合には、読み込んだソースレコードがコメント
、空白等か実コーディングかどうかを判定する。実コー
ディングでない場合には、次のソースレコードを読み込
み、実コーディングされているソースレコードならばこ
のソースレコード204をソース分解手段3に渡す。
As a result of the judgment, if an input failure occurs, the process ends (
Abnormal termination> 0 Next, it is determined whether or not the source record has ended, and if the source record has ended, the process terminates normally. If there is neither an input error nor the end of the source record, it is determined whether the read source record is a comment, a blank, etc., or actual coding. If the source record is not actual coding, the next source record is read, and if the source record is actual coding, this source record 204 is passed to the source decomposition means 3.

ソース入力手段2より送られてきたソースレコード20
4は、ソース分解手段3の分解部303に送られる0分
解部303では、空白、カンマ(1)等の区切り文字情
報302をもとにソースレコード204を単語単位に分
解する0分解された単語情報は、編集部305に送られ
る6編集部305では、キーID (IDentifi
cation)とソース変換を行うかどうかを判定する
ためのキーワードとで構成されるキーワード識別情報3
04をもとに、分解されて送られてきた単語情報がソー
ス変換のためのキーワードか項目名か等が判断され、分
解情報306が作成される。作成された分解情報306
は、検索手段4に送られる。
Source record 20 sent from source input means 2
4 is a 0-decomposed word that is sent to the decomposition unit 303 of the source decomposition unit 3. The 0-decomposition unit 303 decomposes the source record 204 into word units based on the delimiter information 302 such as spaces and commas (1). The information is sent to the editing section 305.6 The editing section 305 sends the information to the editing section 305.
cation) and a keyword for determining whether to perform source conversion.
Based on 04, it is determined whether the word information that has been decomposed and sent is a keyword or item name for source conversion, and decomposition information 306 is created. Created disassembly information 306
is sent to the search means 4.

ソース分解手段3で作成された分解情報306は、検索
手段4の検索部402に送られる。検索部402では、
送ら郵できた分解部[306中にソース分解手段3で付
加されたキーワードか項目名か等の情報を見て、ソース
変換のためのキーワードがあればその情報をもとに変換
情報データベース5を検索する。ソース変換のためのキ
ーワードがなければ、変換の必要がないソースレコード
と判断される。変換情報データベース5の検索結果は、
判定部404に渡される。判定部404では、変換情報
データベース5を検索した結果、あるキーワードに対し
て複数個の変換情報があった場合には、どの変換情報に
あてはまるかを変換情報内にある単語の順序規則、符号
規則等の情報をもとに判定する0判定した結果は、[郡
部405に渡される。&I集郡部405は、判定部40
4での判定の結果、あてはまる変換情報を分解情報40
6に付加し、ソース変換手段6に渡す。
The decomposition information 306 created by the source decomposition means 3 is sent to the retrieval section 402 of the retrieval means 4. In the search unit 402,
The sent decomposition unit [306] looks at the information such as keywords or item names added by the source decomposition means 3, and if there is a keyword for source conversion, converts the conversion information database 5 based on that information. search for. If there is no keyword for source conversion, it is determined that the source record does not require conversion. The search results of the conversion information database 5 are as follows:
It is passed to the determination unit 404. In the determination unit 404, when a plurality of pieces of conversion information are found for a certain keyword as a result of searching the conversion information database 5, the determination unit 404 determines which conversion information applies to the word order rules and code rules of the words in the conversion information. The result of the 0 determination based on information such as [0] is passed to the district department 405. &I collection unit 405 is the determination unit 40
As a result of the judgment in step 4, the applicable conversion information is divided into decomposition information 40.
6 and passed to the source conversion means 6.

検索手段4より送られてきた分解情報406は、ソース
変換手段5の判定部502に送られる0判定部502で
は、検索手段4で付加された変換情報を見てどのような
変換を行うかを判定する。編集部503では、分解情報
406中の単語情報をもとに変換情報によって指定され
た変換(例えば、コメント行に変換)を行い、出力ツー
スファイル8に出力するためのソースレコード504を
作成する。
The decomposition information 406 sent from the search means 4 is sent to the judgment section 502 of the source conversion means 5.The judgment section 502 looks at the conversion information added by the search means 4 and determines what kind of conversion to perform. judge. The editing unit 503 performs the conversion specified by the conversion information (for example, conversion to a comment line) based on the word information in the decomposition information 406, and creates a source record 504 to be output to the output tooth file 8.

ソース変換手段6で作成されたソースレコード504は
、ソース出力手段7の出力部602に送られる。出力部
602では、送られてきたソースレコード504を出力
ツースファイル8に出力する。また、判定部604では
、出力ツースファイル8にソースレコード504を出力
したときの出力状況を判定する。出力障害が発生した場
合には、異常があったものとして処理を終了する。異常
がなかった場合には、次のソースレコードを読み込むた
めにソース入力手段1に制御を渡す。
The source record 504 created by the source conversion means 6 is sent to the output section 602 of the source output means 7. The output unit 602 outputs the sent source record 504 to the output tooth file 8. Further, the determination unit 604 determines the output status when the source record 504 is output to the output tooth file 8. If an output failure occurs, it is assumed that an abnormality has occurred and the processing is terminated. If there is no abnormality, control is passed to the source input means 1 to read the next source record.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、人手による変換処理では
なく自動的にソース変換を行うことにより、短時間でソ
ース変換を行うことができるとともに変換ミスが起こり
にくいという効果がある。
As described above, the present invention has the advantage that source conversion can be performed in a short time and conversion errors are less likely to occur by automatically performing source conversion instead of manual conversion processing.

また、変換情報データベース内に変換情報を格納するよ
うにしたことにより、従来のソース変換プログラムのよ
うに変換情報の追加、修正、削除等が発生したときにソ
ース変換プログラム自身の修正およびテストを行う必要
はなく、変換情報の追加、修正、削除等は変換情報デー
タベースの内容を更新するだけですむという効果がある
In addition, by storing conversion information in the conversion information database, the source conversion program itself can be corrected and tested when conversion information is added, modified, deleted, etc., as in conventional source conversion programs. This is not necessary, and the effect is that adding, modifying, deleting, etc. of conversion information can be done by simply updating the contents of the conversion information database.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の一実施例に係るソースプログラム変換
方式の構成を示すブロック図、第2図は第1図中のソー
ス入力手段の構成を示すブロック図、 第3図は第1図中のソース分解手段の構成を示すブロッ
ク図、 第4図は第1図中の検索手段の構成を示すブロック図、 第5図は第1図中のソース変換手段の構成を示すブロッ
ク図、 第6図は第1図中のソース出力手段の構成を示・入力ツ
ースファイル、 ・ソース入力手段、 ・ソース分解手段、 ・検索手段、 ・変換情報データベース、 ・ソース変換手段、 ・ソース出力手段、 ・出力ツースファイル、 ・入力部、 ・判定部、 ・ソースレコード、 ・区切り文字情報、 ・分解部、 ・キーワード識別情報、 ・編集部、 ・分解情報、 ・検索部、 ・判定部、 すブロック図である。 図において、 l・・・・ 2・・・・ 3・・・・ 4・・・・ 5・・・・ 6・・・・ 7・・・・ 8・・・・ 202・・ 203・・ 204・・ 302・・ 303・・ 304・・ 305・・ 306・・ 402・・ 404・・ 405・・・編集部、 406・・・分解情報、 502・・・判定部、 503・・・編集部、 504・・・ソースレコード、 602・・・出力部、 604・・・判定部である。
1 is a block diagram showing the configuration of a source program conversion method according to an embodiment of the present invention, FIG. 2 is a block diagram showing the configuration of the source input means in FIG. 1, and FIG. 3 is a block diagram showing the configuration of the source program conversion method in FIG. 4 is a block diagram showing the structure of the search means in FIG. 1; FIG. 5 is a block diagram showing the structure of the source conversion means in FIG. 1; The figure shows the configuration of the source output means in Figure 1 - Input tooth file, - Source input means, - Source decomposition means, - Search means, - Conversion information database, - Source conversion means, - Source output means, - Output This is a block diagram of the tooth file, - input part, - judgment part, - source record, - delimiter information, - decomposition part, - keyword identification information, - editing part, - decomposition information, - search part, - judgment part. . In the figure, l... 2... 3... 4... 5... 6... 7... 8... 202... 203... 204 302... 303... 304... 305... 306... 402... 404... 405... Editorial department, 406... Decomposition information, 502... Judgment section, 503... Editorial department , 504...source record, 602...output section, 604...judgment section.

Claims (1)

【特許請求の範囲】 異なるオペレーティングシステム間でプログラムの移植
を行う場合のソースプログラム変換方式において、 移植を行うソースプログラムが格納されているファイル
からソースレコードを読み込むソース入力手段と、 このソース入力手段によって読み込まれたソースレコー
ドを単語単位に分解するソース分解手段と、 このソース分解手段によって分解された単語がソース変
換を行うためのキーワードであるならば変換情報データ
ベースを検索する検索手段と、この検索手段による前記
変換情報データベースの検索結果に基づいてソース変換
を行う必要があるかどうかを判断し変換の必要がある場
合にはソース変換を行うソース変換手段と、 このソース変換手段から渡されたソースレコードを出力
ファイルに出力するソース出力手段とを有することを特
徴とするソースプログラム変換方式。
[Claims] In a source program conversion method for porting a program between different operating systems, there is provided a source input means for reading a source record from a file in which a source program to be ported is stored; A source decomposition means that decomposes a read source record into words; a search means that searches a conversion information database if the word decomposed by the source decomposition means is a keyword for source conversion; and a search means. a source conversion means that determines whether or not it is necessary to perform source conversion based on the search results of the conversion information database and performs source conversion if conversion is necessary; and a source record passed from the source conversion means. 1. A source program conversion method comprising: a source output means for outputting to an output file.
JP19820389A 1989-07-31 1989-07-31 Source program conversion system Pending JPH0362226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19820389A JPH0362226A (en) 1989-07-31 1989-07-31 Source program conversion system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19820389A JPH0362226A (en) 1989-07-31 1989-07-31 Source program conversion system

Publications (1)

Publication Number Publication Date
JPH0362226A true JPH0362226A (en) 1991-03-18

Family

ID=16387199

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19820389A Pending JPH0362226A (en) 1989-07-31 1989-07-31 Source program conversion system

Country Status (1)

Country Link
JP (1) JPH0362226A (en)

Similar Documents

Publication Publication Date Title
JP2000148461A (en) Software model and existing source code synchronizing method and device
JPH0934763A (en) Device and method for managing file
CN110618988B (en) Data processing method and device based on big data platform
JPH0287274A (en) On-line information retrieving system
JPH0362226A (en) Source program conversion system
JP3529301B2 (en) Automatic data file converter
KR100323607B1 (en) Data conversion method for converting text file searched for art data into master table for art information analysis
JPH056272A (en) Software designing device
JPH09101886A (en) Device for automatically extracting/reusing program component
JPH0588847A (en) Code conversion processing method
JP2000222259A (en) Sql automatic generation system
JP2611641B2 (en) Data item name converter
JP2722684B2 (en) File system search device
JPH11259351A (en) Data base device, shared data base device, shared data base system, data extracting method for shared data base device and storage medium recording data extraction program for shared data base device
JPH01112420A (en) General purpose data extracting system
JPS61226846A (en) Generation control system
JPH05266081A (en) Word data merging system
JPH1063552A (en) Code conversion system
JPH03248271A (en) File input/output device
CN115687398A (en) Data unified acquisition method, device and medium applied to multiple databases
JPH0573291A (en) Software changing processing system
JPS63268050A (en) Continuous converting device for multiple file
JPH05250210A (en) Program trace system
JPH08278979A (en) Method and device for data base structure conversion
JPH05120100A (en) Resource defining system