JPH04322326A - Program correcting system - Google Patents

Program correcting system

Info

Publication number
JPH04322326A
JPH04322326A JP3090962A JP9096291A JPH04322326A JP H04322326 A JPH04322326 A JP H04322326A JP 3090962 A JP3090962 A JP 3090962A JP 9096291 A JP9096291 A JP 9096291A JP H04322326 A JPH04322326 A JP H04322326A
Authority
JP
Japan
Prior art keywords
grammar
program
syntax
destination system
source program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP3090962A
Other languages
Japanese (ja)
Inventor
Tadashi Nishikawa
忠 西川
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators Ltd
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 Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP3090962A priority Critical patent/JPH04322326A/en
Publication of JPH04322326A publication Critical patent/JPH04322326A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

PURPOSE:To reduce the man-hours of program transporting. CONSTITUTION:This system includes a grammar table 2 where grammar of a transporting destination system is stored, a grammar analyzing means 3 which discriminates whether a source program is adapted to grammar of the porting destination system or not and analyzes contents of grammar error at the time of detecting incompatible grammar, a syntax conjecturing means 4 which conjectures candidates of syntax rules adapted to the transporting destination system, a display/input device 5 for interactive correction of the source program a program correcting means 7 which corrects the source program in accordance with correction information received from the display/input device, and a correction program 6 where the syntax adapted to grammar of the transporting destination system and the syntax which is corrected to be adapted to it are stored.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はプログラム修正方式、特
にあるコンピュータシステムで開発したプログラムを、
他のコンピュータシステムの言語仕様に適合するように
原始プログラムを修正するプログラム修正方式に関する
ものである。
[Industrial Field of Application] The present invention relates to a method for modifying a program, in particular, a method for modifying a program developed on a certain computer system.
This invention relates to a program modification method for modifying a source program to conform to the language specifications of other computer systems.

【0002】0002

【従来の技術】異なるコンピュータシステムでは、同一
の言語でもそれぞれのコンピュータシステムの特徴を生
かした拡張文法を持つ場合が多い。そこで、従来、ある
コンピュータシステムで作成し実行可能な原始プログラ
ムを、他の言語仕様の拡張部分が異なるコンピュータシ
ステムに移植する場合、移植する原始プログラムが後者
のコンピュータシステムの文法に適合するか否かを確認
し修正するには、プログラム開発者自身が互換性のない
構文の解析を行い、テキストエディタ等を使用して後者
のコンピュータシステムの文法に適合するよう修正作業
を行っている。
2. Description of the Related Art Different computer systems often have extended grammars that take advantage of the characteristics of each computer system, even if the same language is used. Conventionally, when porting a source program that can be created and executed on one computer system to another computer system with a different language specification extension, it is important to consider whether the source program to be ported is compatible with the grammar of the latter computer system. To confirm and correct the program, the program developer must analyze the incompatible syntax himself, and use a text editor or the like to modify the program so that it conforms to the grammar of the latter computer system.

【0003】0003

【発明が解決しようとする課題】上述した従来のプログ
ラム修正方式では、プログラム開発者自身がプログラム
開発を行ったコンピュータシステムと移植するコンピュ
ータシステムの文法の差をすべて把握していなければな
らず、プログラムの規模が大きくなるにつれて非常に多
くの工数がかかるという欠点があった。
[Problems to be Solved by the Invention] In the conventional program modification method described above, the program developer must be aware of all the differences in grammar between the computer system in which the program was developed and the computer system to be ported. The disadvantage is that as the scale of the process increases, the number of man-hours required increases.

【0004】そこで本発明の目的は以上の欠点を解決し
、原始プログラムの非互換構文の修正を自動化し、プロ
グラムの移植作業に係わる作業を削減するプログラム修
正方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned drawbacks and provide a program modification method that automates the modification of incompatible syntax in a source program and reduces the work involved in program porting.

【0005】[0005]

【課題を解決するための手段】本発明のプログラム修正
方式は、移植元システムから移植先システムへ原始プロ
グラムを移植する際に、移植する原始プログラムが移植
先システムで実行できるようにプログラム修正を行うプ
ログラム修正方式において、移植先システムの文法を格
納する文法テーブルと、前記原始プログラムが移植先シ
ステムの文法に適合するか否かを判断し、互換性のない
文法を検出したとき文法誤りの内容を解析する文法解析
手段と、前記文法解析手段によって検出された文法誤り
の内容を受け取り、移植先システムに適合するような構
文規則の候補を推測する構文推測手段と、原始プログラ
ムの修正を対話型に行うための表示/入力装置と、表示
/入力装置から受け取った修正情報に従って原始プログ
ラムの修正を行うプログラム修正手段と、移植先システ
ムの文法に適合する構文および適合するよう修正された
構文を格納する修正プログラムとを含むことを特徴とす
る。
[Means for Solving the Problems] The program modification method of the present invention is such that when a source program is ported from a source system to a destination system, the program is modified so that the source program to be ported can be executed in the destination system. In the program modification method, it is determined whether the source program is compatible with the grammar of the porting destination system using a grammar table that stores the grammar of the porting destination system, and when an incompatible grammar is detected, the content of the grammar error is determined. A grammar analysis means for analyzing, a syntax estimation means for receiving the content of the grammar error detected by the grammar analysis means and estimating syntactic rule candidates suitable for the porting destination system, and modifying the source program interactively. a display/input device for modifying the source program, a program modification means for modifying the source program according to modification information received from the display/input device, and storing syntax that conforms to the grammar of the porting destination system and syntax that has been modified to conform. A modification program is included.

【0006】[0006]

【実施例】次に本発明について図面を参照して詳細に説
明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be explained in detail with reference to the drawings.

【0007】図1は本発明の一実施例を含むコンピュー
タシステムの構成を表すブロック図である。
FIG. 1 is a block diagram showing the configuration of a computer system including an embodiment of the present invention.

【0008】本実施例は、移植対象の原始プログラム1
、移植先のコンピュータシステムの文法を表の形式で格
納する文法テーブル2、文法テーブル2の情報をもとに
移植先のコンピュータシステムの文法に合わせて文法解
析を行う文法解析手段3、文法解析手段3から文法誤り
の情報を受け取り移植先システムの文法に適合するよう
な構文の候補を推測する構文推測手段4、構文規則の候
補を表示した構文の修正情報を入力する表示/入力装置
5、表示装置/入力装置5から入力した修正情報に従っ
て原始プログラム1を修正するプログラム修正手段6、
移植先システムの文法に合わせて修正が行われた修正プ
ログラム7から構成される。
In this embodiment, the source program 1 to be ported is
, a grammar table 2 that stores the grammar of the destination computer system in a table format, a grammar analysis means 3 that analyzes the grammar according to the grammar of the destination computer system based on the information in the grammar table 2, and a grammar analysis means Syntax estimation means 4 receives information on grammar errors from 3 and estimates syntax candidates that match the grammar of the porting destination system; display/input device 5 displays syntax rule candidates and inputs syntax correction information; program modification means 6 for modifying the source program 1 according to modification information input from the device/input device 5;
It consists of a modified program 7 that has been modified to match the grammar of the porting destination system.

【0009】まず、移植対象である原始プログラム1は
、文法解析手段3によって移植先システムの文法に従っ
て1文づつ文法解析が行われる。このとき文法解析手段
3は、文法テーブル2に格納されている文法に適合して
いるか否かを判断し、適合している文であれば、そのま
ま修正プログラム7として出力する。言語仕様テーブル
2に格納されている文法に適合していない構文であれば
、誤った構文の要素として何を記述しているか、文法テ
ーブル2のどの部分に適合しないかを判断する。
First, the source program 1 to be ported is analyzed sentence by sentence by the grammar analysis means 3 according to the grammar of the porting destination system. At this time, the grammar analysis means 3 determines whether the sentence conforms to the grammar stored in the grammar table 2, and if it conforms to the sentence, outputs it as it is as a correction program 7. If the syntax does not conform to the grammar stored in the language specification table 2, it is determined what is written as an element of the incorrect syntax and which part of the grammar table 2 it does not conform to.

【0010】構文推測手段4は、文法解析手段3によっ
て解析された誤りの内容と文法テーブル2の内容から、
原始プログラム1上で誤りのある部分に記述可能な文法
の要素を検索する。検索した文法の要素は修正構文の候
補として表示/入力装置5へ出力し、プログラム開発者
に対して修正イメージの入力を促す。プログラム修正手
段6は、表示/入力装置5から入力した修正イメージを
もとに原始プログラム1を修正し、再度文法解析手段3
へ渡す。
[0010] The syntax inference means 4 uses the contents of the error analyzed by the grammar analysis means 3 and the contents of the grammar table 2 to
A grammar element that can be written in an error part on the source program 1 is searched. The retrieved grammar elements are output to the display/input device 5 as candidates for corrected syntax, and the program developer is prompted to input a corrected image. The program modifying means 6 modifies the source program 1 based on the modified image inputted from the display/input device 5, and then rewrites the grammar analyzing means 3.
pass it on to

【0011】文法テーブル2は終端記号および非終端記
号の定義をバッカス記法にて記述する。図2にFORT
RAN言語による終端記号の定義例、図3にFORTR
AN言語による非終端記号の定義例をそれぞれ示す。
[0011] Grammar table 2 describes the definitions of terminal symbols and non-terminal symbols in Backus notation. Figure 2 shows the FORT
An example of defining a terminal symbol in the RAN language, shown in Figure 3 is FORTR.
Examples of definitions of nonterminal symbols in the AN language are shown below.

【0012】図4は、文法解析手段3の流れ図を示す。 まず原始プログラム1を1文入力し(ステップ101)
、以下の処理を原始プログラムが終了するまで(ステッ
プ102)繰り返す。
FIG. 4 shows a flowchart of the grammar analysis means 3. First, input one sentence of source program 1 (step 101).
, the following process is repeated until the source program ends (step 102).

【0013】入力した文は文の先頭から順に終端記号に
分解する(ステップ103)。1文の最後まで解析が終
了した、つまり1文の中で解析すべき終端記号がなくな
ったとき(ステップ104)、その文を修正プログラム
7へ出力し(ステップ105)、次の1文の解析を行う
The input sentence is decomposed into terminal symbols in order from the beginning of the sentence (step 103). When the analysis has been completed to the end of one sentence, that is, there are no more terminal symbols to be analyzed in one sentence (step 104), that sentence is output to the correction program 7 (step 105), and the next sentence is analyzed. I do.

【0014】終端記号が存在する場合は、この終端記号
の並びが文法テーブル2に記述されている通りになって
いるかをチェックすることによって文法解析を行う(ス
テップ106)。文法解析(ステップ106)の結果終
端記号の並びに誤りがなければ(ステップ107)、次
の終端記号の解析を行う。文法誤りがある場合は、構文
推測手段4を呼び出し(ステップ108)正しい文法の
候補を生成した後、プログラム修正手段(ステップ10
9)によって原始プログラムの書き換えを行う。
If a terminal symbol exists, grammar analysis is performed by checking whether the arrangement of the terminal symbol is as described in the grammar table 2 (step 106). If there is no error in the arrangement of the terminal symbols as a result of the grammar analysis (step 106) (step 107), the next terminal symbol is analyzed. If there is a grammar error, the syntax estimation means 4 is called (step 108), and after generating a correct grammar candidate, the program correction means (step 10) is called.
9) rewrites the source program.

【0015】図5は、構文推測手段4の流れ図を示す。 構文推測手段4は文法誤りが検出された終端記号または
非終端記号の位置を入力し(ステップ201)、文法テ
ーブル2を検索して、文法誤りが存在する位置に記述可
能な終端記号または非終端記号をすべて選び出す(ステ
ップ203)。検索した終端記号および非終端記号は修
正構文の候補として表示/入力装置5に出力する。
FIG. 5 shows a flowchart of the syntax inference means 4. The syntax guessing means 4 inputs the position of the terminal symbol or non-terminal symbol where the grammatical error has been detected (step 201), searches the grammar table 2, and finds a terminal symbol or non-terminal symbol that can be written at the position where the grammatical error exists. All are selected (step 203). The searched terminal symbols and non-terminal symbols are output to the display/input device 5 as candidates for corrected syntax.

【0016】プログラム修正手段6は、表示/入力装置
5から修正情報と、文法解析手段3から原始プログラム
上での文法誤りの位置を入力し、これらの2つの情報を
使用して原始プログラムを修正する。
The program correction means 6 inputs the correction information from the display/input device 5 and the position of the grammar error on the source program from the grammar analysis means 3, and uses these two pieces of information to correct the source program. do.

【0017】[0017]

【発明の効果】以上説明したように本発明は、あるコン
ピュータシステムで開発した原始プログラムを他のコン
ピュータシステムに移植する際、後者のコンピュータシ
ステムでは使用できない構文を明示し、移植先のコンピ
ュータシステムの言語仕様による文法解析と修正を同時
に行うことによって、プログラムの移植作業における工
数が大幅に削減できるという効果がある。
Effects of the Invention As explained above, the present invention, when porting a source program developed in one computer system to another computer system, specifies the syntax that cannot be used in the latter computer system. By simultaneously performing syntax analysis and correction based on language specifications, the number of man-hours required for program porting work can be significantly reduced.

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

【図1】本発明の一実施例のブロック図FIG. 1: Block diagram of one embodiment of the present invention

【図2】終端記
号の定義例を示す図
[Figure 2] Diagram showing an example of the definition of terminal symbols

【図3】非終端記号の定義例を示す図[Figure 3] Diagram showing an example of the definition of non-terminal symbols

【図4】文法解析手段の流れ図[Figure 4] Flowchart of grammar analysis means

【図5】構文推測手段の流れ図[Figure 5] Flowchart of syntax inference means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  移植元システムから移植先システムへ
原始プログラムを移植する際に、移植する原始プログラ
ムが移植先システムで実行できるようにプログラム修正
を行うプログラム修正方式において、移植先システムの
文法を格納する文法テーブルと、前記原始プログラムが
移植先システムの文法に適合するか否かを判断し、互換
性のない文法を検出したとき文法誤りの内容を解析する
文法解析手段と、前記文法解析手段によって検出された
文法誤りの内容を受け取り、移植先システムに適合する
ような構文規則の候補を推測する構文推測手段と、原始
プログラムの修正を対話型に行うための表示/入力装置
と、表示/入力装置から受け取った修正情報に従って原
始プログラムの修正を行うプログラム修正手段と、移植
先システムの文法に適合する構文および適合するよう修
正された構文を格納する修正プログラムとを含むことを
特徴とするプログラム修正方式。
Claim 1: In a program modification method that modifies the source program to be executed in the porting destination system when a source program is ported from the porting source system to the porting destination system, the grammar of the porting destination system is stored. a grammar table for determining whether the source program is compatible with the grammar of the porting destination system, and a grammar analysis means for analyzing the contents of a grammar error when an incompatible grammar is detected; A syntax inference means that receives the contents of a detected grammatical error and infers syntactic rule candidates suitable for the porting destination system, a display/input device for interactively modifying the source program, and a display/input device. A program modification characterized in that it includes a program modification means for modifying a source program according to modification information received from a device, and a modification program that stores syntax that conforms to the grammar of a porting destination system and syntax that has been modified to conform. method.
JP3090962A 1991-04-23 1991-04-23 Program correcting system Withdrawn JPH04322326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3090962A JPH04322326A (en) 1991-04-23 1991-04-23 Program correcting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3090962A JPH04322326A (en) 1991-04-23 1991-04-23 Program correcting system

Publications (1)

Publication Number Publication Date
JPH04322326A true JPH04322326A (en) 1992-11-12

Family

ID=14013124

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3090962A Withdrawn JPH04322326A (en) 1991-04-23 1991-04-23 Program correcting system

Country Status (1)

Country Link
JP (1) JPH04322326A (en)

Similar Documents

Publication Publication Date Title
JPS61103247A (en) Translation program generation system
US20060149543A1 (en) Construction of an automaton compiling grapheme/phoneme transcription rules for a phoneticizer
KR20170071325A (en) Apparatus and Method for Amending Language Analysis Error
JPH04322326A (en) Program correcting system
US7389220B2 (en) Correcting incomplete negation errors in French language text
JP2887660B2 (en) Translation Correction Support Device
JPS5922140A (en) Interactive compiling system
KR20190130905A (en) Method and Apparatus for Korean Zero Anaphora Resolution Tagging
JPH01307832A (en) System for automatically correcting grammatical error of source program in compiler
JP2636720B2 (en) Input character string correction device for coding
JPS63245738A (en) Automatic correcting system for data item with undefined program
JP2626174B2 (en) Translation support device
JPH05204658A (en) Source program registering system
JPH04148336A (en) Fortran program grammar analyzing system
JPH1185536A (en) Device and method for automatically correcting error of source program
JPH0695889A (en) Program correction system
JPH0215364A (en) Document processor
CN117406995A (en) Auxiliary method for code writing, online code editor, equipment and medium
JPS6347836A (en) Control system for return of syntax analyzing processing
KR20010063805A (en) Method for lexical analysis for c program
JPH07160714A (en) Japanese sentence proofreading device
JPH0319971B2 (en)
JPH05242140A (en) Translation assisting device
JPH09212511A (en) Natural language processor
JPH02130668A (en) Kana/kanji converting device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980711