JPH03282937A - Precompiler - Google Patents
PrecompilerInfo
- Publication number
- JPH03282937A JPH03282937A JP2084711A JP8471190A JPH03282937A JP H03282937 A JPH03282937 A JP H03282937A JP 2084711 A JP2084711 A JP 2084711A JP 8471190 A JP8471190 A JP 8471190A JP H03282937 A JPH03282937 A JP H03282937A
- Authority
- JP
- Japan
- Prior art keywords
- character
- code
- line
- characters
- precompiler
- 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
【発明の詳細な説明】
〔概要〕
人力ソースを翻訳処理することで新たな出力ソースを生
成するよう処理するプリコンパイラに関し、
フリーフォーマット形式の入力ソースを扱う場合におい
て、プリコンパイラの処理上におけるソース位置がエデ
ィタ上のそれと同一にできるようにすることを目的とし
、
読み取った人力ソースの文字が行当たり文字数を超えて
いるのか否かを判断する文字数判断部と、文字数判断部
により行当たり文字数を超えていると判断される文字が
改行コードであるのか否かを判断する文字種別判断部と
、文字種別判断部が改行コードでないと判断するときに
改行コードを生成する制御コード生成部とを備えるよう
構成する。[Detailed Description of the Invention] [Summary] Regarding a precompiler that generates a new output source by translating a human source, when dealing with a free format input source, the source that is processed by the precompiler The purpose is to make the position the same as that on the editor, and there is a character count judgment unit that determines whether the characters in the human source that have been read exceed the number of characters per line, and a character count judgment unit that determines the number of characters per line. A character type determining section that determines whether or not a character that is determined to exceed a line feed code is a line feed code, and a control code generating section that generates a line feed code when the character type determining section determines that it is not a line feed code. Configure it like this.
本発明は、入力ソースを翻訳処理することで新たな出力
ソースを生成するよう処理するプリコンパイラに関し、
特に、フリーフォーマント形式の人力ソースを扱う場合
において、プリコンパイラの処理上におけるソース位置
がエディタのそれと同一にできるようにするプリコンパ
イラに関するものである。The present invention relates to a precompiler that generates a new output source by translating an input source.
In particular, the present invention relates to a precompiler that allows the precompiler to process the source at the same location as the editor when handling free-formant human sources.
フリーフォーマット形式の入力ソースを扱うプリコンパ
イラでは、入力ソースの作成時に、文字位置や行当たり
文字数を気にせずともコーディングができるという利点
がある。このようなフリーフォーマット形式の入カッ〜
スを扱うプリコンパイラの有効利用を図るためにも、入
力ソースの作成ミスを効率的に修正できるような手段を
備えていく必要がある。A precompiler that handles free-format input sources has the advantage of being able to code without worrying about character position or number of characters per line when creating input sources. Free format input like this
In order to make effective use of the precompiler that handles input sources, it is necessary to have a means to efficiently correct errors in the creation of input sources.
[従来の技術〕
フリーフォーマント形式の入力ソースを扱う従来のプリ
コンパイラでは、ユーザに対して、入力ソースを改行す
る場合には必ず改行コードを入力するよう規定していた
。すなわち、ユーザは、エディタに従って入力ソースを
人力するときにあって、プリコンパイラにおいて別の行
として出力することを希望する入力ソースについては、
その直前の入力ソースの後ろに改行コードを入力しなけ
ればならなかったのである。[Prior Art] Conventional precompilers that handle input sources in free-formant format require the user to always input a line feed code when starting a line break in the input source. In other words, when a user manually inputs an input source according to the editor, for an input source that he/she wishes to output as a separate line in the precompiler,
I had to enter a newline code after the previous input source.
(発明が解決しようとする課題〕
しかしながら、このような従来技術によると、改行すべ
き入力ソースに改行コードを記述するのを忘れてしまっ
た場合に、出力される入力ツースリストでは同一行に出
力されてしまうことになるという問題点があった。すな
わち、第4図に示す入力ソースの第2行と第3行、第5
行と第6行に示すように、エディタに従って入力ソース
を入力していく場合に、改行コードを入力しなくても行
当たり文字数を超えれば自動的に次行に折り返されてい
くこと番こなるが、これに対応してプリコンパイラから
出力される入力ツースリストは、第5図(a)に示すよ
うに、改行コードがないために詰められてしまうことに
なる。一方、エディタでもって表示されるプリコンパイ
ラからの出力ソースは、第5図(b)に示すように、行
当たり文字数に従って人力ソースと同じ行形態に従って
表示されることになる。ここで、第4図及び第5図中、
「口」は空白文字、「り」は改行コード、「■」は半角
文字(拡大文字のときもある)の開始の制御コード、「
■」は半角文字(拡大文字のときもある)の終了の制御
コードを表している。(Problem to be Solved by the Invention) However, according to such conventional technology, if you forget to write a line break code in an input source that should have a line break, the input tooth list that is output will not be output on the same line. In other words, the second, third and fifth rows of the input source shown in Figure 4
As shown in line 6 and line 6, when inputting the input source according to the editor, if the number of characters per line is exceeded, it will automatically wrap to the next line even if you do not enter a line break code. However, as shown in FIG. 5(a), the input tooth list output from the precompiler in response to this is packed because there is no line feed code. On the other hand, the output source from the precompiler displayed by the editor is displayed according to the same line format as the manual source according to the number of characters per line, as shown in FIG. 5(b). Here, in FIGS. 4 and 5,
``口'' is a blank character, ``ri'' is a line feed code, ``■'' is a control code for starting a half-width character (sometimes an enlarged character), ``
"■" represents the control code for ending half-width characters (sometimes enlarged characters).
これから、従来のプリコンパイラを利用すると、ユーザ
が翻訳エラーをエディタで修正しようとしても、エラー
のある位置がエラーリストの情報と違ってしまうことか
ら、エラー位置を探すのに手間がかかってしまうという
問題点があった。From now on, if a conventional precompiler is used, even if a user tries to correct a translation error in an editor, the location of the error will be different from the information in the error list, making it time consuming to search for the error location. There was a problem.
しかも、プリコンパイラは、通常、分離符がこないまま
解析用の内部格納域があふれた場合には、それに続く文
字を分離符がくるまで読み飛ばしてしまうという処理を
採っている。これから、自動折り返し行(入力ソース上
は改行コードが無いがエディタ上で行当たり文字数の関
係に従って2行以上にわたって表示される行)により分
離符が無いまま文字が続いていると、2行目の語が解析
されずに読み飛ばされてしまうことが起こるという可能
性もあった。Furthermore, precompilers usually employ a process in which if the internal storage area for analysis overflows without a separator, the following characters are skipped until the separator is encountered. From now on, if characters continue without a separator due to automatic wrapping lines (lines that have no line break code in the input source but are displayed over two or more lines in the editor according to the relationship of the number of characters per line), the second line There was also the possibility that words would be skipped without being parsed.
本発明はかかる事情に鑑みてなされたものであって、プ
リコンパイラの処理上におけるソース位置がエディタの
それと同一にできるようにする新たなプリコンパイラの
提供を目的とするものである。The present invention has been made in view of the above circumstances, and it is an object of the present invention to provide a new precompiler that allows the source location during processing by the precompiler to be the same as that of the editor.
第1図は本発明の原理構成図である。 FIG. 1 is a diagram showing the principle configuration of the present invention.
図中、lは本発明を具備するプリコンパイラ、2はプリ
コンパイラ1に人力ソースを入力するために用意される
エディタ、3は入力ツースリスト等を出力するために用
意される出力機器である。In the figure, 1 is a precompiler equipped with the present invention, 2 is an editor prepared for inputting human source to the precompiler 1, and 3 is an output device prepared for outputting an input tooth list and the like.
プリコンパイラ1は、入力ソース格納部10、文字数判
断部11、文字種別判断部12及び制御コード生成部1
3を備える。The precompiler 1 includes an input source storage unit 10, a character count determination unit 11, a character type determination unit 12, and a control code generation unit 1.
Equipped with 3.
この入力ソース格納部10は、エディタ2により編集さ
れた入力ソースを格納するよう処理し、文字数判断部1
1は、入力ソース格納部10から読み取った入力ソース
の文字がエディタ2の行当たり文字数を超えているのか
否かを判断するよう処理し、文字種別判断部12は、文
字数判断部11により行当たり文字数を超えていると判
断される文字が改行コードであるのか否か、半角文字で
あるのか否か、拡大文字であるのか否かを判断するよう
処理し、制御コード生成部13は、文字種別判断部12
が改行コードでないと判断するときに改行コードを生成
するよう処理するとともに、半角文字(拡大文字)であ
ると判断するときには、先ず最初に、半角文字(拡大文
字)の終了の制御コードを生成し、次に改行コードを生
成し、続いて半角文字(拡大文字)の開始の制御コード
を生成するよう処理する。This input source storage unit 10 processes to store the input source edited by the editor 2, and the character count determination unit 1
1 processes to determine whether or not the characters of the input source read from the input source storage unit 10 exceed the number of characters per line of the editor 2, The control code generation unit 13 performs processing to determine whether a character that is determined to exceed the number of characters is a line feed code, a half-width character, or an enlarged character, and the control code generation unit 13 determines the character type. Judgment section 12
When it judges that it is not a line feed code, it generates a line feed code, and when it judges that it is a half-width character (enlarged character), it first generates a control code for ending the half-width character (enlarged character). , then generates a line feed code, and then processes to generate a control code for the start of a half-width character (enlarged character).
本発明では、行当たり文字数を超えていると判断される
文字が改行コードでないときには、制御コード生成部1
3の処理に従って改行コードが生成されるごとになる。In the present invention, when the characters determined to exceed the number of characters per line are not line feed codes, the control code generation unit 1
Each time a new line code is generated according to the process in step 3.
このとき、半角文字や拡大文字が存在するときには、そ
の文字に対する補正処理も行われる。At this time, if half-width characters or enlarged characters are present, correction processing for those characters is also performed.
コノ改行コードの生成処理に従って、プリコンパイラの
処理の上でのソース位置がエディタ2上でのそれと同一
になり、出力機器3に出力されるエラーソースリストが
エディタ2に表示される行形層と同じになることが保証
される。これから、改行コードの入力を忘れるようなこ
とがあっても、ユーザは翻訳エラーを効率的に修正でき
るようになるのである。According to the generation process of the line feed code, the source position in the precompiler process is the same as that in the editor 2, and the error source list output to the output device 3 is the same as the line layer displayed in the editor 2. guaranteed to be the same. From now on, users will be able to efficiently correct translation errors even if they forget to enter a newline code.
以下、日本語文書を入力ソースとして、アセンブラのマ
クロ機能と同様な機能を実行することで日本語文書を生
成するプリコンパイラに適用した実施例に従って本発明
の詳細な説明する。Hereinafter, the present invention will be described in detail according to an embodiment applied to a precompiler that uses a Japanese document as an input source and generates a Japanese document by executing a function similar to the macro function of an assembler.
第2図に、第1図に図示した本発明のプリコンパイラ1
が実行する処理のフローチャートの一実施例を図示する
。次に、このフローチャートに従って本発明の詳細な説
明する。FIG. 2 shows a precompiler 1 of the present invention illustrated in FIG.
1 illustrates an example of a flowchart of processing executed by. Next, the present invention will be explained in detail according to this flowchart.
このフローチャートに示すように、プリコンパイラ1は
、先ず最初に、ステップ1で、作業フラグがONに設定
されているのか否かを判断する。As shown in this flowchart, the precompiler 1 first determines in step 1 whether or not the work flag is set to ON.
この作業フラグは、後述するように、半角文字や拡大文
字が記述されているときに、改行コードや半角文字開始
コードや拡大文字開始コードの生成を指定するもので、
初期値としてはOFFに設定されている。このステップ
1の判断で、作業フラグがOFFであることを判断する
と、ステップ2に進んで、入力ソースの展開された入力
バッファ域より一文字を抽出する処理を行う。次に、ス
テップ3で、この抽出した文字が行当たり文字数を超え
ているのか否かを判断する。このステップ3の判断で行
当たり文字数を超えていないと判断するときには、ステ
ップ12に進んで、その文字を翻訳処理に入るべく出力
する。As described later, this work flag specifies the generation of line feed codes, half-width character start codes, and enlarged character start codes when half-width characters or enlarged characters are written.
The initial value is set to OFF. If it is determined in step 1 that the work flag is OFF, the process proceeds to step 2, in which a single character is extracted from the input buffer area in which the input source is expanded. Next, in step 3, it is determined whether the extracted characters exceed the number of characters per line. If it is determined in step 3 that the number of characters per line has not been exceeded, the process proceeds to step 12, where the characters are output for translation processing.
一方、ステップ3の判断で行当たり文字数を超えている
と判断するときには、ステップ4に進んで、その行当た
り文字数を超えた文字が改行コードであるのか否かを判
断する。このステップ4の判断で改行コードであると判
断するときには、ステップ12に進んで、その改行コー
ドを出力する。On the other hand, if it is determined in step 3 that the number of characters per line is exceeded, the process proceeds to step 4, where it is determined whether the characters exceeding the number of characters per line are line feed codes. If it is determined in step 4 that it is a line feed code, the process proceeds to step 12, where the line feed code is output.
そして、このステップ4の判断で改行コードでないと判
断するときには、ステップ5に進んで、その行当たり文
字数を超えた文字が半角文字が拡大文字のいずれかの文
字であるのが否かを判断する。If it is determined in step 4 that it is not a line feed code, proceed to step 5 and determine whether the characters exceeding the number of characters per line are any of the characters in the expanded half-width characters. .
ステップ5の判断で、半角文字及び拡大文字のいずれの
文字でもないと判断すると、ステップ8に進んで、改行
コードを生成して出力する。一方、ステップ5の判断で
、半角文字が拡大文字のいずれかの文字であると判断す
るときには、ステンプ6に進んで、作業フラグをONに
設定してから、続くステップ7で対応する文字(半角文
字・拡大文字)の終了コードを生成して出力する。If it is determined in step 5 that the character is neither a half-width character nor an enlarged character, the process proceeds to step 8, where a line feed code is generated and output. On the other hand, if it is determined in step 5 that the half-width character is one of the enlarged characters, proceed to step 6, set the work flag to ON, and then proceed to step 7 to set the corresponding character (half-width Generates and outputs an exit code for characters (characters/enlarged characters).
そして、ステップ9で示す内部作業領域への文字の設定
処理や、ステップ10で示す文字の位置ポインタの更新
処理を実行してから、ステップ1に戻るよう処理する。Then, after executing the character setting process in the internal work area shown in step 9 and the updating process of the character position pointer shown in step 10, the process returns to step 1.
ステップ6の処理に従って作業フラグがONに設定され
ているときには、ステップ1の判断処理により、作業フ
ラグがONであることが判断されることになる。このと
きには、ステップ11に進んで、改行コードを生成し、
続くステップ12の処理に従って、その生成した改行コ
ードを出力する。そして、再びステップ1に戻り、作業
フラグがONであることが判断されることでステップ1
1に戻ってくると、次に、ステップ7で半角文字の終了
コードを出力したときには半角文字の開始コードを生成
し、また、ステップ7で拡大文字の終了コードを出力し
たときには拡大文字の開始コードを生成してから、作業
フラグをOFFにリセットする。そして、続くステップ
12の処理に従って、その生成した開始コードを出力し
ていくことになる。When the work flag is set to ON according to the process in step 6, it is determined by the determination process in step 1 that the work flag is ON. In this case, proceed to step 11 and generate a new line code,
According to the subsequent process of step 12, the generated line feed code is output. Then, the process returns to step 1 again, and when it is determined that the work flag is ON, step 1 is executed.
When returning to step 1, next time when the end code of half-width characters is output in step 7, a start code of half-width characters is generated, and when the end code of enlarged characters is output in step 7, the start code of enlarged characters is generated. , and then reset the work flag to OFF. Then, in accordance with the subsequent process of step 12, the generated start code will be output.
このようにして、ステップlないしステップ12の処理
を実行していくことで、半角文字や拡大文字についての
補正処理を実行しつつ、行当たり文字数を超えるところ
で改行コードを自動生成していくよう処理するのである
。この処理に従って、第3図に示すように、第4図の入
力ソースに対して、この入力ソースと同し行形態をとる
入力ツースリストや出力ソースを出力できるようになる
のである。In this way, by executing the processing from Step 1 to Step 12, a line feed code is automatically generated when the number of characters per line is exceeded while executing correction processing for half-width characters and enlarged characters. That's what I do. According to this process, as shown in FIG. 3, it becomes possible to output an input tooth list and an output source that take the same row form as the input source shown in FIG. 4.
(発明の効果〕
以上説明したように、本発明によれば、改行コードの生
成処理に従って、プリコンパイラの処理の上でのソース
位置がエディタ上でのそれと同一にできるようになるこ
とで、出力機器に出力されるエラーソースリストがエデ
ィタに表示される行形態と同じになることが保証される
。これから、改行コードの入力を忘れるようなことがあ
っても、ユーザは翻訳エラーを効率的に修正できるよう
になる。これにより、日本語文書のようなフリーフォー
マット形式を入力ソースとするプリコンパイラを用いる
データ処理システムの開発を効率的に実現できるように
なるのである。(Effects of the Invention) As explained above, according to the present invention, the source position in the precompiler processing can be made the same as that in the editor according to the line feed code generation processing, so that the output This ensures that the error source list output to the device is the same as the line format displayed in the editor.Now, even if you forget to enter a newline code, users can efficiently resolve translation errors. This makes it possible to efficiently develop a data processing system using a precompiler that uses a free format such as a Japanese document as an input source.
第1図は本発明の原理構成図、
第2図は本発明のプリコンパイラが実行する処理の一実
施例、
第3図は本発明の詳細な説明図、
第4図はエディタ上に表示される入力ソースの一例、
第5図は従来技術の説明図である。
図中、lはプリコンパイラ、2はエディタ、3は出力機
器、10は入力ソース格納部、11は文字数判断部、1
2は文字種別判断部、13は制御コード生成部である。
本発明の原理構成図
第1因
↑
行当たり文字数の位置
本発明の詳細な説明図
第
↑
行当たり文字数の位置
エディタ上に表示される入力ソースの一例第
図Fig. 1 is a diagram showing the basic configuration of the present invention, Fig. 2 is an example of processing executed by the precompiler of the present invention, Fig. 3 is a detailed explanatory diagram of the present invention, and Fig. 4 is a diagram showing the information displayed on the editor. FIG. 5 is an explanatory diagram of a conventional technique. In the figure, l is a precompiler, 2 is an editor, 3 is an output device, 10 is an input source storage section, 11 is a character count judgment section, 1
2 is a character type determination section, and 13 is a control code generation section. Principle configuration diagram of the present invention Factor 1 ↑ Position of the number of characters per line Detailed explanatory diagram of the present invention ↑ Position of the number of characters per line Example of the input source displayed on the editor Figure 1
Claims (2)
たな出力ソースを生成するよう処理するプリコンパイラ
において、 読み取った入力ソースの文字が行当たり文字数を超えて
いるのか否かを判断する文字数判断部(11)と、 該文字数判断部(11)により行当たり文字数を超えて
いると判断される文字が改行コードであるのか否かを判
断する文字種別判断部(12)と、該文字種別判断部(
12)が改行コードでないと判断するときに改行コード
を生成する制御コード生成部(13)とを備えることを
、 特徴とするプリコンパイラ。(1) In a precompiler that generates a new output source by translating the input source, the number of characters used to determine whether the number of characters read in the input source exceeds the number of characters per line a determining unit (11); a character type determining unit (12) that determines whether or not the characters determined by the character count determining unit (11) to exceed the number of characters per line are line feed codes; Judgment department (
12) is not a line feed code, a control code generation unit (13) generates a line feed code.
字種別判断部(12)が、更に、判断対象の文字が半角
文字か拡大文字のいずれかの特殊文字であるのか否かを
判断するよう処理するとともに、制御コード生成部(1
3)が、該文字種別判断部(12)が特殊文字であると
判断するときには、該特殊文字の終了の制御コードを生
成した後に改行コードを生成し、かつ、続いて該特殊文
字の開始の制御コードを生成するよう処理することを、
特徴とするプリコンパイラ。(2) In the precompiler according to claim (1), the character type determination unit (12) further determines whether the character to be determined is a special character, such as a half-width character or an enlarged character. In addition to processing, the control code generation unit (1
3), when the character type determination unit (12) determines that the character is a special character, it generates a line feed code after generating a control code for the end of the special character, and then generates a line feed code for the start of the special character. processing to generate a control code;
Features a precompiler.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2084711A JPH03282937A (en) | 1990-03-30 | 1990-03-30 | Precompiler |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2084711A JPH03282937A (en) | 1990-03-30 | 1990-03-30 | Precompiler |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03282937A true JPH03282937A (en) | 1991-12-13 |
Family
ID=13838250
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2084711A Pending JPH03282937A (en) | 1990-03-30 | 1990-03-30 | Precompiler |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03282937A (en) |
-
1990
- 1990-03-30 JP JP2084711A patent/JPH03282937A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4859091A (en) | Word processor including spelling verifier and corrector | |
| JPH03282937A (en) | Precompiler | |
| JPS62177654A (en) | Document producer | |
| JPH0431429B2 (en) | ||
| US20040019854A1 (en) | Dynamically configurable page numbering system | |
| JPH01142975A (en) | document creation device | |
| JPH05113882A (en) | Out-fitted man-machine interface realizing system by intermediate file | |
| JPH04273527A (en) | Program source comparing system | |
| JPH05210681A (en) | Document correction backup system | |
| JP2723908B2 (en) | Document creation device | |
| JPH05250014A (en) | Peripheral device for programmable controller | |
| JP2674887B2 (en) | Word processor | |
| JPH0589103A (en) | Document editing processor | |
| JPH061469B2 (en) | Word processor | |
| JPH0273454A (en) | Document processor | |
| JPH08171594A (en) | Table processor | |
| JPH03250362A (en) | Document proofreading device | |
| JPH05233553A (en) | Data editing system | |
| JPH0449421A (en) | File editing system | |
| JPS6075936A (en) | Simple patch cancelling system | |
| JPH08171555A (en) | Word processor | |
| JPH05342207A (en) | Format specifying method for word processor | |
| JPS62156769A (en) | Modified part display method | |
| JPH0495128A (en) | Instuction pattern extraction processing device | |
| JPH11143705A (en) | Source program check device and recording medium |