JPH1185536A - Device and method for automatically correcting error of source program - Google Patents

Device and method for automatically correcting error of source program

Info

Publication number
JPH1185536A
JPH1185536A JP9267954A JP26795497A JPH1185536A JP H1185536 A JPH1185536 A JP H1185536A JP 9267954 A JP9267954 A JP 9267954A JP 26795497 A JP26795497 A JP 26795497A JP H1185536 A JPH1185536 A JP H1185536A
Authority
JP
Japan
Prior art keywords
correction
error
source program
information
candidate
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
JP9267954A
Other languages
Japanese (ja)
Inventor
Takeshi Endo
武 遠藤
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 JP9267954A priority Critical patent/JPH1185536A/en
Publication of JPH1185536A publication Critical patent/JPH1185536A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce time and labor which is spent for correction of a source program by automatically correcting mistakes of a source program according to an error correction history dictionary which records information such as a correction method for errors that take place in the past. SOLUTION: An error correction history retrieving part 105 retrieves whether an error list 103 outputted from a compiling part 102 is undergone the same error correction in the past with an error code analyzed by an error analyzing part 104 to an error correction history dictionary 106. Here, the dictionary 106 stores information about errors that are corrected in the past. An automatic error correcting part 107 corrects an error based on a retrieval result of the part 105. A source program correcting part 110 reflects correction that is performed by the part 107 to a source program 101 and acquires a source program 111 that is undergone automatic correction.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、プログラムのコン
パイルにおける原始プログラムのエラー自動修正装置及
び方法に関し、特に過去の修正履歴を利用した原始プロ
グラムのエラー修正装置及び方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus and method for automatically correcting an error in a source program in compiling a program, and more particularly to an apparatus and method for correcting an error in a source program using a past correction history.

【0002】[0002]

【従来の技術】プログラマーが手作業により作成した原
始プログラムには、タイプミスや簡単な文法上のミスが
含まれることがある。一般にプログラマーは、このよう
な原始プログラムをコンパイルした場合に得られるエラ
ーリストを参照しながら一つ一つのエラーについて原始
プログラムを修正し、コンパイルを繰り返す必要がある
が、この作業には多くの時間、及び労力が費やされる。
2. Description of the Related Art A source program created manually by a programmer may include typographical errors and simple grammatical errors. Generally, the programmer needs to correct the source program for each error and repeat the compilation while referring to the error list obtained when compiling such a source program. And effort is expended.

【0003】原始プログラムのエラーの自動修正装置
は、原始プログラムをコンパイルし目的プログラムを生
成する場合に必要な、原始プログラムのエラーを修正す
るときのプログラマの負荷を軽減する目的で用いられる
支援システムである。
A device for automatically correcting an error in a source program is a support system used to reduce the load on a programmer when correcting an error in the source program, which is necessary when compiling the source program and generating a target program. is there.

【0004】このようなエラー自動修正装置の一つに、
特開平1‐307832号がある。ここに記載されたエ
ラー自動修正装置は、プログラマより原始プログラムを
入力する原始プログラム入力手段、入力された原始プロ
グラムを構文解析する構文解析手段、構文解析結果を出
力するコンパイル出力手段、目的プログラム作成手段、
原始プログラム修正手段、及びエラーの修正イメージを
格納した自動修正イメージ対応表から構成されている。
これによりプログラマーが入力した原始プログラムにエ
ラーが含まれていると、該エラー番号に基づいて自動修
正イメージ表が参照され、自動的に該エラーが修正され
る。
One of such automatic error correction devices is as follows.
There is JP-A-1-307832. The automatic error correcting device described herein includes a source program input unit for inputting a source program from a programmer, a syntax analysis unit for parsing the input source program, a compile output unit for outputting a syntax analysis result, and a target program creation unit. ,
It is composed of a source program correction means and an automatic correction image correspondence table storing error correction images.
Accordingly, if an error is included in the source program input by the programmer, the automatic correction image table is referred to based on the error number, and the error is automatically corrected.

【0005】[0005]

【発明が解決しようとする課題】しかし、前記従来のエ
ラー修正装置においては、対象のエラーがリカバリ可能
なエラーとしてあらかじめ対応表に登録されていない場
合には、例えそれが特定のプログラマーによって頻繁に
犯されるエラーであるとしても自動修正の対象にならな
いという問題があった。また、従来の装置では、あらか
じめ起こりうるエラーのパターンを1対1対応で辞書と
して登録しておく必要があり、そのパターンは非常に多
く、辞書の作成が困難であった。
However, in the above-described conventional error correction apparatus, if the target error is not registered in the correspondence table in advance as a recoverable error, it is frequently detected by a specific programmer. There was a problem that even if the error was committed, it would not be subject to automatic correction. Further, in the conventional apparatus, it is necessary to register in advance a pattern of possible errors in a one-to-one correspondence as a dictionary, and the number of such patterns is extremely large, making it difficult to create a dictionary.

【0006】本発明の目的は、プログラムのタイプミ
ス、文法ミス等のエラーの修正内容、方法の履歴をデー
タベース化したエラーの修正履歴を基に、自動的に修正
されるエラーの修正効率を改善することである。
SUMMARY OF THE INVENTION It is an object of the present invention to improve the efficiency of correcting errors that are automatically corrected based on the correction contents of errors such as program typographical errors and grammatical errors, and the history of methods in a database. It is to be.

【0007】本発明の別の目的は、自動修正された一つ
または複数の候補を表示し、プログラマに確認、選択さ
せることにより、原始プログラムのエラーを自動的に修
正するようにして、その修正効率を改善することであ
る。
Another object of the present invention is to automatically correct an error in a source program by displaying one or more automatically corrected candidates and allowing the programmer to confirm and select the corrected candidate. Improving efficiency.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
請求項1記載の本発明は、原始プログラムを目的プログ
ラムに変換すると共に、前記原始プログラムに誤りが含
まれている場合に、該誤りをその誤りの属性と共に出力
するコンパイル手段と、原始プログラム上で発生する誤
りに対する過去の修正情報を格納するエラー修正履歴格
納手段と、前記コンパイル手段により出力された誤り及
びその属性に基づいて、前記エラー修正履歴格納手段よ
り対応する修正情報を検索するエラー修正履歴検索手段
と、前記エラー修正履歴検索手段により検索された修正
情報に基づいて前記原始プログラムに修正を加える原始
プログラム修正手段とを備えることを特徴とする。
In order to achieve the above object, the present invention according to claim 1 converts a source program into a target program and, when the source program contains an error, corrects the error. Compiling means for outputting together with the attribute of the error, error correction history storing means for storing past correction information for errors occurring in the source program, and the error based on the error and the attribute output by the compiling means. Error correction history search means for searching the corresponding correction information from the correction history storage means; and source program correction means for correcting the source program based on the correction information searched by the error correction history search means. Features.

【0009】また、請求項2記載の本発明は、前記請求
項1記載の発明において、前記エラー修正履歴検索手段
による検索結果を前記原始プログラム上に反映して文法
解析を行なうことにより、エラーの修正が可能か否かを
判断するエラー自動修正手段と、該エラー自動修正手段
により修正が可能と判断された場合に、前記修正情報を
格納する修正候補格納手段と、該エラー自動修正手段に
より修正が不可能と判断された場合に、前記修正情報を
格納する修正不可候補格納手段とを備えたことを特徴と
する。
According to a second aspect of the present invention, in accordance with the first aspect of the present invention, a grammar analysis is performed by reflecting a search result by the error correction history search means on the source program. Automatic error correction means for determining whether correction is possible, correction candidate storage means for storing the correction information when the automatic error correction means determines that correction is possible, and correction by the automatic error correction means And a correction-impossible candidate storage means for storing the correction information when it is determined that the correction is impossible.

【0010】また、請求項3記載の本発明は、前記請求
項1又は2記載の発明において、前記エラー修正履歴検
索手段により複数の修正候補が検索された場合に、これ
らを表示する修正候補表示手段と、使用者により前記表
示された修正候補を選択可能にさせる修正候補選択手段
とを備え、前記原始プログラム修正手段は、前記修正候
補選択手段により選択された修正候補に基づいて前記原
始プログラムに修正を加えることを特徴とする。
According to a third aspect of the present invention, in the first or the second aspect of the present invention, when a plurality of correction candidates are searched by the error correction history search means, these are displayed. Means, and a correction candidate selection means for allowing the user to select the displayed correction candidate, wherein the source program correction means, based on the correction candidate selected by the correction candidate selection means, in the source program It is characterized by making modifications.

【0011】また、請求項4記載の本発明は、原始プロ
グラム上で発生する誤りに対する過去の修正情報を格納
するエラー修正履歴格納手段を準備する工程と、原始プ
ログラムを目的プログラムに変換すると共に、前記原始
プログラムに誤りが含まれている場合に、該誤りをその
誤りの属性と共に出力する工程と、前記出力された誤り
及びその属性に基づいて、前記エラー修正履歴格納手段
より対応する修正情報を検索する工程と、前記検索され
た修正情報に基づいて前記原始プログラムに修正を加え
る工程とを備えることを特徴とする。
According to a fourth aspect of the present invention, there is provided a process for preparing error correction history storage means for storing past correction information for an error occurring in a source program, converting the source program into a target program, Outputting an error together with the attribute of the error when the source program contains an error; and outputting the corresponding correction information from the error correction history storage unit based on the output error and the attribute. A search step; and a step of modifying the source program based on the retrieved modification information.

【0012】また、請求項5記載の本発明は、請求項4
記載の発明において、前記修正情報を検索する工程の後
に、前記検索結果を前記原始プログラム上に反映して文
法解析を行なうことにより、エラーの修正が可能か否か
を判断する工程と、前記修正が可能と判断された場合
に、前記修正情報を修正候補格納手段に格納すると共
に、前記修正が不可能と判断された場合に、前記修正情
報を修正不可候補格納手段に格納する工程とを備えたこ
とを特徴とする。
The present invention according to claim 5 provides the present invention according to claim 4.
In the invention described above, after the step of searching for the correction information, a step of determining whether an error can be corrected by reflecting the search result on the source program and performing a grammatical analysis, Storing the correction information in the correction candidate storage means when it is determined that the correction is possible, and storing the correction information in the correction impossible candidate storage means when the correction is determined to be impossible. It is characterized by having.

【0013】さらに、請求項6記載の本発明は、前記原
始プログラム修正を加える工程の前に、前記修正情報を
検索した結果、複数の修正候補が検索された場合に、こ
れらを表示する工程と、使用者により前記表示された修
正候補を選択させる工程と、を備え、前記選択された修
正候補に基づいて前記原始プログラムに修正を加えるこ
とを特徴とする。
Further, according to the present invention, when a plurality of correction candidates are found as a result of searching the correction information before the step of adding the source program correction, a step of displaying these is provided. And allowing the user to select the displayed correction candidate, wherein the correction is made to the source program based on the selected correction candidate.

【0014】[0014]

【発明の実施の形態】次に、本発明の実施形態について
図面を参照して詳細に説明する。
Next, an embodiment of the present invention will be described in detail with reference to the drawings.

【0015】図1は、本発明に係るエラー自動修正装置
の構成を、これによる原始プログラムの修正が行なわれ
るプロセスと共に示している。図1においてエラー自動
修正装置は、コンパイル部102(又は112)、エラ
ー解析部104、エラー修正履歴検索部105、エラー
修正履歴辞書106、エラー自動修正手段107、修正
候補格納ファイル108、自動修正不可格納ファイル1
09及び原始プログラム修正部110を備えて構成され
ている。
FIG. 1 shows a configuration of an automatic error correcting apparatus according to the present invention, together with a process in which a source program is corrected. In FIG. 1, the automatic error correction device includes a compiling unit 102 (or 112), an error analysis unit 104, an error correction history search unit 105, an error correction history dictionary 106, an automatic error correction unit 107, a correction candidate storage file 108, and an automatic correction impossible. Storage file 1
09 and a source program correcting unit 110.

【0016】コンパイル部102は、入力された原始プ
ログラム101を目的プログラムに変換、すなわちコン
パイルするものでる。そして、当該変換において、原始
プログラム101内にタイプミスや文法ミスが存在する
と、コンパイル部102はエラーリスト103を出力す
る。エラー解析部104は、出力されたエラーリスト1
03を入力し、これを解析する。すなわち、エラー解析
部104によってエラーリスト103から、エラーコー
ド、エラーとなった命令やオペランドなどが得られる。
The compiling section 102 converts the input source program 101 into a target program, that is, compiles the target program. Then, in the conversion, if there is a typing mistake or a grammatical mistake in the source program 101, the compiling unit 102 outputs an error list 103. The error analysis unit 104 outputs the error list 1
Enter 03 and analyze it. In other words, the error analysis unit 104 obtains an error code, an error instruction, an operand, and the like from the error list 103.

【0017】エラー修正履歴検索部105は、エラー解
析部104で解析されたエラーコードをキーとして、エ
ラー修正履歴辞書106に対し、過去に同様のエラーの
修正が行われたかどうかを検索する。ここで、エラー修
正履歴辞書106には、エラーコード、エラーの種類、
オペランド、修正方法、修正後のテキスト等の過去に修
正したエラーに関する情報が格納されている。エラー自
動修正部107は、エラー修正履歴検索部105により
検索された結果を基にし、エラーの修正を行い、文法上
のエラーが無く修正が行われたものを修正候補格納ファ
イル108に格納し、また修正不可能と判断されたエラ
ーを自動修正不可格納ファイル109に格納する。これ
によって修正候補格納ファイル108には、自動修正さ
れた結果の情報が格納され、また自動修正不可格納ファ
イル109には、エラーを自動的に修正できないエラー
が格納されることとなる。
The error correction history search unit 105 searches the error correction history dictionary 106 for similar errors in the past using the error code analyzed by the error analysis unit 104 as a key. Here, the error correction history dictionary 106 stores an error code, an error type,
Information about errors corrected in the past, such as operands, correction methods, and corrected text, is stored. The error automatic correction unit 107 corrects the error based on the result searched by the error correction history search unit 105, stores the corrected data without any grammatical error in the correction candidate storage file 108, In addition, an error determined to be uncorrectable is stored in the automatic uncorrectable storage file 109. As a result, information on the result of automatic correction is stored in the correction candidate storage file 108, and an error whose error cannot be automatically corrected is stored in the automatic correction impossible storage file 109.

【0018】原始プログラム修正部110では、エラー
自動修正部107で行われた修正を原始プログラム10
1に反映し、自動修正された原始プログラム111を得
る。原始プログラム修正部110により、エラー修正さ
れた原始プログラム111は、通常の原始プログラムの
ように再びコンパイル部112によりコンパイルされ、
目的プログラム113が生成される。
In the source program correcting unit 110, the correction performed by the error automatic correcting unit 107 is applied to the source program 10.
1 to obtain a source program 111 automatically corrected. The source program 111 whose error has been corrected by the source program correcting unit 110 is again compiled by the compiling unit 112 like a normal source program.
The target program 113 is generated.

【0019】次に、図1を参照して、本発明の実施の形
態の動作について説明する。プログラマーによって作成
された原始プログラム101は、一般にコンパイラと呼
ばれるコンパイル部102によってコンパイルされ、こ
れにより発生したエラーはエラーリスト103として出
力される。エラーリスト103を入力として、エラー解
析部104では、エラーコード、エラーの種類、エラー
の発生位置、エラーの原因となるオペランドや命令等の
原因部分等を解析する。エラー解析部104において解
析された情報をキーとして、エラー修正履歴検索部10
5では、過去に犯したエラーに対する修正方法などの情
報が記録されているエラー修正履歴辞書106より、過
去に同様のエラーを犯したことがあるかどうかを検索す
る。これによりエラーの修正情報がエラー修正履歴辞書
106に存在する場合には、エラーに対する修正方法な
どの情報を得ることができる。
Next, the operation of the embodiment of the present invention will be described with reference to FIG. A source program 101 created by a programmer is compiled by a compiling unit 102 generally called a compiler, and an error generated by the compilation is output as an error list 103. With the error list 103 as an input, the error analysis unit 104 analyzes an error code, an error type, an error occurrence position, a cause part of an operand or an instruction that causes an error, and the like. Using the information analyzed by the error analysis unit 104 as a key, the error correction history search unit 10
In step 5, a search is made from the error correction history dictionary 106 in which information such as a method of correcting an error committed in the past is recorded to determine whether a similar error has been committed in the past. Thus, when the error correction information exists in the error correction history dictionary 106, information such as a correction method for the error can be obtained.

【0020】得られた情報を基に、エラー自動修正部1
07において文法チェックを行いながら修正を行い、そ
の情報は修正候補格納ファイル108に格納される。ま
た、エラーの自動修正が行えなかった場合においては、
その情報は自動修正不可格納ファイル109に格納され
る。原始プログラム修正部110では、エラー自動修正
部107において修正、編集された結果を原始プログラ
ム110に反映し、エラーが修正された原始プログラム
111が生成される。修正された原始プログラム111
は、コンパイル部112において再度コンパイルされ、
目的プログラム113が得られる。
Based on the obtained information, an automatic error correcting unit 1
At 07, a correction is made while performing a grammar check, and the information is stored in a correction candidate storage file 108. If the error cannot be automatically corrected,
The information is stored in the uncorrectable storage file 109. In the source program correcting unit 110, the result corrected and edited by the automatic error correcting unit 107 is reflected in the source program 110, and the source program 111 in which the error is corrected is generated. The modified source program 111
Are recompiled in the compiling unit 112,
The target program 113 is obtained.

【0021】ここで、コンパイルにより発生したエラー
は、エラー修正履歴辞書106を利用することにより、
これが過去に犯したエラーと同じなら、プログラマが原
始プログラムを修正することなく自動的に修正されるこ
ととなる。このため、エラーの原因解明に掛かる時間、
労力を削減することができ、生産性が向上する。また、
従来のエラーリストとマニュアル類を確認しながら、原
始プログラムを修正する必要がない。このため、エラー
を修正する時間と労力を削減する事ができ、生産性が向
上する。
Here, the error generated by the compilation is determined by using the error correction history dictionary 106.
If this is the same error you made in the past, the programmer will automatically fix it without having to modify the source program. Because of this, the time it takes to determine the cause of the error,
Labor can be reduced, and productivity can be improved. Also,
There is no need to modify the source program while checking the conventional error list and manuals. Therefore, the time and labor for correcting the error can be reduced, and the productivity is improved.

【0022】さらに、エラーが発生した部分を修正する
場合、従来ではプログラマーが原始プログラム中よりエ
ラーの発生した場所を特定し修正していたため、エラー
の発生していない部分を勘違いして修正するというミス
が起こることがあるが、本発明では、エラーの発生した
場所を自動的に修正するため、このようなミスの発生が
防止される。
Further, when correcting a portion where an error has occurred, conventionally, since the programmer has specified and corrected the location where the error occurred in the source program, the portion where the error did not occur was corrected by mistake. Although a mistake may occur, the present invention prevents such a mistake from occurring because the location where the error has occurred is automatically corrected.

【0023】次に図2〜図5に沿って、修正が必要な原
始プログラムが本発明によって修正される手順について
さらに具体的に説明する。図2は、修正が必要な、すな
わちタイプミスを含む原始プログラムの一部を示したも
のであり、図3は図2の原始プログラムをコンパイルし
た結果、出力されたエラーリストである。また、図4
は、エラー修正履歴辞書106に格納されたエラー修正
履歴である。この例では、発生したエラーコード、エラ
ーを起こしたエラーテキスト、及びどのように修正した
かを表す修正動作、修正個所、修正テキストが、過去に
修正した履歴として記録されている。図5は、本発明に
より修正された、図2の原始プログラムである。
Next, with reference to FIGS. 2 to 5, a procedure in which a source program that needs to be corrected is corrected by the present invention will be described more specifically. FIG. 2 shows a part of a source program that needs to be corrected, that is, includes a typo. FIG. 3 shows an error list output as a result of compiling the source program of FIG. FIG.
Is an error correction history stored in the error correction history dictionary 106. In this example, the error code that occurred, the error text that caused the error, and the correction operation, correction location, and correction text indicating how the correction was made are recorded as a history of past correction. FIG. 5 is the source program of FIG. 2 modified according to the present invention.

【0024】いま、図2の原始プログラムをコンパイル
することにより、図3に示すように、3つのエラーA
2、B2、C2が得られている。ここで、最初のエラー
A2は、図2におけるA1のPurintの部分である。ま
た、2番目のエラーB2はB1のsStringの部分であ
り、最後のエラーC2はC1のnCountの部分である。
Now, by compiling the source program shown in FIG. 2, three errors A are generated as shown in FIG.
2, B2 and C2 are obtained. Here, the first error A2 is the Purint part of A1 in FIG. The second error B2 is the sString part of B1, and the last error C2 is the nCount part of C1.

【0025】エラー解析部104では、図3のエラーリ
ストを入カし、発生したエラーコード、及びエラーテキ
ストが抽出され、エラー修正履歴検索部105に渡され
る。すなわちエラーA2からは、S012、Purintとい
う情報が抽出され、エラー修正履歴検索部105に渡さ
れる。この情報を基にエラー修正履歴検索部105で
は、図4の修正履歴辞書106中に修正履歴の情報を検
索する。図3のエラーA2、B2、C2より、図4に示
すように、対応する3つの履歴A3、B3、C3が検索
される。
The error analysis unit 104 receives the error list shown in FIG. 3, extracts the generated error code and error text, and transfers them to the error correction history search unit 105. That is, information S012 and Purint are extracted from the error A2, and are passed to the error correction history search unit 105. Based on this information, the error correction history search unit 105 searches for correction history information in the correction history dictionary 106 of FIG. Based on the errors A2, B2, and C2 in FIG. 3, three corresponding histories A3, B3, and C3 are searched as shown in FIG.

【0026】この修正履歴情報により、原始プログラム
修正部110では、図5の修正A4、B4、C4のよう
に、原始プログラムに修正が加えられる。すなわち、図
2の原始プログラムに対し、”Purint”は”Print”に
置き換えられ(修正A4)、変数”nCount”の型は、St
ring型からNumber型へ置き換えられ(B4)、さらに変
数”sString”のString型による型宣言が追加された。
Based on the correction history information, the source program correction unit 110 corrects the source program, as shown by corrections A4, B4, and C4 in FIG. That is, in the source program of FIG. 2, "Purint" is replaced with "Print" (modification A4), and the type of the variable "nCount" is St.
The ring type was replaced with the Number type (B4), and a type declaration using the String type of the variable "sString" was added.

【0027】次に、本発明他の実施の形態について、図
6を参照して説明する。図6に示す本実施形態は、先の
実施形態に対し、原始プログラム修正部610の構成に
ついて異なっており、他の構成部分は共通である。以下
では、原始プログラム修正部610の構成についてのみ
説明し、他の構成部分についての説明は省略する。
Next, another embodiment of the present invention will be described with reference to FIG. The present embodiment shown in FIG. 6 is different from the previous embodiment in the configuration of the source program modifying unit 610, and the other components are common. Hereinafter, only the configuration of the source program modifying unit 610 will be described, and description of other components will be omitted.

【0028】図6を参照すると、原始プログラム修正部
110は、修正された結果を表示するためのディスプレ
イやプリンタ装置等の修正結果表示部6101と、自動
修正された結果の承認や複数有る修正候補を選択するた
めのキーボード等の修正候補選択部6102と、自動修
正不可能のものや自動修正ではなくプログラムがコーデ
ィングによる修正を行うためのキーボード等の修正入力
部6103と、図1の原始プログラム修正部110に相
応する原始プログラム修正手段6104からなる。
Referring to FIG. 6, a source program correcting unit 110 includes a correction result display unit 6101 such as a display or a printer for displaying the corrected result, an approval of the automatically corrected result, and a plurality of correction candidates. 1 and a correction input unit 6103 such as a keyboard or the like that is not automatically correctable or a program that corrects by coding instead of automatic correction, and a source program correction of FIG. It comprises a source program modifying means 6104 corresponding to the section 110.

【0029】エラー修正履歴検索部605において、エ
ラー修正履歴辞書606中に複数のエラー修正方法が検
索された場合、複数の修正候補を修正結果表示部610
1に示すことによりプログラマーは修正候補選択部61
02によって正しい修正方法を選択できる。また、自動
修正不可能のエラーが修正結果表示部6101で示され
た場合には、プログラマーは、修正入力部6103によ
り通常の修正方法と同様に修正を行なうことができる。
When the error correction history search unit 605 searches for a plurality of error correction methods in the error correction history dictionary 606, a plurality of correction candidates are displayed in a correction result display unit 610.
1, the programmer can select the correction candidate selecting unit 61.
02 allows a correct correction method to be selected. When an error that cannot be automatically corrected is displayed on the correction result display section 6101, the programmer can make corrections using the correction input section 6103 in the same manner as a normal correction method.

【0030】[0030]

【発明の効果】以上の如く本発明によれば、過去におい
て発生したエラーに対しての修正方法等の情報を記録し
たエラー修正履歴辞書に従って原始プログラム上のミス
が自動的に修正されるので、原始プログラムの修正に費
やされる時間、労力が削減できる。
As described above, according to the present invention, errors in a source program are automatically corrected according to an error correction history dictionary in which information such as a correction method for an error that occurred in the past is recorded. The time and effort spent on modifying the source program can be reduced.

【0031】また、従来のエラー修正のように、プログ
ラマーが原始プログラムの修正すべき場所を探して修正
する必要がないため、エラーの発生していない場所を誤
って修正してしまうことがなくなり、その結果、エラー
の修正精度を向上できる。
Further, unlike the conventional error correction, the programmer does not need to find and correct a location where the source program should be corrected, so that a location where no error occurs is not erroneously corrected. As a result, the accuracy of error correction can be improved.

【0032】さらに、本発明では、過去に犯したことの
あるミスに対しての修正方法等の情報がエラー修正履歴
辞書に記録されているため、同様のミスに対しては自動
修正が確実に行なわれ、その結果、エラーを自動修正で
きる確率が高い。
Further, according to the present invention, information such as a correction method for a mistake made in the past is recorded in the error correction history dictionary. As a result, there is a high probability that the error can be automatically corrected.

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

【図1】本発明の一実施形態に係るエラー自動修正装置
の構成を、これによる原始プログラムの修正が行なわれ
るプロセスと共に示した図である。
FIG. 1 is a diagram showing a configuration of an automatic error correction device according to an embodiment of the present invention, together with a process in which a source program is corrected.

【図2】ミスを含む原始プログラムの一例である。FIG. 2 is an example of a source program including a mistake.

【図3】図2の原始プログラムに対するエラーリストで
ある。
FIG. 3 is an error list for the source program of FIG. 2;

【図4】エラー修正履歴辞書に蓄積された情報の一例で
ある。
FIG. 4 is an example of information stored in an error correction history dictionary.

【図5】図2の原始プログラムに自動修正を加えた後の
原始プログラムである。
FIG. 5 is a source program after the source program of FIG. 2 is automatically corrected.

【図6】本発明の他の実施形態における図1の対応図で
ある。
FIG. 6 is a diagram corresponding to FIG. 1 in another embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101 原始プログラム 102 コンパイル部 103 エラーリスト 104 エラー解析部 105 エラー修正履歴検索部 106 エラー修正履歴辞書 107 エラー自動修正部 108 修正候補格納ファイル 109 自動修正不可格納ファイル 110 原始プログラム修正部 113 目的プログラム 101 Source Program 102 Compiling Unit 103 Error List 104 Error Analysis Unit 105 Error Correction History Search Unit 106 Error Correction History Dictionary 107 Error Automatic Correction Unit 108 Correction Candidate Storage File 109 Automatic Correction Disabled Storage File 110 Source Program Correction Unit 113 Target Program

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 原始プログラムを目的プログラムに変換
すると共に、前記原始プログラムに誤りが含まれている
場合に、該誤りをその誤りの属性と共に出力するコンパ
イル手段と、 原始プログラム上で発生する誤りに対する過去の修正情
報を格納するエラー修正履歴格納手段と、 前記コンパイル手段によって出力された誤り及びその属
性に基づいて、前記エラー修正履歴格納手段より対応す
る修正情報を検索するエラー修正履歴検索手段と、 前記エラー修正履歴検索手段により検索された修正情報
に基づいて前記原始プログラムに修正を加える原始プロ
グラム修正手段と、 を備えたことを特徴とする原始プログラムのエラー自動
修正装置。
1. A compiling means for converting a source program into a target program and, when the source program contains an error, outputting the error together with an attribute of the error; Error correction history storage means for storing past correction information; error correction history search means for searching for corresponding correction information from the error correction history storage means based on the errors and their attributes output by the compiling means; A source program correcting unit that corrects the source program based on the correction information searched by the error correction history searching unit;
【請求項2】 前記エラー修正履歴検索手段による検索
結果を前記原始プログラム上に反映して文法解析を行な
うことにより、エラーの修正が可能か否かを判断するエ
ラー自動修正手段と、 該エラー自動修正手段により修正が可能と判断された場
合に、前記修正情報を格納する修正候補格納手段と、 該エラー自動修正手段により修正が不可能と判断された
場合に、前記修正情報を格納する修正不可候補格納手段
と、 を備えたことを特徴とする請求項1に記載の原始プログ
ラムのエラー自動修正装置。
2. An automatic error correction means for determining whether an error can be corrected by reflecting a search result by the error correction history search means on the source program and performing a grammatical analysis, and Correction candidate storage means for storing the correction information when the correction means determines that the correction is possible; and correction impossible for storing the correction information when the error automatic correction means determines that the correction is not possible. The apparatus according to claim 1, further comprising: a candidate storage unit.
【請求項3】 前記エラー修正履歴検索手段により複数
の修正候補が検索された場合に、これらを表示する修正
候補表示手段と、 使用者による前記表示された修正候補の選択を可能にさ
せる修正候補選択手段とを備え、 前記原始プログラム修正手段は、前記修正候補選択手段
により選択された修正候補に基づいて前記原始プログラ
ムに修正を加えることを特徴とする請求項1又は請求項
2に記載の原始プログラムのエラー自動修正装置。
3. When a plurality of correction candidates are searched by the error correction history search means, a correction candidate display means for displaying them is provided, and a correction candidate for enabling a user to select the displayed correction candidates. 3. The source program according to claim 1, further comprising a selection unit, wherein the source program correction unit corrects the source program based on a correction candidate selected by the correction candidate selection unit. 4. Automatic error correction device for programs.
【請求項4】 原始プログラム上で発生する誤りに対す
る過去の修正情報を格納するエラー修正履歴格納手段を
準備する工程と、 原始プログラムを目的プログラムに変換すると共に、前
記原始プログラムに誤りが含まれている場合に、該誤り
をその誤りの属性と共に出力する工程と、 前記出力された誤り及びその属性に基づいて、前記エラ
ー修正履歴格納手段より対応する修正情報を検索する工
程と、 前記検索された修正情報に基づいて、前記原始プログラ
ムに修正を加える工程とを備えたことを特徴とする原始
プログラムのエラー自動修正方法。
4. A step of preparing error correction history storage means for storing past correction information for errors occurring in the source program; and converting the source program into a target program, and including an error in the source program. Outputting the error together with the attribute of the error, and searching for the corresponding correction information from the error correction history storage unit based on the output error and the attribute. Correcting the source program based on the correction information.
【請求項5】 前記修正情報を検索する工程の後に、 前記検索結果を前記原始プログラム上に反映して文法解
析を行なうことにより、エラーの修正が可能か否かを判
断する工程と、 前記修正が可能と判断された場合に、前記修正情報を修
正候補格納手段に格納すると共に、前記修正が不可能と
判断された場合に、前記修正情報を修正不可候補格納手
段に格納する工程と、 を備えたことを特徴とする請求項4に記載の原始プログ
ラムのエラー自動修正方法。
5. A step of, after the step of searching for the correction information, determining whether or not an error can be corrected by reflecting the search result on the source program and performing a grammatical analysis; Storing the correction information in the correction candidate storage means when it is determined that the correction information is possible, and storing the correction information in the correction impossible candidate storage means when the correction is determined to be impossible. 5. The method according to claim 4, further comprising the steps of:
【請求項6】 前記原始プログラム修正を加える工程の
前に、 前記修正情報を検索した結果、複数の修正候補が検索さ
れた場合に、これらを表示する工程と、 使用者により前記表示された修正候補を選択させる工程
とを備え、 前記選択された修正候補に基づいて前記原始プログラム
に修正を加えることを特徴とする請求項4又は請求項5
に記載の原始プログラムのエラー自動修正方法。
6. A step of displaying, when a plurality of correction candidates are found as a result of searching the correction information before the step of adding the source program correction, displaying the plurality of correction candidates; 6. A step of selecting a candidate, wherein the source program is modified based on the selected modification candidate.
Automatic correction method of source program error described in.
JP9267954A 1997-09-12 1997-09-12 Device and method for automatically correcting error of source program Pending JPH1185536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9267954A JPH1185536A (en) 1997-09-12 1997-09-12 Device and method for automatically correcting error of source program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9267954A JPH1185536A (en) 1997-09-12 1997-09-12 Device and method for automatically correcting error of source program

Publications (1)

Publication Number Publication Date
JPH1185536A true JPH1185536A (en) 1999-03-30

Family

ID=17451912

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9267954A Pending JPH1185536A (en) 1997-09-12 1997-09-12 Device and method for automatically correcting error of source program

Country Status (1)

Country Link
JP (1) JPH1185536A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008020972A (en) * 2006-07-11 2008-01-31 Hitachi Ltd Software analysis system
JP2012248050A (en) * 2011-05-30 2012-12-13 Nec Commun Syst Ltd Static analysis support device, static analysis support method, and program
JP2015026365A (en) * 2013-07-26 2015-02-05 富士通株式会社 Method and apparatus for porting source code
JP2018084939A (en) * 2016-11-22 2018-05-31 富士通株式会社 Correction support program, correction support method, correction support device, and compiler

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0695889A (en) * 1991-12-13 1994-04-08 Hokkaido Nippon Denki Software Kk Program correction system
JPH07311679A (en) * 1994-05-19 1995-11-28 Oki Electric Ind Co Ltd Program generation system
JPH09185500A (en) * 1995-12-28 1997-07-15 Nec Corp Device and method for automatically correcting source program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0695889A (en) * 1991-12-13 1994-04-08 Hokkaido Nippon Denki Software Kk Program correction system
JPH07311679A (en) * 1994-05-19 1995-11-28 Oki Electric Ind Co Ltd Program generation system
JPH09185500A (en) * 1995-12-28 1997-07-15 Nec Corp Device and method for automatically correcting source program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008020972A (en) * 2006-07-11 2008-01-31 Hitachi Ltd Software analysis system
JP2012248050A (en) * 2011-05-30 2012-12-13 Nec Commun Syst Ltd Static analysis support device, static analysis support method, and program
JP2015026365A (en) * 2013-07-26 2015-02-05 富士通株式会社 Method and apparatus for porting source code
JP2018084939A (en) * 2016-11-22 2018-05-31 富士通株式会社 Correction support program, correction support method, correction support device, and compiler
US10402304B2 (en) 2016-11-22 2019-09-03 Fujitsu Limited Non-transitory computer-readable storage medium, correction support method and correction support device

Similar Documents

Publication Publication Date Title
US6115544A (en) Method and system for displaying error messages
US20040049768A1 (en) Method and program for compiling processing, and computer-readable medium recoding the program thereof
JPS6375835A (en) Apparatus for generating intended code, program, list and design document
CN108762743B (en) Data table operation code generation method and device
US7346488B2 (en) Automatic translator and computer-readable storage medium having automatic translation program recorded thereon
JP2004220616A (en) Machine translation system for simultaneously displaying and editing three or more parallel translation screens
JP5369565B2 (en) Program error information output device, error information output method, and error information output program
JP2007128123A (en) Influential range extraction system
JPH1185536A (en) Device and method for automatically correcting error of source program
CN116360794A (en) Database language analysis method, device, computer equipment and storage medium
Kulkarni et al. Automatic Syntax Error Correction
JPH09185500A (en) Device and method for automatically correcting source program
US10402304B2 (en) Non-transitory computer-readable storage medium, correction support method and correction support device
JPH01307832A (en) System for automatically correcting grammatical error of source program in compiler
JP2007199800A (en) Degradation prevention support program and degradation prevention support method
JP2870375B2 (en) Sentence correction device
JPH06131232A (en) Multiple definition correction assisting device for data dictionary
JPWO2009038209A1 (en) Machine translation system, machine translation method, and machine translation program
JPH11154093A (en) Program compiler and storage medium recording compiler program
JP2004206501A (en) Error message output control system and method, and compiler
JP4111941B2 (en) Apparatus, method and program for converting lexical data to data
JPH04158477A (en) Machine translation device
JPH05127888A (en) Automatic build-in system for message output function
JPH05158667A (en) Program maintenance assistance device
JP2000132405A (en) In-line expansion processing device and method