JPH0264822A - Error detecting method for file processing - Google Patents
Error detecting method for file processingInfo
- Publication number
- JPH0264822A JPH0264822A JP21701788A JP21701788A JPH0264822A JP H0264822 A JPH0264822 A JP H0264822A JP 21701788 A JP21701788 A JP 21701788A JP 21701788 A JP21701788 A JP 21701788A JP H0264822 A JPH0264822 A JP H0264822A
- Authority
- JP
- Japan
- Prior art keywords
- file
- program
- processing
- flag
- compiler
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔概 要〕
計算機における、ファイル処理に関するプログラミング
のエラーの検出のためのコンパイラの処理に関し、
未オープンのファイルに関する処理を検出してエラーメ
ツセージを発行する目的プログラムを、指定によりコン
パイラが自動生成して、エラー検出を容易にするファイ
ル処理エラー検出方法を目的とし、
計算機の原始プログラムを翻訳して目的プログラムを生
成するコンパイラの処理において、所定の指定がある場
合には、該原始プログラムに指定された各ファイルにつ
いて、オープン状態か非オープン状態かを表示する所定
のフラグを設け、該ファイルのオープン及びクローズを
指定する該原始ブ1グラムから生成する該目的プログラ
ムに、該オープン及びクローズの処理の後に該フラグを
それぞれオープン状態及び非オーブン状態の表示にする
プログラムを付加し、該ファイルに対するアクセスを指
定する該原始プログラムから生成する該目的プログラム
に、該アクセス処理の前に該フラグを検査し、該フラグ
が非オーブン状態表示の場合に所定のエラーメツセージ
を出力するプログラムを付加するように構成する。[Detailed Description of the Invention] [Summary] Regarding compiler processing for detecting programming errors related to file processing in a computer, a purpose program that detects processing related to unopened files and issues an error message is specified. The purpose of the file processing error detection method is to automatically generate a file processing error detection method that is automatically generated by a compiler to facilitate error detection, and when there is a predetermined specification in the compiler process that translates a computer source program and generates a target program, For each file specified in the source program, a predetermined flag is set to indicate whether it is in an open or non-open state, and the target program generated from the source program that specifies opening and closing of the file is set. After the open and close processing, add a program to display the flag as open state and non-open state, respectively, and add a program to the target program generated from the source program that specifies access to the file, before the access processing. A program is added that checks the flag and outputs a predetermined error message when the flag indicates a non-oven state.
本発明は、計算機における、ファイル処理に関するプロ
グラミングのエラーの検出のためのコンパイラの処理に
関する。The present invention relates to compiler processing for detecting programming errors related to file processing in a computer.
事務処理用等のプログラムでは、一般にファイルの使用
が多いので、ファイル処理に関するプログラミングエラ
ーも多くなり、このようなエラーは実行時に異常を検出
しても、原因を検索することが容易でない。Since programs for office processing and the like generally use files frequently, there are many programming errors related to file processing, and even if an abnormality is detected during execution of such errors, it is not easy to search for the cause.
〔従来の技術と発明が解決しようとする課題〕第3図は
、例えば公知のC0BOL言語で記述されたプログラム
の一例であ不。[Prior art and problems to be solved by the invention] FIG. 3 is an example of a program written in, for example, the well-known C0BOL language.
C0BOL言語で公知の、ファイルを定義するrDAT
A DIVISION J (7) rFILE 5E
CTTONJ ニおいて、FILE−^というファイル
が定義される。ここの記述は公知のように、FILE−
AがA−RECというレコードからなり、レコードは4
桁の数字コードからなるBフィールドと、5桁の文字コ
ードからなるCフィールドと、71桁の文字コードから
なるFILLERフィールドからなることを示す。rDAT, which defines a file, known in the C0BOL language
A DIVISION J (7) rFILE 5E
A file called FILE-^ is defined in CTTONJ. As is well known, the description here is FILE-
A consists of records called A-REC, and there are 4 records.
It shows that the field consists of a B field consisting of a digit code, a C field consisting of a 5 digit character code, and a FILLER field consisting of a 71 digit character code.
rPROcEDURE DIVISIONJ ニ記述さ
れた手続きにお゛いて、rOPEN 0UTPUT F
ILE−AJはFILE−Aのオープン処理を指定する
プログラムの命令文(以下において単に命令という)で
あり、コンパイラはこの命令に対応して、いわゆるファ
イルのオープンの処理を実行する目的プログラムを生成
する。rPROcEDURE DIVISIONJ In the procedure described above, rOPEN 0UTPUT F
ILE-AJ is a program instruction statement (hereinafter simply referred to as an instruction) that specifies the open processing of FILE-A, and the compiler generates a target program that executes the so-called file open processing in response to this instruction. .
この目的プログラムは、FILE−Aを実際のファイル
と関係付けてアクセスの実行を可能にするように制御情
報を設定し、又そのファイルとの入出力ノタメのレコー
ド領域を割り当てる(即ち、そのレコード領域を指示す
るポインタを取得する)処理を行う。こ\でレコード領
域の構成は前記のファイルの定義に記述されているA−
RECレコードの定義に従うようにする。This purpose program associates FILE-A with the actual file, sets control information to enable access, and allocates a record area for input/output with that file (i.e., its record area (obtain a pointer that points to). Here, the structure of the record area is A-, which is described in the file definition above.
Make sure to follow the REC record definition.
その後に続< rMOVE 1234 TO8J等ノM
OVE命令から生成される目的プログラムは、前記で準
備されたポインタの指示するレコード領域の指定フィー
ルドに対してデータの移動を行い、その次のrWRIT
lli A−RECJ命令から生成される目的プログラ
ムは、そのレコード領域の内容をFILE−Aとしてオ
ーブンしたファイルに書き出すようにする。Continued < rMOVE 1234 TO8J etc.
The target program generated from the OVE instruction moves data to the specified field of the record area pointed to by the pointer prepared above, and executes the next rWRIT.
The object program generated from the lli A-RECJ command writes the contents of the record area to the opened file as FILE-A.
このプログラム例では、次にrcLOsEFILE−A
J命令があるので、コンパイラはこの命令に対応して、
前記の処理を終わるとファイルFILE−Aのクローズ
処理を行う目的プログラムを生成し、このクローズ処理
の目的プログラムは、前記のレコード領域の割当及びF
ILE−Aの実際のファイルとの結合関係を解消する。In this example program, then rcLOsEFILE-A
Since there is a J instruction, the compiler responds to this instruction by
When the above processing is completed, a purpose program for closing the file FILE-A is generated, and this close processing purpose program performs the record area allocation and F
Dissolve the connection between ILE-A and the actual file.
従ってその次のrDISPLAY CJ命令、即ちレコ
ード領域のCフィールドの内容をコンソール等へ出力す
ることを指定する命令から生成される目的プログラムが
、前記ポインタで指示される記憶領域をレコード領域と
してアクセスすると、ポインタ値は既に意味の無い内容
になっているので、その結果が正しいことは保証されず
、一般に異常状態を生じる。Therefore, when the target program generated from the next rDISPLAY CJ command, that is, the command that specifies that the contents of the C field of the record area be output to the console, etc., accesses the storage area pointed to by the pointer as the record area, Since the pointer value already has meaningless content, it is not guaranteed that the result is correct and will generally result in an abnormal condition.
即ち、このステップにrDIsPLAY CJ命令が置
かれているのは、オーブンされていないファイルのレコ
ード領域にアクセスするというプログラミングの誤りで
あるが、原始プログラムのチエツクの段階で、この誤り
が見過ごされた場合には、生成された目的プログラムを
実行して、何等かの異常な実行結果を得ることによって
、初めて何かの誤りの存在に気付くことになる。In other words, the reason why the rDIsPLAY CJ instruction is placed in this step is a programming error of accessing the record area of a file that has not been opened, but if this error was overlooked during the source program check stage. In this case, the existence of an error is noticed only when the generated target program is executed and some abnormal execution result is obtained.
しかし、その異常結果は一般にファイル処理の誤りを直
接示すような結果ではないので、異常結果の原因探索が
必ずしも容易では無いという問題がある。However, since the abnormal result generally does not directly indicate an error in file processing, there is a problem in that it is not always easy to search for the cause of the abnormal result.
本発明は、未オープンのファイルに関する処理を検出し
てエラーメツセージを発行する目的プログラムを、指定
によりコンパイラが自動生成して、実行時にこの検出プ
ログラムと共に動作し、エラー検出を容易にするファイ
ル処理エラー検出方法を目的とする。According to the present invention, a compiler automatically generates a program that detects processing related to unopened files and issues an error message, and operates together with this detection program during execution to facilitate file processing error detection. Aimed at detection methods.
第1図は、本発明の構成を示す処理の流れ図である。 FIG. 1 is a process flowchart showing the configuration of the present invention.
図はコンパイラにおいて、ファイル処理エラー検出プロ
グラムを挿入するための処理の流れを示し、1〜7は処
理ステップである。The figure shows the flow of processing for inserting a file processing error detection program in a compiler, and 1 to 7 are processing steps.
計算機の原始プログラムを翻訳して目的プログラムを生
成するコンパイラの処理において、l命令の解析ごとに
、第1図の処理ステップ1で識別して所定の指定がある
場合には、処理ステップ2〜3でファイルに関する処理
か識別して、それがファイルのオープン及びクローズで
あれば、その原始プログラムから生成する目的プログラ
ムに、処理ステップ5及び6で、そのオープン及びクロ
ーズの処理の後に、原始プログラムに指定された各ファ
イルについて、オープン状態か非オープン状態かを表示
するように設けるフラグを、それぞれオープン状態及び
非オープン状態の表示にするプログラムを付加する。In the process of a compiler that translates a computer source program to generate a target program, each time an l instruction is analyzed, if there is a predetermined designation identified in process step 1 of FIG. 1, process steps 2 to 3 are performed. In step 5 and step 6, after the open and close processing, the process is specified in the target program to be generated from the source program. For each file, a flag is set to indicate whether it is in an open state or a non-open state, and a program is added to display the flag as an open state or a non-open state, respectively.
又、処理した命令がファイルに対するアクセスの指定で
あれば、処理ステップ7でアクセス処理の前に該当ファ
イルのフラグを検査し、フラグが非オープン状態表示の
場合に所定のエラーメツセージを出力するプログラムを
付加する。Furthermore, if the processed instruction specifies access to a file, in step 7 a program is executed that checks the flag of the file before the access process and outputs a predetermined error message if the flag indicates a non-open status. Add.
以上の処理方法により、必要な場合にコンパイラに指定
すれば、コンパイルの中で未オープンのファイルに関す
る処理を検出してエラーメツセージを発行する目的プロ
グラムが自動生成されるので、そのプログラムを実行す
れば、未オープンのファイルへのアクセス時に適当なエ
ラーメツセージが出されるのでエラー原因の検索が容易
になる。With the above processing method, if you specify it to the compiler when necessary, a target program that detects processing related to unopened files during compilation and issues an error message will be automatically generated, so when you run that program, , an appropriate error message is displayed when accessing an unopened file, making it easier to search for the cause of the error.
本発明によって必要になる、ファイルのオープン状態を
表示するフラグには、例えばファイルアクセスのための
制御情報を保持する制御プロ・2り(ファイル管理ブロ
ック等と呼ばれる)としてコンパイラによってファイル
ごとに設けらる制御ブロックの未使用ビットを割り当て
、例えばそのピントがオフの場合に非オープン状態、オ
ンの場合にオープン状態を表示するものとする。The flag that indicates the open status of a file, which is required by the present invention, is set by the compiler for each file as a control program (called a file management block, etc.) that holds control information for file access, for example. For example, when the focus is off, the non-open state is displayed, and when the focus is on, the open state is displayed.
又、本発明のコンパイラは、公知のコンパイル時の各種
オプションに、ファイル処理エラー検出オプションを加
えて指定可能とし、コンパイラの起動時に受は取る。Further, the compiler of the present invention allows a file processing error detection option to be specified in addition to various known options at the time of compiling, and is accepted at the time of starting the compiler.
第2図は、前記第3図の原始プログラム例について、原
始プログラムの命令とコンパイラの処理と、生成された
ファイル処理エラー検出プログラムの実行結果とを対応
付けて説明する図である。FIG. 2 is a diagram illustrating the source program example shown in FIG. 3 by associating the instructions of the source program, the processing of the compiler, and the execution result of the generated file processing error detection program.
コンパイラは前記従来の場合と同様に原始プログラムの
各命令を解析し、第3図のプログラム例(7) rOP
EN 0UTPUT FILE−Al命令を第2図の処
理ステップ10で処理すると処理ステップ11で第1図
の処理に入り、処理ステップ1でファイル処理エラー検
出オプションが指定されているか識別し、指定されてい
なければ、ここの処理は終わって次の命令の処理に進む
。The compiler analyzes each instruction of the source program in the same way as in the conventional case, and creates the program example (7) rOP in Figure 3.
When the EN 0UTPUT FILE-Al command is processed in processing step 10 of FIG. 2, the processing of FIG. If so, the processing here is finished and the processing proceeds to the next instruction.
ファイル処理エラー検出オプションが指定されていれば
ステップ2を経て処理ステップ5に進み、FILE−A
のファイル管理ブロックに設けた前記フラグ(以下にお
いてFILE−Aのフラグという)をオンにして、FI
LE−Aがオープン状態であることを表示するような目
的プログラムを出力する。If the file processing error detection option is specified, the process proceeds to step 5 via step 2, and FILE-A
Turn on the flag provided in the file management block of FILE-A (hereinafter referred to as the FILE-A flag), and
Output a target program that displays that LE-A is in an open state.
実際には、コンパイラは例えば所要の会プログラムを呼
び出す目的プログラムを出力し、このプログラムが例え
ば前記処理を実行するサブルーチンをFILE−Aのフ
ァイル管理ブロックの番地をパラメータとして呼び出す
ように構成し、第2図の実行結果の欄に示すように、こ
のプログラムが実行されると、FILE−Aのフラグが
オンにされる。In reality, the compiler outputs a target program that calls a required program, and configures this program to call, for example, a subroutine that executes the above processing using the address of the file management block of FILE-A as a parameter. As shown in the execution result column of the figure, when this program is executed, the FILE-A flag is turned on.
次に、rMOVE 1234 To BJ等(7) M
OVB命令や、rWRITE A−RfICl命令等、
ファイルに関するデ−夕の設定・参照を行う命令を処理
ステップ12で処理すると、各命令の処理後の処理ステ
ップ13で第1図の処理に入り、処理ステップ1.2.
3、4を経て処理ステップ7に進み、FILE−へのフ
ラグを識別して、もしフラグのオフによって非オーブン
状態が表示されていればエラーメツセージを出力して、
そのメツセージで例えば該当する原始プログラムの命令
を指示するプログラムを呼び出す目的プログラムを出力
する。Next, rMOVE 1234 To BJ et al. (7) M
OVB command, rWRITE A-RfICl command, etc.
When commands for setting and referencing file-related data are processed in processing step 12, the processing shown in FIG. 1 is entered in processing step 13 after each command is processed, and processing steps 1.2.
3 and 4, proceed to processing step 7, identify the flag to FILE-, and output an error message if a non-oven state is displayed due to the flag being turned off.
The message outputs, for example, a target program that calls a program that instructs the instructions of the corresponding source program.
このプログラムは、例えば前記処理を実行するサブルー
チンをFILE−Aのファイル管理ブロックの番地及び
所要のメツセージ内容の番地をパラメータとして呼び出
すように構成したプログラムであり、第2図の実行結果
の欄に示すように、このプログラムが実行されると、こ
の場合はFILE−Aのフラグがオンであるので、エラ
ーメソセージの出力は無く正常に処理が進む。This program is a program configured to call a subroutine that executes the above processing, for example, using the address of the file management block of FILE-A and the address of the required message content as parameters, and is shown in the execution result column of Figure 2. When this program is executed, the FILE-A flag is on in this case, so no error message is output and the process proceeds normally.
次に、第2図の処理ステップ14でr CLO5EFI
LE−AJ命令を処理すると、処理ステップ15で第1
図の処理に入り、処理ステップ1.2.3を経て処理ス
テップ6に進み、FILE−Aのフラグをオフにして、
FILE−Aが非オープン状態であることを表示するプ
ログラムを呼び出す目的プログラムを出力する。Next, in processing step 14 of FIG.
When the LE-AJ instruction is processed, the first
Enter the process shown in the figure, proceed to process step 6 through process step 1.2.3, turn off the FILE-A flag,
Output a target program that calls a program that indicates that FILE-A is not open.
このプログラムは、例えば前記処理を実行するサブルー
チンをFILE−Aのファイル管理ブロックの番地をパ
ラメータとして呼び出すように構成したプログラムであ
り、第2図の実行結果の欄に示すように、このプログラ
ムが実行されると、FILE−Aのフラグがオフにされ
る。This program is, for example, a program configured to call a subroutine that executes the above processing using the address of the file management block of FILE-A as a parameter, and as shown in the execution result column of FIG. Then, the flag of FILE-A is turned off.
次の第2図の処理ステップ16でrDISPLAY C
J命令を処理すると、処理ステップ17で第1図の処理
に入り、前記処理ステップ13の場合と同様の目的プロ
グラムが出力される。In the next processing step 16 of FIG.
When the J instruction is processed, the process shown in FIG. 1 is entered in step 17, and the same target program as in step 13 is output.
このプログラムが実行されると、第2図の実行結果の欄
に示すように、この場合はFILE−Aのフラグが前記
の処理でオフにされているので、エラーメソセージの出
力が行われ、例えばエラーの種類と該当命令が示される
。従って利用者はその命令にオープンされていないファ
イルのレコード領域を参照等しようとするプログラミン
グ誤りを持つことを容易に検出することができる。When this program is executed, as shown in the execution result column of Figure 2, since the FILE-A flag was turned off in the above process, an error message is output. For example, the type of error and the relevant instruction are shown. Therefore, the user can easily detect a programming error in attempting to refer to a record area of a file that is not opened by the command.
以上の説明から明らかなように本発明によれば、計算機
のファイル処理に関するプログラミングのエラーの検出
において、未オープンのファイルに関する処理を検出し
てエラーメツセージを発行する目的プログラムがコンパ
イラで自動生成されるので、そのプログラムを実行すれ
ば、エラーを検出して適当なメツセージを出力し、エラ
ー原因の検索が容易になって、プログラム開発の作業効
率を改善するという著しい工業的効果がある。As is clear from the above description, according to the present invention, in detecting programming errors related to computer file processing, a compiler automatically generates a program for detecting processing related to unopened files and issuing an error message. Therefore, when the program is executed, an error is detected and an appropriate message is output, the cause of the error can be easily searched, and the work efficiency of program development is improved, which has a significant industrial effect.
第1図は本発明の構成を示す処理の流れ図、第2図は本
発明の詳細な説明図、
第3図は原始プログラム例を示す図である。
図において、
本発明の構成を示す処理の流れ図
第1図
〔原始プログラム〕
〔コンパイラ処理〕
〔第テ覗〕
本発明の詳細な説明図
原始プログラム例を示す図
第
図FIG. 1 is a process flow chart showing the configuration of the present invention, FIG. 2 is a detailed explanatory diagram of the present invention, and FIG. 3 is a diagram showing an example of a source program. In the figures, Figure 1 is a process flowchart showing the configuration of the present invention.
Claims (1)
成するコンパイラの処理において、所定の指定がある場
合には、該原始プログラムに指定された各ファイルにつ
いて、オープン状態か非オープン状態かを表示する所定
のフラグを設け、 該ファイルのオープン及びクローズを指定する該原始プ
ログラムから生成する該目的プログラムに、該オープン
及びクローズの処理の後に該フラグをそれぞれオープン
状態及び非オープン状態の表示にするプログラムを付加
し(1〜3、5、6)、該ファイルに対するアクセスを
指定する該原始プログラムから生成する該目的プログラ
ムに、該アクセス処理の前に該フラグを検査し、該フラ
グが非オープン状態表示の場合に所定のエラーメッセー
ジを出力するプログラムを付加する(4、7)ように構
成されていることを特徴とするファイル処理エラー検出
方法。[Claims] In the processing of a compiler that generates a target program by translating a computer source program, if there is a predetermined designation, each file specified in the source program is set in an open state or a non-open state. A predetermined flag is provided to indicate whether the file is to be opened or closed, and after the opening or closing processing is performed, the flag is set to indicate an open state or a non-open state, respectively, in the target program generated from the source program that specifies opening and closing of the file. (1 to 3, 5, 6), and to the target program generated from the source program that specifies access to the file, check the flag before the access processing, and check if the flag is non-zero. A method for detecting file processing errors, comprising: adding a program (4, 7) that outputs a predetermined error message when an open state is displayed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP21701788A JPH0264822A (en) | 1988-08-31 | 1988-08-31 | Error detecting method for file processing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP21701788A JPH0264822A (en) | 1988-08-31 | 1988-08-31 | Error detecting method for file processing |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0264822A true JPH0264822A (en) | 1990-03-05 |
Family
ID=16697523
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP21701788A Pending JPH0264822A (en) | 1988-08-31 | 1988-08-31 | Error detecting method for file processing |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0264822A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5351537A (en) * | 1992-08-28 | 1994-10-04 | Mitsubishi Denki Kabushiki Kaisha | Heat-sensitive flow rate sensor having a longitudinal wiring pattern for uniform temperature distribution |
-
1988
- 1988-08-31 JP JP21701788A patent/JPH0264822A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5351537A (en) * | 1992-08-28 | 1994-10-04 | Mitsubishi Denki Kabushiki Kaisha | Heat-sensitive flow rate sensor having a longitudinal wiring pattern for uniform temperature distribution |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11579856B2 (en) | Multi-chip compatible compiling method and device | |
| US5950006A (en) | Object-oriented programmable controller | |
| US5987250A (en) | Transparent instrumentation for computer program behavior analysis | |
| US9274923B2 (en) | System and method for stack crawl testing and caching | |
| US20030106046A1 (en) | Inheritance breakpoints for use in debugging object-oriented computer programs | |
| CN109343854B (en) | Intelligent automatic compiling method and system based on zynq system | |
| US7178135B2 (en) | Scope-based breakpoint selection and operation | |
| US6898545B2 (en) | Semiconductor test data analysis system | |
| JPH0264822A (en) | Error detecting method for file processing | |
| US9032372B2 (en) | Runtime environment and method for non-invasive monitoring of software applications | |
| JPH03127122A (en) | Arithmetic processing system in data processor | |
| JPH02275539A (en) | Debugging system | |
| JPH0934698A (en) | Software generation method and development support method | |
| JP2002005940A (en) | Data management device for analytical instruments | |
| JP2570593B2 (en) | Debug device | |
| CN113761857B (en) | A form processing method and device based on form designer | |
| JP2560545B2 (en) | Interface inspection processor | |
| JPS59142609A (en) | Controller of air conditioner with simulation function | |
| JPH05250221A (en) | Simulator execution system | |
| US10459825B2 (en) | Intelligent expansion of system information collection | |
| CN112527672A (en) | Detection method and equipment for shell adding tool | |
| CN116166254A (en) | System development method and device, electronic equipment and storage medium | |
| JPH02100146A (en) | Trace decision system | |
| JPH0731616B2 (en) | Program debug device | |
| JP2001229048A (en) | Debug device and debug method and recording medium with program for debug recorded |