JPH01106235A - Display system for error position in source program - Google Patents

Display system for error position in source program

Info

Publication number
JPH01106235A
JPH01106235A JP62265581A JP26558187A JPH01106235A JP H01106235 A JPH01106235 A JP H01106235A JP 62265581 A JP62265581 A JP 62265581A JP 26558187 A JP26558187 A JP 26558187A JP H01106235 A JPH01106235 A JP H01106235A
Authority
JP
Japan
Prior art keywords
source program
internal text
error
character
spaces
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP62265581A
Other languages
Japanese (ja)
Inventor
Yoichi Kitamura
陽一 北村
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 JP62265581A priority Critical patent/JPH01106235A/en
Publication of JPH01106235A publication Critical patent/JPH01106235A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To efficiently execute processing by forming a table consisting of an internal text from which spaces are removed the position of a character string in the internal text and the number of spaces up to the character string and detecting the position of an error-detected character in a source program on the basis of the internal text and the table. CONSTITUTION:The source program is scanned by an internal text/table forming means 1, only character strings are successively transferred to the internal text 5 and the positions of the character strings in the internal text 5 and the number of spaces meaningless in syntax generated up to the character strings are obtained and stored in the table 6. Then, a digit position in the internal text 5 about a character detected at its error in the translating process of the resource program in the internal text 5 is found out by an intra-source program error position detecting means 2 and the number of spaces obtained from the table 6 is added to the digit position. Then, an intra-source program error position is displayed on a source program list by an intra-source program error position displaying means 3.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、コンパイラに人力された原始プログラム内で
検出された文法上の誤り等の位置を、原始プログラムイ
メージリストに表示する方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for displaying, on a source program image list, the location of grammatical errors etc. detected in a source program manually input by a compiler.

(従来の技術) 従来、コンパイル時に検出された誤りのある位置を原始
プログラムイメージリスト上に表示する場合、翻訳処理
においては不要な構文上無意味な空白も含まれたままの
内部テキストを翻訳処理でも使用して、誤りのある桁位
置を得て該当する位置に表示していた。
(Prior art) Conventionally, when displaying the location of an error detected during compilation on a source program image list, the internal text that still contains unnecessary syntactically meaningless whitespace is translated during the translation process. However, I used it to get the erroneous digit position and display it at the corresponding position.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

一般に、原始プログラム内には、コンパイラが出力する
原始プログラムリストを見易くするための目的で利用者
により構文上無意味な空白が記述されている場合が多い
が、構文上無意味な空白を含んだままの内部テキストを
使用する従来の方式では翻訳処理−トは不要の空白も含
んでいることになり、翻訳処理時に内部テキスト内の構
文上無意味な空白をスキップするという処理が必要であ
った。
In general, syntactically meaningless whitespace is often written by the user in the source program for the purpose of making it easier to read the source program list output by the compiler. In the conventional method of using the original internal text, the translation process would include unnecessary spaces, and it was necessary to skip syntactically meaningless spaces in the internal text during the translation process. .

〔問題点を解決するための手段〕[Means for solving problems]

本発明の原始プログラム内誤り位置表示方式原始プログ
ラムを走査して構文上意味のある文字列のみを記憶域の
内部テキスト領域に順次移送するとともに、内部テキス
ト領域に移送された文字列の内部テキスト領域内での位
置と、その文字列までに表われた構文上無意味な空白の
数を得、これらを組にしてテーブルに格納する内部テキ
スト・テーブル作成手段と、 内部テキスト・テーブル作成手段で内部テキストおよび
テーブルが作成された後、内部テキストの原始プログラ
ムを翻訳する過程で誤りか検出された文字の内部テキス
ト上での桁位置を求め、同じ位置があれば対応する空白
の数をテーブルから得、同じ桁位置がなければ該桁位置
よりも小さく、かつ最も大きい桁位置に対応する空白の
数をデープルから得、該桁位置に得られた空白の数を加
える原始プログラム内誤り位置検出手段と、原始プログ
ラム内誤り位置検出手段で検出された原始プログラム内
誤り位置を原始プログラムリスト上に表示する原始プロ
グラム内誤り位置表示手段とを有している。
Error position display method in a source program of the present invention Scans the source program and sequentially moves only syntactically meaningful strings to the internal text area of the storage area, and also internal text area of the strings transferred to the internal text area an internal text table creation means that obtains the position within the string and the number of syntactically meaningless spaces that have appeared up to that character string, and stores these as a set in a table; After the text and table are created, find the column position in the internal text of the character detected as an error during the process of translating the source program of the internal text, and if the same position exists, obtain the corresponding number of spaces from the table. , if there is no same digit position, the number of blanks corresponding to the largest digit position smaller than the digit position is obtained from the duple, and the error position detection means in the source program is added to the digit position. and source program error position display means for displaying the source program error position detected by the source program error position detection means on the source program list.

〔作 用〕[For production]

構文上無意味な空白を除いた内部テキストを使用するの
で、処理が効率良く行なわれる。
Processing is efficient because the internal text is used without syntactically meaningless whitespace.

(実施例) 次に、本発明の実施例について図面を参照して説明する
(Example) Next, an example of the present invention will be described with reference to the drawings.

第1図は本発明の原始プログラム内誤り位置表示方式の
一実施例の構成図である。
FIG. 1 is a block diagram of an embodiment of a method for displaying error positions in a source program according to the present invention.

本実施例は、原始プログラム4を走査して構文上、0味
のある文字列のみを記憶域の内部テキスト5の領域に順
次移送するとともに、内部テキスト5の領域に移送され
た文字列の内部テキスト5領域内での位置と、その文字
列までに表われた構文上無50味な空白の数を得、これ
らを組にしてテーブル6に格納する内部テキスト・テー
ブル作成手段lと、内部テキスト・テーブル作成手段1
で内部テキスト5およびテーブル6が作成された後、内
部テキスト5の原始プログラムを翻訳する過程で誤りが
検出された文字の内部テキスト5上での桁位置を求め、
同じ位置があれば対応する空白の数をテーブル6から得
、同じ桁位置がなければ該゛ 桁位置よりも小さく、か
つ最も大きい桁位置に対応する空白の数をテーブル6か
ら得、註桁位置に得られた空白の数を加える原始プログ
ラム内誤り位置検出手段2と、原始プログラム内誤り検
出手段2で検出された原始プログラム内誤り位置を原始
プログラムリスト上に表示する原始プログラム内誤り位
置表示手段3とからなっている。
This embodiment scans the source program 4 and sequentially transfers only character strings that have a syntactical meaning to the internal text 5 area of the storage area, and the internal text of the character strings transferred to the internal text 5 area an internal text table creation means 1 that obtains the position within the text 5 area and the number of syntactically meaningless spaces that have appeared up to that character string, and stores these as a set in a table 6;・Table creation means 1
After the internal text 5 and table 6 are created, find the digit position on the internal text 5 of the character in which an error was detected in the process of translating the source program of the internal text 5,
If the same position exists, the number of corresponding blanks is obtained from Table 6, and if there is no same digit position, the number of blanks corresponding to the largest digit position that is smaller than the corresponding digit position is obtained from Table 6, and the number of blanks corresponding to the largest digit position is obtained from Table 6. source program error position detection means 2 for adding the number of blanks obtained in the source program; and source program error position display means for displaying the source program error position detected by the source program error detection means 2 on a source program list. It consists of 3.

なお、以降の説明においては、「構文上無意味な空白」
は中、に「空白」と述べることにする。
In addition, in the following explanation, "syntactically meaningless white space"
I will say "blank" in the middle.

第2図は第1図中の内部テキスト・テーブル作成り段1
の処理を示すフローチャートである。人力された原始プ
ログラム4を走査しくステップ口)、構文上意味がある
文字列のみを記憶域内の内部テキスト5に移送する(ス
テップ+2)。その際、移送された文字列の内部テキス
ト5内での位置を得る(ステップ+3)。また、その時
点までの原始プログラム4内での空白の数を得る(ステ
ップ14)。これら二つの得られた値、即ち、移送され
た文字列の内部テキスト5内での位置とその時点での空
白の数とを一要素にまとめテーブル6に格納する(ステ
ップ15)。以上の処理を繰り返す(ステップ+6)こ
とによって、人力された原始プログラム4は、空白が取
り除かれた形式の原始プログラムイメージとして内部テ
キスト5に格納される。一方、内部テキスト5内に移送
された文字列の移送9位毎の内部テキスト5内での文字
位置とその時点までの空白の数とから成るデータを一要
素とするテーブル6が作成される。
Figure 2 is the internal text table creation stage 1 in Figure 1.
3 is a flowchart showing the processing of FIG. The human-written source program 4 is scanned (Step 2), and only syntactically meaningful character strings are transferred to the internal text 5 in the storage area (Step 2). At this time, the position of the transferred character string within the internal text 5 is obtained (step +3). Furthermore, the number of blank spaces in the source program 4 up to that point is obtained (step 14). These two obtained values, ie, the position of the transferred character string in the internal text 5 and the number of spaces at that time, are combined into one element and stored in the table 6 (step 15). By repeating the above process (step +6), the human-written source program 4 is stored in the internal text 5 as a source program image with blanks removed. On the other hand, a table 6 is created in which one element is data consisting of the character position in the internal text 5 for each ninth position of the character string transferred into the internal text 5 and the number of spaces up to that point.

第3図は第2図中の原始プログラム内誤り位置検出手段
2の処理を示すフローチャートである。
FIG. 3 is a flowchart showing the processing of the error position detection means 2 in the original program shown in FIG.

誤りが検出された文字の内部テキスト5上での桁位置を
求め(ステップ21)、テーブル6内に同じ桁位置があ
れば対応する空白の数を得(ステップ22.23)、な
ければそれより小さくて、かつ最も大きい桁位置に対応
する空白数を得(ステップ22゜24)、最後にその空
白数を誤りが検出された内部テキスト5上での桁位置に
加えて(ステップ25)元の原始プログラムイメージ内
での位置が得られる。
The digit position of the character in which the error was detected in the internal text 5 is determined (step 21), and if the same digit position exists in the table 6, the corresponding number of spaces is obtained (step 22.23); Obtain the number of spaces corresponding to the smallest and largest digit position (steps 22 and 24), and finally add the number of spaces to the digit position on the internal text 5 where the error was detected (step 25). The position within the source program image is obtained.

次に、このように構成された本実施例を使用した場合の
具体的な例を第4図を参照して説明する。人力した原始
プログラム(第4図(1))内には、桁位置1と、桁位
置3と、桁位置7と8とに空白が含まれている。その原
始プログラムを左から走査すると、桁位置2に最初の有
効文字列”A”があり、その時点までの空白の数は1個
であるので、文字”A”を内部テキスト(第4図(2)
)の桁位置1に移送して、テーブル(第4図(3))の
最初の費ふとして文字位置1と空白の数1を格納する。
Next, a specific example of using this embodiment configured as described above will be described with reference to FIG. 4. The human-generated source program (FIG. 4 (1)) contains blank spaces at digit position 1, digit position 3, and digit positions 7 and 8. When the source program is scanned from the left, the first valid character string "A" is found in column position 2, and the number of spaces up to that point is 1, so the character "A" is inserted into the internal text (see Figure 4). 2)
) and store the character position 1 and the number of blanks 1 as the first space in the table (FIG. 4 (3)).

続いて、原始プログラム(第4図(1))を走査すると
、桁位置4から次の有効文字列”BCD”があり、その
時点までの空白の数は2個であるので、文字 BCD”
を内部テキスト(第4図(2))の桁位置2以降に移送
して、テーブル(第4図(3))の次の要素として文字
位置2と空白の数2を格納する。同様に、原始プログラ
ム(第4図(1))を走査すると、桁位置9に次の有効
文字列”E”があり、その時点までの空白の数は4個で
あるので、文字”E“を内部テキストの桁位置5に移送
して、テーブル(第4図(3))の次の要素として文字
位置5と空白の数4を格納する。
Next, when the source program (Figure 4 (1)) is scanned, the next valid character string "BCD" is found from digit position 4, and the number of blanks up to that point is 2, so the character "BCD" is found.
is moved to digit position 2 and beyond of the internal text (FIG. 4 (2)), and character position 2 and blank number 2 are stored as the next element in the table (FIG. 4 (3)). Similarly, when scanning the source program (Figure 4 (1)), the next valid character string "E" is found in column position 9, and the number of blanks up to that point is 4, so the character "E" is moved to column position 5 of the internal text, and character position 5 and blank number 4 are stored as the next element in the table (FIG. 4 (3)).

このようにして、空白を含む原始プログラム(第4図(
1))は、空白を取り除いた内部テキスト(第4図(2
))と、含まれていた空白の情報からなるテーブル(第
4図(3))とになる。
In this way, the source program containing blanks (Figure 4 (
1)) is the inner text with whitespace removed (see Figure 4 (2)).
)) and the included blank information (Figure 4 (3)).

次に、記憶域内に格納されている空白が取り除かれた原
始プログラムイメージからなる内部テキスト(第4図(
2))を翻訳処理する過程で誤りが検出された場合に行
なわれる元の原始プログラム(第4図(1))内での該
当位置への復元方法を説明する。
Next, the internal text (Figure 4) consisting of the source program image with whitespace removed stored in the storage area is
2)) A method of restoring to the corresponding position in the original source program (FIG. 4(1)) when an error is detected in the process of translating it will be explained.

(1)文字”A”に誤りがある場合 内部テキスト上での桁位置は1であるので、テーブル内
の要素の桁位置を調べると同じ値があるのでテーブル内
の対応する空白の数1を得ることができる。これらの得
られた値、内部テキスト上での桁位置1とその時点まで
の空白の数1を加えることにより、元の原始プログラム
上での位置2が得られる。
(1) If there is an error in the character "A", the digit position on the internal text is 1, so if you check the digit position of the element in the table, you will find the same value, so find the number 1 of the corresponding blank in the table. Obtainable. By adding these obtained values, digit position 1 on the internal text and number 1 of blanks up to that point, position 2 on the original source program is obtained.

(2)文字”B”に誤りがある場合 内部テキスト上での桁位置は2であるので、テーブル内
の要素の桁位置を調べると同じ値があるのでテーブル内
の対応する空白の数2を得ることができる。これらの得
られた値、内部テキスト上での桁位置2とその時点まで
の空白の数2を加えることにより、元の原始プログラム
上での位置4が得られる。
(2) If there is an error in the character "B", the digit position on the internal text is 2, so if you check the digit position of the element in the table, you will find the same value, so calculate the number of corresponding spaces in the table, 2. Obtainable. By adding these obtained values to the digit position 2 on the internal text and the number of blanks up to that point 2, position 4 on the original source program is obtained.

(3)文字”D”に誤りがある場合 内部デキスト上での桁位置は4であるので、テーブル内
の要素の桁位置を調べると同じ値は無いが、その数より
小さく、かつ最も大きい桁位置2があるのでテーブル内
の対応する空白の数2を得ることができる。これらの得
られた値、内部テキスト上での桁位置4とその時点まで
の空白の数2を加えることにより、元の原始プログラム
上での位置6が得られる。
(3) If there is an error in the character "D", the digit position on the internal text is 4, so if you check the digit position of the element in the table, there is no same value, but the digit that is smaller than that number and is the largest Since there is a position 2, we can obtain the corresponding number of blanks in the table, 2. By adding these obtained values, position 4 on the internal text and the number of blanks up to that point 2, position 6 on the original source program is obtained.

(発明の効果) 以上説明したように本発明は、翻訳処理では構文上無意
味な空白が取り除かれた形式の内部テキストと、内部テ
キスト内に移送された文字列の内部テキスト内の位置と
、その文字列までの空白の数からなるテーブルを作成し
、内部テキストとテーブルから誤りが検出された文字の
原始プログラム内の位置を検出することにより、処理が
効率良く行なえるという効果があり、利用者においては
、誤りの箇所を容易に見つけることができるという効果
がある。
(Effects of the Invention) As explained above, the present invention provides an internal text in a format in which syntactically meaningless white space is removed in translation processing, a position within the internal text of a character string transferred to the internal text, By creating a table consisting of the number of spaces up to that character string and detecting the position in the source program of the character where the error was detected from the internal text and the table, processing can be performed efficiently. This has the effect of making it easier for those who make mistakes to find the location of the error.

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

第1図は本発明の原始プログラム内誤り位置表示方式の
一実施例の構成図、第2図は第1図中の内部テキスト・
テーブル作成手段1の処理を示すフローチャート、第3
図は第2図中の原始プログラム内誤り位置検出手段2の
処理を示すフローチャート、第4図は本実施例を使用し
た場合の具体例を示す図である。 1・・・・・・内部テキスト・テーブル作成手段、2−
−−−−・原始プログラム内誤り位置検出手段、3・・
・・・・原始プログラム内誤り位置表示手段、4−−−
−−−原始プログラム、 5−−−−−・内部テキスト、 6・・・・・・テーブル。
FIG. 1 is a block diagram of an embodiment of the method for displaying errors in a source program according to the present invention, and FIG.
Flowchart showing processing of table creation means 1, 3rd
This figure is a flowchart showing the processing of the error position detection means 2 in the original program in FIG. 2, and FIG. 4 is a diagram showing a specific example when this embodiment is used. 1...Internal text table creation means, 2-
-----・Source program error position detection means, 3...
...Error position display means in source program, 4---
---Source program, 5--Internal text, 6...Table.

Claims (1)

【特許請求の範囲】 原始プログラムを走査して構文上意味のある文字列のみ
を記憶域の内部テキスト領域に順次移送するとともに、
内部テキスト領域に移送された文字列の内部テキスト領
域内での位置と、その文字列までに表われた構文上無意
味な空白の数を得、これらを組にしてテーブルに格納す
る内部テキスト・テーブル作成手段と、 内部テキスト・テーブル作成手段で内部テキストおよび
テーブルが作成された後、内部テキストの原始プログラ
ムを翻訳する過程で誤りが検出された文字の内部テキス
ト上での桁位置を求め、同し位置があれば対応する空白
の数をテーブルから得、同じ桁位置がなければ該桁位置
よりも小さく、かつ最も大きい桁位置に対応する空白の
数をテーブルから得、該桁位置に得られた空白の数を加
える原始プログラム内誤り位置検出手段と、原始プログ
ラム内誤り位置検出手段で検出された原始プログラム内
誤り位置を原始プログラムリスト上に表示する原始プロ
グラム内誤り位置表示手段とを有する原始プログラム内
誤り位置検出方式。
[Claims] Scanning a source program and sequentially transferring only syntactically meaningful character strings to an internal text area of a storage area,
Obtain the position in the internal text area of the string transferred to the internal text area and the number of syntactically meaningless spaces that appear up to that string, and store these as a pair in a table. After the internal text and table are created by the table creation means and the internal text table creation means, the digit position on the internal text of the character in which an error was detected during the process of translating the source program of the internal text is determined, and the If there is a position, the number of blanks corresponding to the position is obtained from the table, and if there is no same digit position, the number of blanks corresponding to the largest digit position that is smaller than the digit position is obtained from the table, and the number of blanks corresponding to the digit position is obtained from the table. a source program error position detection means for adding the number of blank spaces; and a source program error position display means for displaying the error position in the source program detected by the source program error position detection means on a source program list. In-program error position detection method.
JP62265581A 1987-10-20 1987-10-20 Display system for error position in source program Pending JPH01106235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62265581A JPH01106235A (en) 1987-10-20 1987-10-20 Display system for error position in source program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62265581A JPH01106235A (en) 1987-10-20 1987-10-20 Display system for error position in source program

Publications (1)

Publication Number Publication Date
JPH01106235A true JPH01106235A (en) 1989-04-24

Family

ID=17419110

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62265581A Pending JPH01106235A (en) 1987-10-20 1987-10-20 Display system for error position in source program

Country Status (1)

Country Link
JP (1) JPH01106235A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6175435A (en) * 1984-09-20 1986-04-17 Hitachi Software Eng Co Ltd Association system between syntax checker and text editor
JPS61160139A (en) * 1984-12-31 1986-07-19 Nec Corp Automatic stepping editor of program list
JPS61211738A (en) * 1985-03-18 1986-09-19 Nec Corp Source program comment managing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6175435A (en) * 1984-09-20 1986-04-17 Hitachi Software Eng Co Ltd Association system between syntax checker and text editor
JPS61160139A (en) * 1984-12-31 1986-07-19 Nec Corp Automatic stepping editor of program list
JPS61211738A (en) * 1985-03-18 1986-09-19 Nec Corp Source program comment managing system

Similar Documents

Publication Publication Date Title
Habel et al. Computational completeness of programming languages based on graph transformation
CN113051285B (en) SQL sentence conversion method, system, equipment and storage medium
JPH0630066B2 (en) Table type language translation method
JPH02109127A (en) Specification processing method
JPH01106235A (en) Display system for error position in source program
JPS5922140A (en) Interactive compiling system
Chung et al. Efficient search algorithm on compact S-trees
JPH09212630A (en) Graphic production device
JPH0422995A (en) Linking scroll display system for plural data
JPH0378077A (en) Japanese character string input device
JPH05313566A (en) Map preparing system
JPH0359724A (en) Error information compression system for translation system
JPS6285322A (en) Picture displaying system
JPH021027A (en) Compiling system for compressed source program
JPH03282936A (en) Precompiler
JPS60157639A (en) Program editing method
JPH01106224A (en) System for forming source program having japanese data item name
JPH0325630A (en) Data structure access system
JPH0535492A (en) Circuit description form converter
JPH0315971A (en) Word processor
Gaiunullin FORMAL GRAMMAR
JPH0368028A (en) Picture phrase analyzing system
JPH02257255A (en) Individual separate dictionary generating system
JPH01134674A (en) System for processing tree structure data drawing
JPH0540638A (en) Vocabulary analyzing/editing system