JP2010067103A - Error information output device, error information output method and error output program for program - Google Patents

Error information output device, error information output method and error output program for program Download PDF

Info

Publication number
JP2010067103A
JP2010067103A JP2008234089A JP2008234089A JP2010067103A JP 2010067103 A JP2010067103 A JP 2010067103A JP 2008234089 A JP2008234089 A JP 2008234089A JP 2008234089 A JP2008234089 A JP 2008234089A JP 2010067103 A JP2010067103 A JP 2010067103A
Authority
JP
Japan
Prior art keywords
error
program
correction
information
cause
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.)
Granted
Application number
JP2008234089A
Other languages
Japanese (ja)
Other versions
JP5369565B2 (en
Inventor
Shunsuke Tayama
俊介 田山
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 JP2008234089A priority Critical patent/JP5369565B2/en
Publication of JP2010067103A publication Critical patent/JP2010067103A/en
Application granted granted Critical
Publication of JP5369565B2 publication Critical patent/JP5369565B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To obtain an error information output device, an error information output method and an error information output program of a program for improving the efficiency of the correcting operation of an error on the description of a program. <P>SOLUTION: This error information correction device for correcting the error of a program is configured to read a source code 105 by a source code reading part 106, and to analyze a syntax by a syntax analyzing part 107, and to detect an error on description. An error information analyzing part 108 analyzes an error other than the error clarified in the past by a source correction information database 109 by a factor, and performs temporary correction so that an error can be prevented from being detected from the analytic result, and stores temporary correction in a correctable information storage region 113<SB>1</SB>, and stores an uncorrectable error in an uncorrectable information storage region 113<SB>2</SB>, and performs error display. Thus, the error display can be simplified and the correction of the error stored in the correctable information storage region 113<SB>1</SB>can be simplified. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、コンパイラがソースコードの誤りを検出したときのようにプログラムの記述に誤りがあったときにエラー情報を出力するエラー情報出力装置、エラー情報出力方法およびエラー情報出力プログラムに関する。   The present invention relates to an error information output device, an error information output method, and an error information output program that output error information when there is an error in the description of a program, such as when a compiler detects an error in source code.

コンパイラを例に挙げて説明する。コンパイラは解釈するソースコードの文法を静的にチェックする。そして、機械語コードに変換する際に誤りが存在すれば、コンパイルエラーとして、それらコードの記述された行に対応付けてエラーメッセージを表示するようになっている。   A description will be given using a compiler as an example. The compiler statically checks the grammar of the source code it interprets. If there is an error when converting to the machine language code, an error message is displayed as a compile error in association with the line in which the code is described.

ところで、ソースコードを作成したときには、その複数の箇所で同一の誤りが繰り返されることが多い。たとえば、ソースコードの記述の際に、ある変数の定義についての記述を忘れたり、その記述が誤っていたとする。すると、その定義を参照する記述が生じるたびに、参照先の定義が存在しないというエラーが発生する。   By the way, when a source code is created, the same error is often repeated at a plurality of locations. For example, when describing source code, suppose that you forget to describe a variable definition or that the description is incorrect. Then, whenever a description that refers to the definition occurs, an error occurs that the definition of the reference destination does not exist.

このような場合、本発明の第1の関連技術では、本来1つの原因で発生したエラーであるにも係らず、ソースコードにおける同一の定義を参照する多くの行で同一のエラーの表示が行われている(たとえば特許文献1参照)。この結果として、このエラーとは別のエラーがソースコードに存在していても、前者のエラーを示す多くのエラー表示の中に後者のエラー表示が埋もれてしまい、後者のエラー自体を見過ごしてしまう場合があった。また、この第1の関連技術では、エラー情報の整理の手法としてニューラルネットワークの出力を用いている。しかしながら、エラーに対する出力の態様について具体的な開示がなく、その実現性が低い。   In such a case, the first related technique of the present invention displays the same error in many lines that refer to the same definition in the source code, even though the error originally occurred due to one cause. (For example, refer to Patent Document 1). As a result, even if an error other than this error exists in the source code, the latter error display is buried in many error displays indicating the former error, and the latter error itself is overlooked. There was a case. In the first related technique, the output of a neural network is used as a method for organizing error information. However, there is no specific disclosure about the output mode for errors, and its feasibility is low.

そこで、本発明の第2の関連技術として、エラー表示の中で必要なもののみを行うことにして、表示を簡素にする提案が行われている(たとえば特許文献2参照)。この第2の関連技術では、修正したエラーの内容を保存しておく。そして、その行以降の行の同一のエラーが発生している場合には、そのエラー表示の代わりに予め定めた「@」等のマークの表示を行うか、その表示を削除するようにしている。   Thus, as a second related technique of the present invention, a proposal has been made to simplify the display by performing only the necessary error display (see, for example, Patent Document 2). In the second related technique, the contents of the corrected error are stored. If the same error has occurred in the lines after that line, instead of displaying the error, a predetermined mark such as “@” is displayed or the display is deleted. .

ところで、プログラムの記述の誤りに対するエラー表示は、プログラムの製作者に修正を行わせるためにある。本発明の第3の関連技術では、プログラムの記述中のエラーを単に表示するだけでなく、エラーを構文解析するようになっている。そして、エラーの種類を表示し、可能な場合にはエラーの修正を自動的に行うようになっている(たとえば特許文献3参照)。   By the way, an error display for an error in the description of the program is for the program creator to make corrections. In the third related technique of the present invention, not only the error in the description of the program is displayed but also the error is parsed. The type of error is displayed, and if possible, the error is automatically corrected (see, for example, Patent Document 3).

この第3の関連技術では、プログラム上で発生する誤りに対する過去の修正情報をエラー修正履歴格納手段に格納しておく。また、プログラムに過去の修正箇所と同一の誤りが存在した場合には、誤りごとにそれらの属性を表示するようにしている。そして、エラー修正履歴格納手段に格納したエラーと同一のエラーがプログラム中に存在した場合には、該当するプログラムに修正を加える。また、エラー修正履歴格納手段に格納されていないエラーが発生した場合には、これをそのエラーの属性と共に出力するようになっている。   In the third related technique, past correction information for errors occurring in the program is stored in the error correction history storage means. In addition, when there are errors in the program that are the same as those of past corrections, their attributes are displayed for each error. If the same error as the error stored in the error correction history storage means exists in the program, the corresponding program is corrected. In addition, when an error that is not stored in the error correction history storage means occurs, this is output together with the attribute of the error.

ところが、このようにエラー修正履歴格納手段を用いて過去に修正したエラーをプログラムの記述中に表示しないようにしても、記述されたプログラムの内容によってはエラー表示が依然として多発する場合がある。そこで、本発明の第4の関連技術では、エラーの構文解析の結果として、プログラムの修正自体が不要な特定の種類のエラーメッセージについては、エラー表示を回避するようにしている(たとえば特許文献4参照)。
特開平04−365134号公報(第0008段落、第0009段落、図1) 特開平09−016437号公報(第0014〜第0018段落、図2、図3) 特開平11−085536号公報(第0008段落、第0011段落、図6) 特開2004−206501号公報(第0006段落、第0007段落、図1)
However, even if errors corrected in the past using the error correction history storage means are not displayed in the program description, error display may still occur frequently depending on the contents of the described program. Therefore, in the fourth related technique of the present invention, error display is avoided for a specific type of error message that does not require program correction as a result of error parsing (for example, Patent Document 4). reference).
JP 04-365134 A (paragraphs 0008 and 0009, FIG. 1) Japanese Unexamined Patent Publication No. 09-016437 (paragraphs 0014 to 0018, FIGS. 2 and 3) JP-A-11-085536 (paragraphs 0008 and 0011, FIG. 6) Japanese Patent Laying-Open No. 2004-206501 (paragraphs 0006 and 0007, FIG. 1)

この第4の関連技術によって、プログラムの修正が不要である事が既知なエラーメッセージの出力を効率的に回避することができるので、エラー原因の調査作業に要する負荷を軽減することができる。   According to the fourth related technique, it is possible to efficiently avoid the output of an error message that is known to require no program correction, and therefore it is possible to reduce the load required for investigating the cause of the error.

しかしながら、この第4の関連技術によってもエラー修正履歴格納手段にある程度の履歴情報が格納されるまでは、プログラムの記述された場所に多くのエラー表示が行われる可能性が高い。したがって、たとえば新たなプログラムの記述に対してエラーの修正を開始しようとする場合に、エラーの修正作業を行う者の効率的な作業を阻害する大きな原因となった。   However, even with the fourth related technique, until a certain amount of history information is stored in the error correction history storage means, there is a high possibility that many errors are displayed at the place where the program is described. Therefore, for example, when an error correction is to be started for a new program description, this is a major cause of hindering the efficient work of the person who performs the error correction work.

そこで本発明の目的は、プログラムの記述上のエラーについてその修正作業を効率化できるプログラムのエラー情報出力装置、エラー情報出力方法およびエラー情報出力プログラムを提供することにある。   SUMMARY OF THE INVENTION An object of the present invention is to provide a program error information output device, an error information output method, and an error information output program that can improve the efficiency of correcting errors in the description of a program.

本発明では、(イ)検査対象となるプログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出手段と、(ロ)このエラー検出手段によって検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定手段と、(ハ)このエラー原因特定手段によって原因が特定されたエラーに対して、原因別に前記したエラー検出手段によるエラーの検出が行われないような仮の修正を行う仮修正手段と、(ニ)この仮修正手段によって修正されたプログラムの前記したエラーをひとまとまりのグループとして出力する仮修正エラー出力手段と、(ホ)前記した検査対象となるプログラムにおける前記した仮修正手段によっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力手段とをプログラムのエラー情報出力装置に具備させる。   In the present invention, (b) error detecting means for detecting errors in the description of the program to be inspected in order along the described lines, and (b) analyzing each error detected by the error detecting means. Error cause identification means for determining whether or not the cause of the error can be identified for each error, and (c) the error identified by the error detection means described above for each cause for the error identified by the error cause identification means. (D) temporary correction error output means for outputting the above-described error of the program corrected by the temporary correction means as a group, (e) ) Individually indicating the location of each error that cannot be corrected by the temporary correction means in the program to be inspected. To and a over location information output means to the error information output device program.

また、本発明では、(イ)検査対象となるプログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出ステップと、(ロ)このエラー検出ステップで検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定ステップと、(ハ)このエラー原因特定ステップによって原因が特定されたエラーに対して、原因別に前記したエラー検出ステップによるエラーの検出が行われないような仮の修正を行う仮修正ステップと、(ニ)この仮修正ステップによって修正されたプログラムの前記したエラーをひとまとまりのグループとして出力する仮修正エラー出力ステップと、(ホ)前記した検査対象となるプログラムにおける前記した仮修正ステップによっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力ステップとをプログラムのエラー情報出力方法に具備させる。   In the present invention, (b) an error detection step for detecting errors in the description of the program to be inspected in order along the described line, and (b) each error detected in the error detection step is detected. An error cause identifying step for analyzing and determining for each error whether or not the cause of the error is identified, and (c) the error identified in the error cause identifying step by the error detecting step described above for each cause. A temporary correction step for performing a temporary correction such that no error is detected; and (d) a temporary correction error output step for outputting the above-mentioned errors of the program corrected by the temporary correction step as a group. (E) An error that cannot be corrected by the temporary correction step described above in the program to be inspected. There each location is provided to the error information output method of the program and an error location information output step shown individually of.

更に本発明では、
検査対象となるプログラムの記述上のエラーを修正するコンピュータに、プログラムのエラー情報出力プログラムとして、(イ)前記したプログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出処理と、(ロ)このエラー検出処理で検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定処理と、(ハ)このエラー原因特定処理によって原因が特定されたエラーに対して、原因別に前記したエラー検出処理によるエラーの検出が行われないような仮の修正を行う仮修正処理と、(ニ)この仮修正処理によって修正されたプログラムの前記したエラーをひとまとまりのグループとして出力する仮修正エラー出力処理と、(ホ)前記した検査対象となるプログラムにおける前記した仮修正処理によっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力処理とを実行させることを特徴としている。
Furthermore, in the present invention,
As a program error information output program to a computer that corrects an error in the description of the program to be inspected, (a) an error detection process for detecting the error in the program description described above in order along the described lines; (B) Error cause identification processing that analyzes each error detected in this error detection process and determines whether the cause of the error is specific for each error, and (c) This error cause identification processing causes the cause. A temporary correction process for performing a temporary correction for the identified error so that the error detection process is not performed according to the cause, and (d) the program corrected by the temporary correction process. Temporary correction error output processing that outputs errors as a group, and (e) in the program to be inspected as described above. It is characterized in that to perform the error location information output process shown individually each location of the error can not be corrected by the provisional correction process described above.

以上説明したように本発明によれば、プログラムの記述上のエラーを原因別に特定し、この原因特定が可能であったエラーについては、エラーが検出されないような仮の修正を行うことにすると共に、これらのエラーをひとまとまりのグループとして出力するようにした。これにより、このような修正ができないエラーを顕在化することができ、これらの修正を確実に行うことができる。しかも、仮の修正を行ったエラーについては、エラーの修正の方向付けが行われているので、これを参考に修正作業を効率的に行うことができる。また、このようなエラーについては、装置側の仮の修正で修正が完全に行われる場合もあり、このようなエラーについては修正作業に時間を要しないという利点がある。   As described above, according to the present invention, an error in program description is specified for each cause, and for the error for which the cause can be specified, provisional correction is performed so that no error is detected. , These errors are output as a group. As a result, errors that cannot be corrected can be made obvious, and these corrections can be performed reliably. In addition, since errors that have been tentatively corrected are directed to correct errors, the correction work can be performed efficiently with reference to this. Further, such an error may be completely corrected by temporary correction on the apparatus side, and there is an advantage that it does not take time to correct such an error.

次に本発明を一実施の形態と共に説明する。   Next, the present invention will be described together with an embodiment.

図1は、本実施の形態のエラー情報修正装置の概要を表わしたものである。エラー情報修正装置100は、CPU(Central Processing Unit)101と、このCPU101によって実行される制御プログラムを格納したメモリ102を有する主制御部103を備えている。この主制御部103は、外部から図示しない通信ネットワークやメモリカード等のデータ入力手段を介して検査対象プログラムとしてのソースコード105を入力するソースコード読込部106と接続されている。また、主制御部103はこのソースコード読込部106に読み込まれたソースコードに対して1行ずつ構文解析を行う構文解析部107や、構文に誤りがあった場合のエラー情報の種類を解析するエラー情報解析部108や、エラー情報の解析を行うためのソース修正情報を格納したソース修正情報データベース109と接続されている。   FIG. 1 shows an outline of the error information correcting apparatus according to the present embodiment. The error information correction apparatus 100 includes a CPU (Central Processing Unit) 101 and a main control unit 103 having a memory 102 that stores a control program executed by the CPU 101. The main control unit 103 is connected to a source code reading unit 106 that inputs a source code 105 as a program to be inspected from outside via a data input unit such as a communication network or a memory card (not shown). Further, the main control unit 103 analyzes the syntax of the source code read by the source code reading unit 106 line by line, and the type of error information when there is an error in the syntax. An error information analysis unit 108 and a source correction information database 109 that stores source correction information for analyzing error information are connected.

また、エラー情報修正装置100は、エラーの修正を行う操作者の操作を入力する図示しないキーボードやポインティングデバイス等からなる操作入力部111と、ソースコードのエラー等の各種情報を視覚的に表示する液晶ディスプレイ等の表示部112と、ソースコード読込部106が読み取った修正前のソースコードや、修正後のソースコード等の各種のデータを格納するデータ格納部113を備えている。データ格納部113には、各種のデータが格納できるが、後に説明する修正が可能な情報としての「修正可能エラー情報」を格納する修正可能情報格納領域1131と、修正が不可能な情報としての「修正不可能エラー情報」を格納する修正不可能情報格納領域1132が設けられている。 The error information correction apparatus 100 visually displays an operation input unit 111 including a keyboard and a pointing device (not shown) for inputting an operation of an operator who corrects an error, and various types of information such as a source code error. A display unit 112 such as a liquid crystal display and a data storage unit 113 that stores various data such as a source code before correction read by the source code reading unit 106 and a source code after correction are provided. Various data can be stored in the data storage unit 113. A correctable information storage area 113 1 for storing “correctable error information” as information that can be corrected, which will be described later, and information that cannot be corrected An uncorrectable information storage area 113 2 for storing “uncorrectable error information” is provided.

これらエラー情報修正装置100を構成する各部のうちの少なくとも一部は、回路部品としてのハードウェアで構成してもよいが、CPU101が制御プログラムを実行することによって実現するソフトウェアによって機能的に構成されるものであってもよい。また、視覚的な表示を行う表示部112の代わりに、エラー情報等の各種の情報をプリントアウトするプリンタが用意されていてもよい。   At least a part of each component constituting the error information correction apparatus 100 may be configured by hardware as a circuit component, but is functionally configured by software realized by the CPU 101 executing a control program. It may be a thing. A printer that prints out various information such as error information may be prepared instead of the display unit 112 that performs visual display.

エラー情報修正装置100のこれらの構成のうちで、ソースコード読込部106、構文解析部107、エラー情報解析部108および表示部112におけるエラーに関するデータを出力する回路機能部分は、一般にコンパイラと呼ばれている。ただし、コンパイラには各種の構成があり、また、本実施の形態では表示部112におけるエラー情報の表示に関して、後に説明するように操作者のソースコードの修正操作に便利な工夫が施されている。   Of these components of the error information correction apparatus 100, the circuit function part that outputs data relating to errors in the source code reading unit 106, the syntax analysis unit 107, the error information analysis unit 108, and the display unit 112 is generally called a compiler. ing. However, the compiler has various configurations, and in this embodiment, regarding the display of the error information on the display unit 112, a convenient device is provided for the operator's source code correction operation as described later. .

図2は、このエラー情報修正装置で修正を行おうとするソースコードを読み取ってエラー情報を出力するまでの装置の制御の概要を表わしたものである。図1と共に説明する。   FIG. 2 shows an outline of control of the apparatus from reading the source code to be corrected by the error information correcting apparatus until outputting error information. This will be described with reference to FIG.

エラー情報修正装置100の図示しない電源が投入されて、操作者が操作入力部111からソースコード105の読み込みの開始を指示したとする。すると、ソースコード読込部106がソースコード105を先頭から1行だけ読み込む(ステップS201)。もちろん、ソースコード読込部106はソースコード105の全体を事前に読み込んでおき、これをデータ格納部113内の特定の領域に格納しておいて、各行の検査の際に1行単位で読み出すようにしてもよい。   It is assumed that the error information correction apparatus 100 is turned on (not shown) and the operator instructs the operation input unit 111 to start reading the source code 105. Then, the source code reading unit 106 reads only one line from the top of the source code 105 (step S201). Of course, the source code reading unit 106 reads the entire source code 105 in advance, stores it in a specific area in the data storage unit 113, and reads it in units of one line when inspecting each row. It may be.

ソースコード読込部106は、読み込んだ1行がソースコード105の最終行であるかどうかをチェックする(ステップS202)。ここでは、第1行のソースコードを読み込んだので、まだ最終行ではない。そこで、この読み取った1行分のソースコードを構文解析部107に送って、構文解析を実行する(ステップS203)。構文解析部107は、構文解析の結果として、エラーの発見の有無を出力する。この構文解析の結果としてエラーが発見されなかった場合には(ステップS204:N)、ステップS201に戻って、次の1行分のソースコードの読み込みが行われることになる。   The source code reading unit 106 checks whether or not the read one line is the last line of the source code 105 (step S202). Here, since the source code of the first line is read, it is not the last line yet. Therefore, the read source code for one line is sent to the syntax analysis unit 107 to execute syntax analysis (step S203). The syntax analysis unit 107 outputs whether or not an error is found as a result of the syntax analysis. If no error is found as a result of this parsing (step S204: N), the process returns to step S201, and the source code for the next line is read.

一方、ステップS204でエラーが発見された場合には(Y)、そのエラーがソース修正情報データベース109に存在するエラーであるかの判別が行われる(ステップS205)。ソース修正情報データベース109には、過去の修正作業で修正内容が分かっているエラーとそれらの修正内容が対比して格納されている。したがって、ソース修正情報データベース109に格納されたエラーと同一のエラーであった場合には(Y)、その修正が行われる(ステップS206)。この場合にはエラーが修正された後、再びステップS201に戻って次の1行の読み込みが開始される。以上の処理は、従来においても行われていたものである。   On the other hand, if an error is found in step S204 (Y), it is determined whether the error is an error existing in the source correction information database 109 (step S205). In the source correction information database 109, errors whose correction contents are known in the past correction work and those correction contents are stored in comparison. Therefore, if the error is the same as the error stored in the source correction information database 109 (Y), the correction is performed (step S206). In this case, after the error is corrected, the process returns to step S201 again to start reading the next line. The above processing has been performed conventionally.

これに対して、該当のエラーがステップS205でソース修正情報データベース109に存在しないものと判別された場合には(N)、そのエラーが操作者による後の作業で修正可能なものであるか否かについての判別が行われる(ステップS207)。このための判別手法については、後に詳しく説明する。この結果として、操作者が後で修正を行うことができるエラーの場合には(Y)、操作者に修正の方向を示唆するための情報を付加した「修正可能エラー情報」を生成する(ステップS208)。そしてこれをデータ格納部113の修正可能情報格納領域1131に格納する(ステップS209)。そして、再びステップS201に戻って次の1行の読み込みが開始される。 On the other hand, if it is determined in step S205 that the corresponding error does not exist in the source correction information database 109 (N), whether or not the error can be corrected by a later operation by the operator. Is determined (step S207). A determination method for this will be described in detail later. As a result, in the case of an error that can be corrected later by the operator (Y), “correctable error information” to which information for suggesting the direction of correction to the operator is added is generated (step) S208). Then, this is stored in the correctable information storage area 113 1 of the data storage unit 113 (step S209). And it returns to step S201 again and reading of the following 1 line is started.

一方、ステップS207で操作者が修正できるとエラー情報修正装置100側で判別しなかったエラーは(N)、「修正不可能エラー情報」として、データ格納部113の修正不可能情報格納領域1132に保管される(ステップS210)。そして、再びステップS201に戻って次の1行の読み込みが開始される。ただし、「修正可能エラー情報」であるかの判別にあたっては、該当する1行のソースコードだけでは判別できない場合がある。このような場合には、ソースコード読込部106がソースコード105をある程度先読みする必要がある。これについても、後に説明する。 On the other hand, if the error can be corrected by the operator in step S207, the error that is not determined by the error information correction apparatus 100 side is (N) as “uncorrectable error information”, and the uncorrectable information storage area 113 2 of the data storage unit 113 (Step S210). And it returns to step S201 again and reading of the following 1 line is started. However, in determining whether it is “correctable error information”, it may not be possible to determine only by the corresponding one-line source code. In such a case, the source code reading unit 106 needs to prefetch the source code 105 to some extent. This will also be described later.

このようにして、ステップS201に戻ってはソースコード105が1行ずつ読み込まれて、以上説明した処理が行単位で進行していく。この結果、ある時点で読み取ったソースコード105が最終行を構成するものと判別されることになる(ステップS202:Y)。この場合には、修正可能情報格納領域1131に、「修正可能エラー情報」が格納されているかをチェックする(ステップS211)。 Thus, returning to step S201, the source code 105 is read line by line, and the processing described above proceeds in line units. As a result, it is determined that the source code 105 read at a certain time constitutes the last line (step S202: Y). In this case, it is checked whether “correctable error information” is stored in the correctable information storage area 113 1 (step S211).

今回のソースコード105の一連の読み込みによって、修正可能情報格納領域1131に、「修正可能エラー情報」が格納された場合には(Y)、ソースコード読込部106で読み込んだ全ソースコードに対して、重複する「修正可能エラー情報」を統合する。たとえば、第1行目と第10行目に同じ「修正可能エラー情報」が存在すれば、これを1つの「修正可能エラー情報」として第1行目に対応した情報とする。このようにして、操作者がすぐ修正できる情報としての修正用情報を作成する(ステップS212)。そして、この修正用情報と、ステップS210で保管した「修正不可能エラー情報」とをそれぞれ操作者に指示する情報として出力することになる(ステップS213)。ステップS211で「修正可能エラー情報」が修正可能情報格納領域1131に、格納されていないときには(N)、ステップS212の処理を省略してステップS213の処理が行われる。 When “correctable error information” is stored in the correctable information storage area 113 1 by this series of reading of the source code 105 (Y), all the source codes read by the source code reading unit 106 are processed. Then, duplicate “correctable error information” is integrated. For example, if the same “correctable error information” exists in the first row and the tenth row, this is set as information corresponding to the first row as one “correctable error information”. In this way, correction information is created as information that can be immediately corrected by the operator (step S212). Then, the correction information and the “uncorrectable error information” stored in step S210 are output as information for instructing the operator (step S213). If “correctable error information” is not stored in the correctable information storage area 113 1 in step S211, (N), the process of step S213 is omitted and the process of step S213 is performed.

ステップS213による修正不可能エラー情報の出力は、「修正可能エラー情報」と「修正不可能エラー情報」を完全に画面上、あるいはプリントアウトとして分離した形態で行ってもよい。または、一連のソースコードに「修正可能エラー情報」と「修正不可能エラー情報」をそれぞれ区別できるように対応付けて表示あるいはプリントアウトするようにしてもよい。   The uncorrectable error information may be output in step S213 in a form in which “correctable error information” and “non-correctable error information” are completely separated on the screen or as a printout. Alternatively, “correctable error information” and “non-correctable error information” may be displayed in correspondence with each other so as to be distinguished from each other in a series of source codes.

このように本実施の形態では、ソースコードにエラーが存在するときに、これがソースコードの作成者にとって誤りやすいミスに基づくものである場合には、これらをエラー情報修正装置100が「修正可能エラー情報」と判別する。そして、これらを操作者に「修正不可能エラー情報」とは別のグループのものとして示すことで、エラーの早期修正を可能とさせる。このとき、本実施の形態ではエラー情報修正装置100がエラー解消のための解決策の一例を実施して、表面上ではエラーが発生していない状況を実現させるようになっている。   As described above, in the present embodiment, when errors exist in the source code and this is based on mistakes that are easy to be mistaken for the creator of the source code, the error information correcting apparatus 100 treats them as “correctable errors”. "Information". Then, by showing these to the operator as a group different from the “uncorrectable error information”, the error can be corrected early. At this time, in the present embodiment, the error information correction apparatus 100 implements an example of a solution for solving the error so as to realize a situation in which no error has occurred on the surface.

一方、「修正不可能エラー情報」については、ソースコードの知識が全くないものが作業を行ったり、操作者が図示しないキーボードの文字変換の設定を間違えた状態でタイピングを行ったような場合に起因することが多く、修正を機械的に行うことができない場合が多い。したがって、「修正不可能エラー情報」の場合には、エラー情報修正装置100が表面上でもエラーを解消させることはできない。操作者がそのエラーの原因をそれなりに考察する必要がある。   On the other hand, for “uncorrectable error information”, work without knowledge of the source code is performed, or when the operator performs typing with a wrong character conversion setting for the keyboard (not shown). In many cases, the correction is not possible and the correction cannot be performed mechanically. Therefore, in the case of “uncorrectable error information”, the error information correcting apparatus 100 cannot solve the error even on the surface. The operator needs to consider the cause of the error.

このように「修正不可能エラー情報」を「修正可能エラー情報」と区別して修正できるようにして修正作業を容易にしたのが、本実施の形態のエラー情報修正装置100の1つの特徴である。そこで、「修正可能エラー情報」と見なせるものの代表的なものを幾つか例示して、これらを見掛け上でエラーを解消させる原理を次に説明する。   One feature of the error information correcting apparatus 100 according to the present embodiment is that the correction work is facilitated by making it possible to correct “uncorrectable error information” separately from “correctable error information”. . Accordingly, some typical examples of what can be regarded as “correctable error information” will be exemplified, and the principle of apparently eliminating these errors will be described below.

図3(A)は、エラーの発生する第1の例として、定義が欠落したソース文の一例を示したものである。このソース例301では、言語としてC#(シーシャープ)を使用しているが、変数「op2」の定義の記載が欠如している。このため、この後の「obj.Method」321および「obj.Method2」322の双方の関数呼び出し部分で、この変数「op2」が見つからないことになり、これらの2行でエラーが発生する。このような定義を忘れたことによるエラーの検出は、関数呼び出し部分が存在するときに、その前のソース文に定義の記載があるかをチェックすることで行うことができる。   FIG. 3A shows an example of a source sentence with missing definitions as a first example in which an error occurs. In this source example 301, C # (Sea Sharp) is used as a language, but the definition of the variable “op2” is not described. For this reason, the variable “op2” is not found in the function call portions of both “obj.Method” 321 and “obj.Method2” 322 thereafter, and an error occurs in these two lines. Detection of an error due to forgetting such a definition can be performed by checking whether there is a description of the definition in the previous source sentence when there is a function call part.

図3(B)は、必要な定義をソース文に加えるソース修正情報の他の一例を示したものである。操作者が修正する前の段階で、図1に示したエラー情報修正装置100側がソース修正情報302として、形式的に変数「op2」に対して定義を置くことで、エラーを解消させることができる。この第1の例の場合には、「修正可能エラー情報」の1つとして、変数「op2」を示し、操作者にこの変数「op2」を定義させるようにすればよい。   FIG. 3B shows another example of source correction information for adding a necessary definition to a source sentence. Before the operator corrects the error, the error information correcting apparatus 100 shown in FIG. 1 can form the definition as the source correction information 302 for the variable “op2” to eliminate the error. . In the case of the first example, the variable “op2” may be indicated as one of the “correctable error information”, and the operator may define the variable “op2”.

図4(A)は、エラーの発生する第2の例として、定義が欠落したソース文の一例を示したものである。このソース例303では、同じく言語としてC#を使用している。この例の場合には、「if文」331で使用されている区切り文字(括弧記号)の「{」に対応する「}」の記載がない。このような場合、コンパイラとしては、言語仕様上、「public long BBB() {」332を読み込んだ時に、メソッド内に不正な定義が存在するためエラーとなる。   FIG. 4A shows an example of a source sentence with missing definitions as a second example in which an error occurs. In this source example 303, C # is also used as the language. In the case of this example, there is no description of “}” corresponding to the delimiter (bracket symbol) “{” used in the “if statement” 331. In such a case, as a compiler, when “public long BBB () {” 332 is read in accordance with language specifications, an error occurs because an invalid definition exists in the method.

図4(B)は、必要な区切り文字をソース文に加えるソース修正情報の一例を示したものである。ここでは、区切り文字「{」と対応付けられる区切り文字「}」がソース修正情報304として追加される。すなわち、図1に示すエラー情報修正装置100側は「修正可能エラー情報」の1つとして、区切り文字「}」を示し、区切り文字「}」でエラーを修正することが示唆される。この第2の例の場合には、区切り文字における開始を示す文字と終了を示す文字の対応付けが採れているかを順にチェックすることで、「修正可能エラー情報」に該当するか否かを判別することができる。   FIG. 4B shows an example of source correction information for adding a necessary delimiter to a source sentence. Here, the delimiter character “}” associated with the delimiter character “{” is added as the source correction information 304. That is, the error information correcting apparatus 100 side shown in FIG. 1 indicates the delimiter “}” as one of the “correctable error information”, and it is suggested that the error is corrected with the delimiter “}”. In the case of the second example, it is determined whether or not it corresponds to “correctable error information” by sequentially checking whether the character indicating the start and the character indicating the end are taken in the delimiter. can do.

図5(A)は、エラーの発生する第3の例として、計算に適さない変数を使用したソース文の一例を示したものである。このソース例305では、「String型」の変数「data」に「2」を代入したり、計算の変数に利用したりしている。この例の場合、変数の使い方が間違っており、計算に適した変数に修正する必要がある。言語としてC#を例にとると、計算に使用できる型は、「int型」、「long型」、「short型」等の幾つかの型が存在する。これらのうちのいずれの型を使用するかは、ソースコードの修正を行う操作者が決めるものである。   FIG. 5A shows an example of a source sentence using a variable not suitable for calculation as a third example in which an error occurs. In this source example 305, “2” is assigned to a variable “data” of “String type” or used as a calculation variable. In this case, the usage of the variable is incorrect and it is necessary to correct it to a variable suitable for calculation. Taking C # as an example, there are several types such as “int type”, “long type”, and “short type” that can be used for calculation. Which type to use is determined by the operator who modifies the source code.

図5(B)は、計算に使用できる型としてのソース修正情報の一例を示したものである。図1に示すエラー情報修正装置100側は「修正可能エラー情報」の1つを修正の方向の示唆のために示せばよく、修正内容を具体的に示す必要はない。そこで図5(B)に示したように、変数「data」を計算に使用できる「int型」に修正する例を示している。この第3の例の場合には、計算に適さない変数が計算に間違って使用されているかをチェックすることで、「修正可能エラー情報」に該当するか否かを判別することができる。   FIG. 5B shows an example of source correction information as a type that can be used for calculation. The error information correcting apparatus 100 shown in FIG. 1 only needs to indicate one of the “correctable error information” for suggesting the direction of correction, and it is not necessary to specifically indicate the correction contents. Therefore, as shown in FIG. 5B, an example is shown in which the variable “data” is modified to “int type” that can be used for calculation. In the case of the third example, it is possible to determine whether or not the variable corresponds to “correctable error information” by checking whether or not a variable that is not suitable for the calculation is erroneously used in the calculation.

図6(A)は、エラーの発生する第4の例として、参照しているクラスの「import文」が欠落したソース文の一例を示したものである。このソース例307は、Java(登録商標)(ジャバ)言語を例にしている。この例の場合には、参照しているクラスの「import文」が欠けている。このため、クラスを使用している箇所すべてでクラスが見つからないというエラーが発生する。   FIG. 6A shows an example of a source sentence in which the “import sentence” of the referenced class is missing as a fourth example in which an error occurs. This source example 307 is an example of Java (registered trademark) (Java) language. In this example, the “import statement” of the referenced class is missing. For this reason, an error occurs that the class cannot be found in all places where the class is used.

図6(B)は、「import文」を追加するソース修正情報の一例を示したものである。このように、クラスがコンパイラで解決可能な場合、ソース修正情報308のように「import文」の欠落の有無をチェックすることで、「修正可能エラー情報」に該当するか否かを判別することができる。   FIG. 6B shows an example of source correction information for adding an “import sentence”. In this way, when a class can be resolved by a compiler, it is determined whether or not it falls under “correctable error information” by checking whether or not “import statement” is missing as in the source correction information 308. Can do.

図7(A)は、エラーの発生する第5の例として、「goto文」のとび先のラベルが欠落したソース文の一例を示したものである。このソース例309では、C言語を例として示している。「goto文」では、指定されたラベルや行番号に無条件にジャンプすることになるが、ラベルが指定されていない例となる。   FIG. 7A shows an example of a source sentence in which the destination label of the “goto sentence” is missing as a fifth example in which an error occurs. In this source example 309, C language is shown as an example. In the “goto statement”, an unconditional jump is made to the specified label or line number, but no label is specified.

図7(B)は、仮のラベルを追加する修正を行ったソース修正情報の一例を示したものである。このソース修正情報310のように「goto文」が存在するときには、そのとび先の有無をチェックすることで、「修正可能エラー情報」に該当するか否かを判別することができる。   FIG. 7B shows an example of source correction information that has been corrected to add a temporary label. When a “goto statement” exists like the source correction information 310, it can be determined whether or not it corresponds to “correctable error information” by checking the presence or absence of the “goto statement”.

図8(A)は、エラーの発生する第6の例として、繰り返しの対象の手続き名が欠落したソース文の一例を示したものである。このソース例311では、COBOL(COmmon Business Oriented Language)言語を例として示している。繰り返しの対象の手続き名(TETUDUKI)が存在しないため、存在しない手続き名を指定している箇所341でエラーとなる。   FIG. 8A shows an example of a source sentence in which a procedure name to be repeated is missing as a sixth example in which an error occurs. In this source example 311, COBOL (COmmon Business Oriented Language) language is shown as an example. Since there is no procedure name (TETUDUKI) to be repeated, an error occurs at a location 341 that specifies a procedure name that does not exist.

図8(B)は、手続き名を追加する修正を行ったソース修正情報の一例を示したものである。このソース修正情報312のように手続き名を追加することで、このエラーが解消する。この第6の例では、繰り返しの対象の手続き名がソース文に存在するかをチェックすることで、「修正可能エラー情報」に該当するか否かを判別することができる。   FIG. 8B shows an example of source correction information that has been corrected to add a procedure name. By adding a procedure name like the source correction information 312, this error is solved. In this sixth example, it is possible to determine whether or not the procedure name to be repeated exists in the source sentence, so that it corresponds to “correctable error information”.

図9(A)は、エラーの発生する第7の例として、見出しが不正な単語となっているソース文の一例を示したものである。このソース例313では、COBOL言語を例として示している。COBOL言語では、実際のプログラムを記述する4番目に登場する手続き部(PROCEDURE DIVISION)が必ず存在している。しかしながら、このソース例313では、見出しの「PROCERE DIVISION」351が不正な単語となっている。このような場合、これに後続している記述が不正な位置に記載されていることになる。これにより、エラーが発生する。   FIG. 9A shows an example of a source sentence whose headline is an invalid word as a seventh example in which an error occurs. In this source example 313, the COBOL language is shown as an example. In the COBOL language, there is always a fourth procedure division (PROCEDURE DIVISION) describing an actual program. However, in this source example 313, the heading “PROCERE DIVISION” 351 is an illegal word. In such a case, the subsequent description is described in an illegal position. As a result, an error occurs.

図9(B)は、正しい見出しに編集したソース修正情報の一例を示したものである。このソース修正情報314のように、「PROCEDURE DIVISION」と正しい見出しに編集することで、エラーが解消する。この第7の例では、たとえば「DIVISION」のようなキーワードが存在している箇所で、不正な単語が記載されていないかをチェックすればよい。そして、このような不正な単語が存在した場合には、「修正可能エラー情報」に該当すると判別することができる。   FIG. 9B shows an example of the source correction information edited to the correct heading. As in the source correction information 314, the error is resolved by editing “PROCEDURE DIVISION” into a correct heading. In the seventh example, it is only necessary to check whether an illegal word is described in a place where a keyword such as “DIVISION” exists. If such an invalid word is present, it can be determined that it corresponds to “correctable error information”.

図10は、エラー情報解析部を具体的に表わしたものである。エラー情報解析部108は、図1に示した構文解析部107がソースコード105にエラーが存在すると判別し、かつ、これらのエラーがソース修正情報データベース109で修正済みのものとして格納されているものでないと判別したものについてエラーの解析を行うようになっている。そして、このエラー情報解析部108で解析が成功した情報は、「修正可能エラー情報」として、図1に示す修正可能情報格納領域1131に格納され、解析が成功しなかった情報は、「修正不可能エラー情報」として修正不可能情報格納領域1132に格納されることになる。 FIG. 10 specifically shows the error information analysis unit. The error information analysis unit 108 determines that the syntax analysis unit 107 shown in FIG. 1 has an error in the source code 105 and stores these errors as corrected in the source correction information database 109. The error analysis is performed for those that are not. Then, the information analysis is successful with this error information analyzing unit 108, as a "correctable error information" is stored in the modifiable information storage area 113 1 shown in FIG. 1, the information analysis is not successful, "Modify It is stored in the uncorrectable information storage area 113 2 as “impossible error information”.

このようなエラー情報解析部108は、第1〜第mの解析部1311〜131mから構成されている。ここで、第1の解析部1311は、たとえば図3で説明した第1の例および図5で説明した第3の例に関するエラーを解析して検出する機能を備えている。また、第2の解析部1312は、たとえば図4で説明した第2の例に関するエラーを解析して検出する機能を備えている。図3〜図9では、第1〜第7の例を示したが、これらは例示であり、第1〜第mの解析部1311〜131mによって適宜の種類のエラーが解析されて検出されることになる。 Such an error information analysis unit 108 includes first to mth analysis units 131 1 to 131 m . Here, the first analysis unit 131 1 has a function of analyzing and detecting errors related to the first example described in FIG. 3 and the third example described in FIG. 5, for example. Further, the second analysis unit 131 2 includes a function of detecting and analyzing the error for the second example described with reference to FIG. 4, for example. 3 to 9 show the first to seventh examples. However, these are only examples, and appropriate types of errors are analyzed and detected by the first to mth analysis units 131 1 to 131 m . Will be.

また、本実施の形態のエラー情報修正装置100およびそのエラー情報解析部108は、C、C#、Java(登録商標)、COBOL等の各種の言語に対応する汎用型の装置として構成されている。もちろん、エラー情報修正装置100は1つの言語のみに対応する装置であってもよい。この場合、エラー情報解析部108は、その扱う言語に特化した解析部131のみを備えるだけでよい。   Further, the error information correction apparatus 100 and the error information analysis unit 108 according to the present embodiment are configured as general-purpose apparatuses corresponding to various languages such as C, C #, Java (registered trademark), and COBOL. . Of course, the error information correction apparatus 100 may be an apparatus corresponding to only one language. In this case, the error information analysis unit 108 only needs to include the analysis unit 131 specialized for the language to be handled.

図11は、第1の解析部を更に具体的に表わしたものである。なお、第2〜第mの解析部1312〜131mも、図4〜図9で例示したようなエラー検出原理をそれぞれ具体化する構成となっていればよく、そのための具体的な構成は特に限定されるものでもない。そこで、第2〜第mの解析部1312〜131mの詳細については、図示および説明を省略する。 FIG. 11 shows the first analysis unit more specifically. Note that the second to m-th analysis units 131 2 to 131 m may also be configured to embody the error detection principles illustrated in FIGS. 4 to 9, respectively. It is not particularly limited. Therefore, illustration and description of the details of the second to m-th analysis units 131 2 to 131 m are omitted.

第1の解析部1311は、解析に関係する変数を予め登録した定義データテーブル141と、図3で説明した第1の例に関するエラーを解析して検出する解析手順を実行する第1の解析手順実行部142を備えている。ここで、第1の解析手順実行部142は、独自のCPUとこのCPUが実行する制御プログラムを格納する記憶媒体を備えてもよい。また、図1に示したCPU101がメモリ102内に格納した制御プログラムを実行することで、この第1の解析手順実行部142をソフトウェア的に実現するようになっていてもよい。 The first analysis unit 131 1 performs a first analysis that executes a definition data table 141 in which variables related to the analysis are registered in advance and an analysis procedure for analyzing and detecting an error related to the first example described with reference to FIG. A procedure execution unit 142 is provided. Here, the first analysis procedure execution unit 142 may include a storage medium that stores a unique CPU and a control program executed by the CPU. Further, the CPU 101 shown in FIG. 1 may execute the control program stored in the memory 102 so that the first analysis procedure execution unit 142 is realized in software.

図12は、第1の解析手順実行部が実行する処理の様子を表わしたものである。図1、図3、図5および図11と共に説明する。   FIG. 12 shows a state of processing executed by the first analysis procedure execution unit. This will be described with reference to FIGS. 1, 3, 5 and 11.

図3(A)のソース例301中に、「ret=obj.Method(op1, op2)」という記述がある。これは、「Method」という関数を、変数「op1」と変数「op2」を引数に使用して呼び出す記述である。通常コンパイラでは、変数が使用される場合は、その変数が定義されているかどうかをチェックする。そこで、まず、変数「op1」について、その変数の定義をチェックする。具体的には、定義データテーブル141に、この場合は、コンパイラが内部に持っている定義データテーブルに変数の定義があるかどうかをチェックする(ステップS231)。図3(A)では、事前に「int op1;」の記述があり、「int型の変数op1」を定義している。このため変数「op1」は定義済みとなる(Y)。   In the source example 301 in FIG. 3A, there is a description “ret = obj.Method (op1, op2)”. This is a description for calling the function “Method” using the variables “op1” and “op2” as arguments. Normally, when a variable is used, the compiler checks whether the variable is defined. First, for the variable “op1,” the variable definition is checked. Specifically, it is checked whether or not there is a variable definition in the definition data table 141 in this case, in the definition data table that the compiler internally has (step S231). In FIG. 3A, “int op1;” is described in advance, and “int variable op1” is defined. For this reason, the variable “op1” is already defined (Y).

そこで、処理はステップS232に進む。ステップS232では、変数の型がメソッドの引数の型と合っているかどうかのチェックが行われる。ソース例301中には、「Method関数」の定義として、「public int Method(int a, int b)」とあり、引数の型は「int」であり、型情報があっている(Y)。そこで、変数「op1」についてはエラーがないことになり、エラーが発生したときに「修正可能エラー情報」を出力するか否かを判別する第1の解析部1311の処理の対象外となる。そこで、この場合には、変数「op1」についての処理はそのまま終了する(エンド)。 Therefore, the process proceeds to step S232. In step S232, it is checked whether the variable type matches the method argument type. In the source example 301, the definition of the “Method function” is “public int Method (int a, int b)”, the argument type is “int”, and there is type information (Y). Therefore, the variable “op1” has no error, and is excluded from the processing of the first analysis unit 1311 that determines whether or not “correctable error information” is output when an error occurs. . Therefore, in this case, the process for the variable “op1” ends as it is (end).

次に、変数「op2」についてのエラーのチェックについて説明する。変数「op2」の場合にも、ステップS231における定義データテーブル141で定義情報があるかどうかをチェックする。この場合、事前に変数「op2」を定義する記述はない。したがって、定義なしとなる(N)。そこで、ステップS233に進んで、図1に示したソース修正情報データベース109に変数「op2」が定義されているかについての判別が行われる。定義されている場合には(Y)、ステップS232に進んで変数の型がメソッドの引数の型と合っているかどうかのチェックが行われる。型情報があっていれば(Y)、変数「op2」についての処理はそのまま終了する(エンド)。   Next, error checking for the variable “op2” will be described. Even in the case of the variable “op2”, it is checked whether there is definition information in the definition data table 141 in step S231. In this case, there is no description that defines the variable “op2” in advance. Therefore, there is no definition (N). Accordingly, the process proceeds to step S233, and it is determined whether or not the variable “op2” is defined in the source correction information database 109 shown in FIG. If it is defined (Y), the process proceeds to step S232 to check whether the type of the variable matches the type of the argument of the method. If there is type information (Y), the process for the variable “op2” ends as it is (end).

型情報があっていない場合には(ステップS232:N)、ソース修正情報データベース109で変数の型が修正されているかどうかの判別が行われる(ステップS234)。修正されていれば(Y)、問題はないので、処理はそのまま終了する(エンド)。   If there is no type information (step S232: N), it is determined whether or not the variable type is corrected in the source correction information database 109 (step S234). If it has been corrected (Y), there is no problem, and the process ends as it is (end).

型情報があっておらず(ステップS232:N)、ソース修正情報データベース109で変数の型の修正も行われていない場合には(ステップS234:N)、変数の型を修正する(ステップS235)。そして、これを操作者に提示するために「修正可能エラー情報」として出力して(ステップS236)、第1の解析手順実行部142の処理を終了する(エンド)。この「修正可能エラー情報」は、最終的に修正可能情報格納領域1131に格納されることになる。 If there is no type information (step S232: N) and the variable type is not corrected in the source correction information database 109 (step S234: N), the variable type is corrected (step S235). . Then, this is output as “correctable error information” in order to present it to the operator (step S236), and the processing of the first analysis procedure execution unit 142 is ended (END). This “correctable error information” is finally stored in the correctable information storage area 113 1 .

一方、ステップS233でソース修正情報データベース109に変数「op2」が定義されていないと判別された場合には(N)、エラーの出力を解消するための変数として「int op2」と定義して、ソース修正情報データベース109にこれを登録する(ステップS237)。そして、この状態を操作者に提示するために「修正可能エラー情報」として出力して(ステップS236)、第1の解析手順実行部142の処理を終了する(エンド)。   On the other hand, if it is determined in step S233 that the variable “op2” is not defined in the source correction information database 109 (N), it is defined as “int op2” as a variable for eliminating the error output, This is registered in the source correction information database 109 (step S237). Then, this state is output as “correctable error information” in order to present it to the operator (step S236), and the processing of the first analysis procedure execution unit 142 is ended (END).

次に、図3の「ret = obj.Method2(op1, op2)」の記述を読み込んだ場合の処理について説明する。変数「op1」についての処理は先に説明した通りである。   Next, processing when the description of “ret = obj.Method2 (op1, op2)” in FIG. 3 is read will be described. The processing for the variable “op1” is as described above.

「ret = obj.Method2(op1, op2)」の変数「op2」については、まず定義データテーブルに変数の定義があるかどうかをチェックする(ステップS231)。定義済みではないので、ステップS233に進んで、図1に示したソース修正情報データベース109に変数「op2」が定義されているかについての判別が行われる。この場合には、先のステップS237で変数「op2」についてソース修正情報データベース109に定義が登録されている(ステップS233:Y)。そこで、ステップS232に進む。この例の場合、型情報はもともとは定義がない。そこで、ソース修正情報データベース109を検索して、エラーの出力を解消するための変数として「int op2」を得る。これにより、変数「op2」についての以後の冗長なエラー出力を抑止することができることになる。   For the variable “op2” of “ret = obj.Method2 (op1, op2)”, first, it is checked whether or not there is a variable definition in the definition data table (step S231). Since it has not been defined, the process proceeds to step S233, and it is determined whether or not the variable “op2” is defined in the source correction information database 109 shown in FIG. In this case, the definition of the variable “op2” is registered in the source correction information database 109 in the previous step S237 (step S233: Y). Therefore, the process proceeds to step S232. In this example, type information is originally undefined. Therefore, the source correction information database 109 is searched to obtain “int op2” as a variable for eliminating the error output. As a result, subsequent redundant error output for the variable “op2” can be suppressed.

次に図5(A)のソース例305について、その処理を説明する。変数「data」は 文字列を格納できる「String型」として定義されている。「data2」は整数を格納できる「int型」として定義されている。まず、「data = 2」では、変数「data」に整数「2」を格納しようとしている。この場合、ステップS231の変数定義のチェックでは、変数「data」が定義されている(Y)。そこで、ステップS232に進む。ステップS232では変数の型のチェックとなる。ここでは、文字列を格納できる変数に整数を格納しようとしてるため、型はあっていない(N)。そこで、ステップS234に進む。   Next, processing of the source example 305 in FIG. 5A will be described. The variable “data” is defined as “String type” that can store character strings. “Data2” is defined as an “int type” that can store an integer. First, in “data = 2”, the integer “2” is stored in the variable “data”. In this case, in the variable definition check in step S231, the variable “data” is defined (Y). Therefore, the process proceeds to step S232. In step S232, the variable type is checked. Here, since an integer is stored in a variable that can store a character string, there is no type (N). Therefore, the process proceeds to step S234.

ステップS234では、ソース修正情報データベース109に検索される情報がない(N)。そこでステップS235に進んで変数の型を修正する。この場合には、整数を格納できるように、変数「data」の型を「int型」へ変更する。そして、これを操作者に提示するために「修正可能エラー情報」として出力して(ステップS236)、第1の解析手順実行部142の処理を終了する(エンド)。   In step S234, there is no information to be searched in the source correction information database 109 (N). Therefore, the process proceeds to step S235 to correct the variable type. In this case, the type of the variable “data” is changed to “int type” so that an integer can be stored. Then, this is output as “correctable error information” in order to present it to the operator (step S236), and the processing of the first analysis procedure execution unit 142 is ended (END).

図5(A)における「data2 = data * 2」においても同様に変数のチェックが行われる。この場合は、変数「data」を2倍して「data2」に格納するような算術の命令が用いられている。算術の命令には「String型」は使用できない。このため、この場合も変数「data」のチェックの行われるステップS232で型があっていないと判定される(N)。そこで、ステップS234に進み、ソース修正情報データベース109に修正された情報が登録されているかの判別が行われる。この場合、「data = 2」で「int型」に変更した情報が登録されている(Y)。そこでエラーが出力されることなく、処理はそのまま終了する(エンド)。この場合にも冗長なエラーが抑止されることになる。   In “data2 = data * 2” in FIG. 5A, the variable is similarly checked. In this case, an arithmetic instruction that doubles the variable “data” and stores it in “data2” is used. "String type" cannot be used for arithmetic instructions. Therefore, in this case as well, it is determined that there is no type in step S232 in which the variable “data” is checked (N). Therefore, the process proceeds to step S234, and it is determined whether the corrected information is registered in the source correction information database 109. In this case, information changed to “int type” with “data = 2” is registered (Y). Therefore, the process ends as it is without outputting an error (end). In this case also, redundant errors are suppressed.

以上説明したように本実施の形態によれば、同一原因のコンパイルエラーメッセージを抑制することが可能になり、修正作業の効率が向上する。また、操作者を介することなくエラー消去の方向性が判別できるエラーについては、エラーメッセージの出力を回避して、これらを操作者にまとめて提示するようにしたので、修正すべき点の見落としが発生しにくくなるという利点がある。   As described above, according to the present embodiment, it is possible to suppress compile error messages of the same cause, and the efficiency of correction work is improved. In addition, for errors that can determine the direction of error erasure without going through the operator, the error message output is avoided and these are presented to the operator together, so there is an oversight of points to be corrected. There is an advantage that it is difficult to occur.

<発明の変形例>   <Modification of the invention>

図13は、本発明の変形例におけるエラー情報修正装置の構成を表わしたものである。図13で図1と同一の部分には同一の符号を付しており、これらの説明を適宜省略する。   FIG. 13 shows the configuration of an error information correction apparatus according to a modification of the present invention. In FIG. 13, the same parts as those in FIG. 1 are denoted by the same reference numerals, and description thereof will be omitted as appropriate.

この変形例のエラー情報修正装置100Aでは、修正ソース生成部115が新たに設けられている。修正ソース生成部115は、コンパイルの結果蓄積されたソース修正情報データベース109のソース修正情報を利用して、あらかじめ修正された修正ソース116と、元ソースとの差分を表わしたソース差分情報117を生成する機能である。これら修正ソース116およびソース差分情報117は、表示部112によって視覚的な情報として出力される。もちろん、図示しないプリンタを用いることによって、修正ソース116およびソース差分情報117をプリントアウトしてもよい。主制御部103Aは、このような追加された機能を実現する先行技術プログラムを格納したメモリ102Aを備えている。   In the error information correction apparatus 100A of this modification, a correction source generation unit 115 is newly provided. The correction source generation unit 115 generates source difference information 117 representing a difference between the correction source 116 corrected in advance and the original source, using the source correction information in the source correction information database 109 accumulated as a result of compilation. It is a function to do. The corrected source 116 and the source difference information 117 are output as visual information by the display unit 112. Of course, the correction source 116 and the source difference information 117 may be printed out by using a printer (not shown). The main control unit 103A includes a memory 102A that stores a prior art program that realizes such added functions.

図14は、この変形例でソースコードを読み取って修正ソースを生成するまでのエラー情報修正装置の制御の要部を表わしたものである。この変形例では、図2に示したステップS201からステップS213まで同じ処理が行われる。ステップS213で修正用情報と「修正不可能エラー情報」とを出力したら、修正用情報について修正ソースを生成して(ステップS214)、一連の処理が終了する。   FIG. 14 shows a main part of the control of the error information correction apparatus until the correction source is generated by reading the source code in this modification. In this modification, the same processing is performed from step S201 to step S213 shown in FIG. When the correction information and “uncorrectable error information” are output in step S213, a correction source is generated for the correction information (step S214), and the series of processing ends.

このような変形例のエラー情報修正装置100Aによれば、操作者はソース差分情報117を確認して、その内容に問題がなければソースを修正する作業を省略することができ、作業効率をより高めることができる。   According to the error information correcting apparatus 100A of such a modification, the operator can check the source difference information 117, and if there is no problem in the contents, the operation of correcting the source can be omitted, and the work efficiency can be improved. Can be increased.

以上説明した実施の形態および変形例では、コンパイラがソースコードの誤りを検出したときのエラー情報の出力に関して説明したが、これに限るものではない。たとえばアセンブラがアセンブリ言語を機械語に変換するときにプログラムのエラー情報を出力する際にも、本発明と同様の技術を使用することが可能である。また、一般に各種のプログラムを記述した文章中の誤りを訂正する場合に、本発明を同様に適用することができることは当然である。   In the embodiment and the modification described above, the output of error information when the compiler detects an error in the source code has been described. However, the present invention is not limited to this. For example, the technique similar to the present invention can be used when outputting error information of a program when the assembler converts assembly language into machine language. In addition, it is natural that the present invention can be similarly applied to correcting errors in a sentence in which various programs are generally described.

本実施の形態のエラー情報修正装置の概要を表わしたブロック図である。It is a block diagram showing the outline | summary of the error information correction apparatus of this Embodiment. 本実施の形態のエラー情報修正装置でソースコードを読み取ってエラー情報を出力するまでの装置の制御の概要を示す流れ図である。It is a flowchart which shows the outline | summary of control of an apparatus until it reads error code with the error information correction apparatus of this Embodiment, and outputs error information. 本実施の形態でエラーの発生する第1の例を示した説明図である。It is explanatory drawing which showed the 1st example which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第2の例を示した説明図である。It is explanatory drawing which showed the 2nd example which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第3の例を示した説明図である。It is explanatory drawing which showed the 3rd example which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第4の例を示した説明図である。It is explanatory drawing which showed the 4th example which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第5の例を示した説明図である。It is explanatory drawing which showed the 5th example which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第6の例を示した説明図である。It is explanatory drawing which showed the 6th example in which an error generate | occur | produces in this Embodiment. 本実施の形態でエラーの発生する第7の例を示した説明図である。It is explanatory drawing which showed the 7th example in which an error generate | occur | produces in this Embodiment. 本実施の形態のエラー情報解析部を具体的に表わしたブロック図である。It is a block diagram showing the error information analysis part of this embodiment concretely. 本実施の形態で第1の解析部を更に具体的に表わしたブロック図である。It is a block diagram showing the 1st analysis part more concretely in this embodiment. 本実施の形態で第1の解析手順実行部が実行する処理の様子を表わした流れ図である。It is a flowchart showing the mode of the process which the 1st analysis procedure execution part performs in this Embodiment. 本発明の変形例におけるエラー情報修正装置の構成を表わしたブロック図である。It is a block diagram showing the structure of the error information correction apparatus in the modification of this invention. 本実施の形態のエラー情報修正装置でソースコードを読み取って修正ソースを生成するまでの装置の制御の概要を示す流れ図である。It is a flowchart which shows the outline | summary of control of an apparatus until the error information correction apparatus of this Embodiment reads a source code and produces | generates a correction source.

符号の説明Explanation of symbols

100、100A エラー情報修正装置
101 CPU
102、102A メモリ
105 ソースコード
106 ソースコード読込部
107 構文解析部
108 エラー情報解析部
109 ソース修正情報データベース
111 操作入力部
112 表示部
113 データ格納部
1131 修正可能情報格納領域
1132 修正不可能情報格納領域
115 修正ソース生成部
116 修正ソース
117 ソース差分情報
141 定義データテーブル
142 第1の解析手順実行部
100, 100A error information correction device 101 CPU
102, 102A Memory 105 Source code 106 Source code reading unit 107 Syntax analysis unit 108 Error information analysis unit 109 Source correction information database 111 Operation input unit 112 Display unit 113 Data storage unit 113 1 Correctable information storage area 113 2 Uncorrectable information Storage area 115 Modified source generation unit 116 Modified source 117 Source difference information 141 Definition data table 142 First analysis procedure execution unit

Claims (6)

検査対象となるプログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出手段と、
このエラー検出手段によって検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定手段と、
このエラー原因特定手段によって原因が特定されたエラーに対して、原因別に前記エラー検出手段によるエラーの検出が行われないような仮の修正を行う仮修正手段と、
この仮修正手段によって修正されたプログラムの前記エラーをひとまとまりのグループとして出力する仮修正エラー出力手段と、
前記検査対象となるプログラムにおける前記仮修正手段によっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力手段
とを具備することを特徴とするプログラムのエラー情報出力装置。
Error detection means for detecting errors in the description of the program to be inspected in order along the described lines;
Error cause identification means for analyzing each error detected by the error detection means and determining for each error whether the cause of the error is specific,
Temporary correction means for making a temporary correction such that the error detection means does not detect an error for each cause for the error whose cause is specified by the error cause specifying means;
Temporary correction error output means for outputting the error of the program corrected by the temporary correction means as a group,
An error information output device for a program, comprising: error location information output means for individually indicating locations of errors that cannot be corrected by the temporary correction means in the program to be inspected.
前記エラー検出手段が検出したエラーの修正内容をエラーごとに対比して格納したエラー修正データベースを備え、前記エラー原因特定手段はこのエラー修正データベースで検索して修正が可能なエラー以外のエラーに対してエラー原因の特定を行う手段であることを特徴とする請求項1記載のエラー情報出力装置。   An error correction database storing the correction contents of the error detected by the error detection means for each error is stored, and the error cause identification means searches for errors other than errors that can be corrected by searching in the error correction database. 2. The error information output apparatus according to claim 1, wherein the error information output means is a means for identifying the cause of the error. 前記仮修正エラー出力手段から出力される修正されたプログラムが修正内容のままでよいか、更なる修正が必要であるかを入力する操作入力手段を具備することを特徴とする請求項1記載のエラー情報出力装置。   2. The operation input means for inputting whether the corrected program output from the temporary correction error output means may remain as a correction content or further correction is required. Error information output device. 前記検査対象となるプログラムはソースコードで記述されており、前記エラー検出手段はソースコードを機械語コードに変換する際のコンパイルエラーを出力する手段であることを特徴とする請求項1記載のエラー情報出力装置。   2. The error according to claim 1, wherein the program to be inspected is described in source code, and the error detecting means is means for outputting a compile error when converting the source code into machine language code. Information output device. 検査対象となるプログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出ステップと、
このエラー検出ステップで検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定ステップと、
このエラー原因特定ステップによって原因が特定されたエラーに対して、原因別に前記エラー検出ステップによるエラーの検出が行われないような仮の修正を行う仮修正ステップと、
この仮修正ステップによって修正されたプログラムの前記エラーをひとまとまりのグループとして出力する仮修正エラー出力ステップと、
前記検査対象となるプログラムにおける前記仮修正ステップによっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力ステップ
とを具備することを特徴とするプログラムのエラー情報出力方法。
An error detection step for sequentially detecting errors in the description of the program to be inspected along the described lines;
An error cause identifying step for analyzing each error detected in this error detection step and determining whether or not the cause of the error can be identified for each error,
A temporary correction step for performing a temporary correction so that the error detection by the error detection step is not performed according to the cause for the error whose cause is specified by the error cause specifying step;
A temporary correction error output step for outputting the error of the program corrected by the temporary correction step as a group;
An error location information output method for a program, comprising: an error location information output step for individually indicating locations of errors that cannot be corrected by the temporary correction step in the program to be inspected.
検査対象となるプログラムの記述上のエラーを修正するコンピュータに、
前記プログラムの記述上のエラーを記述された行に沿って順に検出するエラー検出処理と、
このエラー検出処理で検出されたそれぞれのエラーを解析して、エラーの原因の特定の可否をエラーごとに判別するエラー原因特定処理と、
このエラー原因特定処理によって原因が特定されたエラーに対して、原因別に前記エラー検出処理によるエラーの検出が行われないような仮の修正を行う仮修正処理と、
この仮修正処理によって修正されたプログラムの前記エラーをひとまとまりのグループとして出力する仮修正エラー出力処理と、
前記検査対象となるプログラムにおける前記仮修正処理によっては修正できないエラーについてのそれぞれの所在を個別に示すエラー所在情報出力処理
とを実行させることを特徴とするプログラムのエラー情報出力プログラム。
A computer that corrects errors in the description of the program to be inspected,
An error detection process for detecting errors in the description of the program in order along the described lines;
Analyzing each error detected in this error detection process, an error cause identifying process for determining whether or not the cause of the error can be identified for each error,
For the error whose cause is specified by this error cause specifying process, a temporary correction process for performing a temporary correction so that the error detection process is not detected for each cause, and
Temporary correction error output processing for outputting the error of the program corrected by the temporary correction processing as a group,
An error information output program for a program, wherein an error location information output process for individually indicating locations of errors that cannot be corrected by the temporary correction process in the program to be inspected is executed.
JP2008234089A 2008-09-12 2008-09-12 Program error information output device, error information output method, and error information output program Expired - Fee Related JP5369565B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008234089A JP5369565B2 (en) 2008-09-12 2008-09-12 Program error information output device, error information output method, and error information output program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008234089A JP5369565B2 (en) 2008-09-12 2008-09-12 Program error information output device, error information output method, and error information output program

Publications (2)

Publication Number Publication Date
JP2010067103A true JP2010067103A (en) 2010-03-25
JP5369565B2 JP5369565B2 (en) 2013-12-18

Family

ID=42192622

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008234089A Expired - Fee Related JP5369565B2 (en) 2008-09-12 2008-09-12 Program error information output device, error information output method, and error information output program

Country Status (1)

Country Link
JP (1) JP5369565B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012248050A (en) * 2011-05-30 2012-12-13 Nec Commun Syst Ltd Static analysis support device, static analysis support method, and program
JP2014170530A (en) * 2013-02-28 2014-09-18 Tata Consultancy Services Ltd System and method for grouping caution generated during static analysis
WO2017168560A1 (en) * 2016-03-29 2017-10-05 三菱電機株式会社 Development support device and development support method
JP2018084939A (en) * 2016-11-22 2018-05-31 富士通株式会社 Correction support program, correction support method, correction support device, and compiler
JP2021140433A (en) * 2020-03-04 2021-09-16 株式会社日立製作所 Development support method, development support device, and program

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63245738A (en) * 1987-04-01 1988-10-12 Nec Corp Automatic correcting system for data item with undefined program
JPH01307832A (en) * 1988-06-07 1989-12-12 Nec Corp System for automatically correcting grammatical error of source program in compiler
JPH03263129A (en) * 1990-03-13 1991-11-22 Fujitsu Ltd Compiler/debugger method
JPH11296366A (en) * 1998-04-07 1999-10-29 Nec Corp Error detecting device and method therefor and recording medium
JP2007080207A (en) * 2005-09-16 2007-03-29 Ricoh Co Ltd Program development support system and linker
JP2008020972A (en) * 2006-07-11 2008-01-31 Hitachi Ltd Software analysis system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63245738A (en) * 1987-04-01 1988-10-12 Nec Corp Automatic correcting system for data item with undefined program
JPH01307832A (en) * 1988-06-07 1989-12-12 Nec Corp System for automatically correcting grammatical error of source program in compiler
JPH03263129A (en) * 1990-03-13 1991-11-22 Fujitsu Ltd Compiler/debugger method
JPH11296366A (en) * 1998-04-07 1999-10-29 Nec Corp Error detecting device and method therefor and recording medium
JP2007080207A (en) * 2005-09-16 2007-03-29 Ricoh Co Ltd Program development support system and linker
JP2008020972A (en) * 2006-07-11 2008-01-31 Hitachi Ltd Software analysis system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012248050A (en) * 2011-05-30 2012-12-13 Nec Commun Syst Ltd Static analysis support device, static analysis support method, and program
JP2014170530A (en) * 2013-02-28 2014-09-18 Tata Consultancy Services Ltd System and method for grouping caution generated during static analysis
WO2017168560A1 (en) * 2016-03-29 2017-10-05 三菱電機株式会社 Development support device and development support method
JP6289783B1 (en) * 2016-03-29 2018-03-07 三菱電機株式会社 Development support apparatus and development support method
JP2018084939A (en) * 2016-11-22 2018-05-31 富士通株式会社 Correction support program, correction support method, correction support device, and compiler
JP2021140433A (en) * 2020-03-04 2021-09-16 株式会社日立製作所 Development support method, development support device, and program
JP7296904B2 (en) 2020-03-04 2023-06-23 株式会社日立製作所 Development support method, development support device and program

Also Published As

Publication number Publication date
JP5369565B2 (en) 2013-12-18

Similar Documents

Publication Publication Date Title
US9710243B2 (en) Parser that uses a reflection technique to build a program semantic tree
US7827155B2 (en) System for processing formatted data
US20070250509A1 (en) User interface for machine aided authoring and translation
US8387010B2 (en) Automatic software configuring system
US9038036B2 (en) Generation of source code and executable code from formal descriptions
JP5369565B2 (en) Program error information output device, error information output method, and error information output program
US10261884B2 (en) Method for correcting violation of source code and computer readable recording medium having program performing the same
US20070250821A1 (en) Machine declarative language for formatted data processing
JP5845888B2 (en) Software correction apparatus, software correction system, software correction method, and software correction program
US20070250528A1 (en) Methods for processing formatted data
US9557965B2 (en) Method for programming language dependent merging of program codes
US9495638B2 (en) Scalable, rule-based processing
WO2010050128A1 (en) Compiling method and compiling program
CN117010345A (en) Method, device, equipment and storage medium for generating function document
US20070266367A1 (en) Relationship Management For Data Modeling In An Integrated Development Environment
JP2016057715A (en) Graphic type program analyzer
JP2010198522A (en) Method and support system for analyzing source code
JP6369177B2 (en) Development support program, development support method, and development support apparatus
Kulkarni et al. Automatic Syntax Error Correction
JP6766611B2 (en) Correction support program, correction support method, and correction support device
JP2008020972A (en) Software analysis system
JP2007310829A (en) Data processor, data processing method and data processing program
JPH1185536A (en) Device and method for automatically correcting error of source program
Reid et al. Using the TypeScript compiler to fix erroneous Node. js snippets
JP5095128B2 (en) Data processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110811

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20121016

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130108

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130305

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130528

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130722

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130902

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees