JPH0371342A - Reserved word deciding system - Google Patents
Reserved word deciding systemInfo
- Publication number
- JPH0371342A JPH0371342A JP20873689A JP20873689A JPH0371342A JP H0371342 A JPH0371342 A JP H0371342A JP 20873689 A JP20873689 A JP 20873689A JP 20873689 A JP20873689 A JP 20873689A JP H0371342 A JPH0371342 A JP H0371342A
- Authority
- JP
- Japan
- Prior art keywords
- reserved word
- reserved
- source program
- word
- words
- 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
- 238000004458 analytical method Methods 0.000 claims description 15
- 238000000034 method Methods 0.000 claims description 14
- 238000003860 storage Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は原始プログラムを目的プログラムに翻訳する言
語処理系の字句解析部の予約語判定方式に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a reserved word determination method for a lexical analysis unit of a language processing system that translates a source program into a target program.
従来、原始プログラムを目的プログラムに翻訳する言語
処理系の字句解析部は、翻訳する原始プログラムの記述
言語の仕様上の全ての予約語を要素とした予約語表を固
定的に持ち、それを検索することにより原始プログラム
のそれぞれの句が予約語であるか否かを判定するように
している。Conventionally, the lexical analysis unit of a language processing system that translates a source program into a target program has a fixed reserved word table containing all the reserved words in the specifications of the writing language of the source program to be translated, and searches this table. By doing this, it is determined whether each phrase in the source program is a reserved word.
ところで、利用者が実際にプログラムの記述で使用して
いる予約語は、記述言語の仕様が大きく、予約語の数が
多くても、その内の一部だけであるので、上述した従来
例のように、予約語表に全ての予約語を設定しておいた
のでは、原始プログラム中で使用されていない予約語ま
で検索されることになり、予約語の判定処理に無駄な時
間が費やされるという問題がある。By the way, the specifications of the writing language are large, and even if there are many reserved words, only some of them are reserved words that users actually use when writing programs. If all reserved words are set in the reserved word table, even reserved words that are not used in the source program will be searched, and time will be wasted in the reserved word determination process. There is a problem.
本発明の目的は予約語の判定処理を高速化することにあ
る。An object of the present invention is to speed up reserved word determination processing.
本発明の予約語判定方式は上記目的を達成するため、
原始プログラムを目的プログラムに翻訳する言語処理系
の字句解析部の予約語判定方式に於いて、前記原始プロ
グラムの記述言語の全ての予約語を要素とする最大予約
語表と、
咳最大予約語表に含まれている予約語の内、予約語選択
情報によって指定された予約語を選択して前記字句解析
部の予約語表に設定する予約語選択手段と、
該予約語選択手段により予約語が設定された前記予約語
表を検索して前記原始プログラムのそれぞれの句が予約
語であるか否かを判定する予約語判定手段とを設けたも
のである。In order to achieve the above object, the reserved word determination method of the present invention includes all reserved words in the language in which the source program is written, in the reserved word determination method of the lexical analysis unit of the language processing system that translates the source program into the target program. Select the reserved words specified by the reserved word selection information from among the reserved words included in the maximum reserved word table with elements of and the maximum reserved word table, and set them in the reserved word table of the lexical analysis section. a reserved word selection means; and a reserved word determination means for searching the reserved word table in which reserved words are set by the reserved word selection means and determining whether each phrase of the source program is a reserved word. It was established.
最大予約語表は原始プログラムの記述言語の全ての予約
語を要素としている。予約語選択手段は最大予約語表か
ら予約語選択情報によって指定された予約語を選択して
字句解析部の予約語表に設定する。予約語判定手段は予
約語選択手段によって予約語が設定された予約語表を検
索して原始プログラムのそれぞれの句が予約語であるか
否かを判定する。The maximum reserved word table includes all reserved words of the source program description language as elements. The reserved word selection means selects the reserved word specified by the reserved word selection information from the maximum reserved word table and sets it in the reserved word table of the lexical analysis section. The reserved word determining means searches a reserved word table in which reserved words are set by the reserved word selecting means and determines whether each phrase of the source program is a reserved word.
次に本発明の実施例について図面を参照して詳細に説明
する。Next, embodiments of the present invention will be described in detail with reference to the drawings.
第1図は本発明の実施例のブロック図であり、原始プロ
グラム7の記述言語の仕様上の全ての予約語11−1及
びそのキ一番号11−2を要素とする最大予約語表11
が登録された記憶装置1と、最大予約語表11を入力し
、予約語選択情報によって指定された予約語31−1及
びそのキ一番号31−2のみを利用者予約語表3Iとし
て記憶装置3に登録する予約語選択手段2と、字句解析
部5及び予約語表入力手段6を含む言語処理系4とから
構成されている0字句解析部5は予約語判定手段5Iと
予約語表52とを含み、予約語判定手段51は原始プロ
グラム7の翻訳時、予約語表52を検索して原始プログ
ラム7のそれぞれの句が予約語か否かを判定する。予約
語表入力手段6は原始プログラム7の翻訳開始時、記憶
装置3に登録されている利用者予約語表31を入力し、
その内容を字句解析部5内の予約語表52に設定する。FIG. 1 is a block diagram of an embodiment of the present invention, in which a maximum reserved word table 11 includes all reserved words 11-1 and their key numbers 11-2 in the specifications of the description language of the source program 7.
is registered in the storage device 1 and the maximum reserved word table 11, and only the reserved word 31-1 specified by the reserved word selection information and its key number 31-2 are stored in the storage device as the user reserved word table 3I. The 0 lexical analysis section 5 is composed of a reserved word selection means 2 to be registered in 3, a language processing system 4 including a lexical analysis section 5 and a reserved word table input means 6, and a reserved word determination means 5I and a reserved word table 52 When the source program 7 is translated, the reserved word determination means 51 searches the reserved word table 52 and determines whether each phrase of the source program 7 is a reserved word. When starting the translation of the source program 7, the reserved word table input means 6 inputs the user reserved word table 31 registered in the storage device 3;
The contents are set in the reserved word table 52 in the lexical analysis section 5.
第2図は第1図の処理例を示す流れ図であり、以下各図
を参照して本実施例の動作を説明する。FIG. 2 is a flowchart showing the processing example of FIG. 1, and the operation of this embodiment will be explained below with reference to each figure.
利用者は原始プログラム7の翻訳を行なう場合、言語処
理系4に翻訳処理を開始させる前に予約語選択手段2を
起動させる。予約語選択手段2は起動されることにより
記憶装置1から最大予約語表11を入力する(ステップ
21)、利用者は予約語選択手段2を起動させると、次
に原始プログラム7の翻訳処理に於いて必要となる予約
語、即ち、原始プログラム7で使用されている予約語を
示す予約語選択情報を予約語選択手段2に入力する。When translating the source program 7, the user activates the reserved word selection means 2 before causing the language processing system 4 to start the translation process. When the reserved word selection means 2 is activated, it inputs the maximum reserved word table 11 from the storage device 1 (step 21). When the user activates the reserved word selection means 2, it then starts the translation process of the source program 7. Reserved word selection information indicating a necessary reserved word, that is, a reserved word used in the source program 7, is input to the reserved word selection means 2.
予約語選択情報としては、例えば、各予約語対応に定ま
っているキ一番号を使用することができる。As the reserved word selection information, for example, a key number determined for each reserved word can be used.
予約語選択手段2は予約語選択情報が入力されると、最
大予約語表11から予約語選択情報によって指定された
予約語及び対応するキ一番号を選択しくステップ22)
、選択した予約語31−1及び対応するキ一番号31−
2を利用者予約語表31として記憶装置3に登録する(
ステップ23)。When the reserved word selection information is input, the reserved word selection means 2 selects the reserved word specified by the reserved word selection information and the corresponding key number from the maximum reserved word table 11 (step 22).
, the selected reserved word 31-1 and the corresponding key number 31-
2 is registered in the storage device 3 as the user reserved word table 31 (
Step 23).
以上の処理により、原始プログラム7の翻訳処理の前に
、最大予約語表11から必要な予約語を抜き出した元の
表よりも要素数の少ない利用者予約語表31が記憶装置
3内に格納されることになる。Through the above processing, before the translation process of the source program 7, the user reserved word table 31, which has fewer elements than the original table in which necessary reserved words are extracted from the maximum reserved word table 11, is stored in the storage device 3. will be done.
次に利用者は言語処理系4に原始プログラム7の翻訳開
始を指示し、この指示を受けることにより、言語処理系
4は原始プログラム7の翻訳処理を開始する。原始プロ
グラム7の翻訳処理に於いて、言語処理系4は予約語表
人力手段6を使用して記憶装置3に格納されている利用
者予約語表31を入力しくステップ24〉、その内容を
言語処理系4内の予約語表52に設定する(ステップ2
5)0字句解析部5内の予約語判定手段51は予約語表
人力手段6によって利用者予約語表31の内容が設定さ
れた予約語表52を検索することにより、原始プログラ
ム7中の各句が予約語であるか否かを判定する(ステッ
プ26)、そして、予約語であると判定した場合は対応
するキ一番号を入力する等必要な処理を行なう。Next, the user instructs the language processing system 4 to start translating the source program 7, and upon receiving this instruction, the language processing system 4 starts the translation process of the source program 7. In the translation process of the source program 7, the language processing system 4 uses the reserved word table manual means 6 to input the user reserved word table 31 stored in the storage device 3 (step 24), and translates its contents into the language. Set in the reserved word table 52 in the processing system 4 (step 2
5) The reserved word determination means 51 in the zero lexical analysis unit 5 searches the reserved word table 52 in which the contents of the user reserved word table 31 are set by the reserved word table human power means 6, thereby determining each word in the source program 7. It is determined whether the phrase is a reserved word or not (step 26), and if it is determined that the phrase is a reserved word, necessary processing such as inputting the corresponding key number is performed.
以上が本実施例の処理の流れである。この処理の流れか
ら判る通り、予約語判定手段51が予約語か否かを判定
するために検索する予約語表52は予約語判定処理で必
要となる予約語及びそれに対応するキ一番号のみを要素
とするものであり、元の全ての予約語が登録されていた
最大予約語表11に比べて要素数が少ないものであるの
で、字句解析部5に於ける予約語判定処理の処理時間を
短縮することが可能となる。The above is the flow of processing in this embodiment. As can be seen from the flow of this process, the reserved word table 52, which is searched by the reserved word determining means 51 to determine whether or not the word is a reserved word, stores only the reserved words and their corresponding key numbers that are necessary in the reserved word determining process. Since the number of elements is smaller than the maximum reserved word table 11 in which all the original reserved words were registered, the processing time of the reserved word determination process in the lexical analysis unit 5 is reduced. It becomes possible to shorten the length.
以上説明したように、本発明は、全ての予約語が要素と
なっている最大予約語表の中から予約語選択情報によっ
て指定された予約語を選択して字句解析部内の予約語表
に設定し、この予約語表を検索することにより原始プロ
グラム中の各句が予約語であるか否かを判定するように
したものであるので、限られた予約語しか使用していな
い原始プログラムを翻訳する場合、最大予約語表に比べ
て要素数の少ない予約語表を検索して予約語判定処理を
行なうことができるので、字句解析部の予約語判定処理
の処理時間を短縮することができる効果がある。As explained above, the present invention selects a reserved word specified by reserved word selection information from a maximum reserved word table in which all reserved words are elements, and sets it in a reserved word table in a lexical analysis unit. However, by searching this reserved word table, it is determined whether each phrase in the source program is a reserved word or not, so it is possible to translate a source program that uses only a limited number of reserved words. When searching for a reserved word table with a smaller number of elements than the maximum reserved word table, reserved word determination processing can be performed, which has the effect of shortening the processing time for reserved word determination processing in the lexical analysis section. There is.
第1図は本発明の実施例のブロノク図及び、第2図は第
1図の処理例を示す流れ図である。
図に於いて、1. 3・・・記憶装置、2・・・予約語
選択手段、4・・・言語処理系、5・・・字句解析部、
6・・・予約語表人力手段、7・・・原始プログラム、
11・・・最大予約語表、31・・・利用者予約語表、
51・・・予約語判定手段、52・・・予約語表。FIG. 1 is a Bronnoch diagram of an embodiment of the present invention, and FIG. 2 is a flowchart showing the processing example of FIG. 1. In the figure, 1. 3...Storage device, 2...Reserved word selection means, 4...Language processing system, 5...Lexical analysis unit,
6... Reserved word table human power means, 7... Primitive program,
11...Maximum reserved word list, 31...User reserved word list,
51... Reserved word determination means, 52... Reserved word table.
Claims (1)
の字句解析部の予約語判定方式に於いて、前記原始プロ
グラムの記述言語の全ての予約語を要素とする最大予約
語表と、 該最大予約語表に含まれている予約語の内、予約語選択
情報によって指定された予約語を選択して前記字句解析
部の予約語表に設定する予約語選択手段と、 該予約語選択手段により予約語が設定された前記予約語
表を検索して前記原始プログラムのそれぞれの句が予約
語であるか否かを判定する予約語判定手段とを含むこと
を特徴とする予約語判定方式。[Claims] In a reserved word determination method of a lexical analysis unit of a language processing system that translates a source program into a target program, a maximum reserved word table including all reserved words of the language in which the source program is written; , reserved word selection means for selecting a reserved word specified by reserved word selection information from among the reserved words included in the maximum reserved word table and setting the selected reserved word in the reserved word table of the lexical analysis unit; Reserved word determination means for searching the reserved word table in which reserved words are set by the selection means and determining whether each phrase of the source program is a reserved word. method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP20873689A JPH0371342A (en) | 1989-08-11 | 1989-08-11 | Reserved word deciding system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP20873689A JPH0371342A (en) | 1989-08-11 | 1989-08-11 | Reserved word deciding system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0371342A true JPH0371342A (en) | 1991-03-27 |
Family
ID=16561231
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP20873689A Pending JPH0371342A (en) | 1989-08-11 | 1989-08-11 | Reserved word deciding system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0371342A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10124326A (en) * | 1996-10-16 | 1998-05-15 | Hitachi Ltd | Compiling method |
US5973840A (en) * | 1996-10-30 | 1999-10-26 | Seiko Epson Corporation | Projection display and illuminating optical system for it |
US6109751A (en) * | 1996-10-30 | 2000-08-29 | Seiko Epson Corporation | Projector and lighting optical system therefor |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60181838A (en) * | 1984-02-28 | 1985-09-17 | Fujitsu Ltd | Compiler |
-
1989
- 1989-08-11 JP JP20873689A patent/JPH0371342A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60181838A (en) * | 1984-02-28 | 1985-09-17 | Fujitsu Ltd | Compiler |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10124326A (en) * | 1996-10-16 | 1998-05-15 | Hitachi Ltd | Compiling method |
US5973840A (en) * | 1996-10-30 | 1999-10-26 | Seiko Epson Corporation | Projection display and illuminating optical system for it |
US6109751A (en) * | 1996-10-30 | 2000-08-29 | Seiko Epson Corporation | Projector and lighting optical system therefor |
USRE38225E1 (en) * | 1996-10-30 | 2003-08-19 | Seiko Epson Corporation | Projection display and illuminating optical system for it |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4958285A (en) | Natural language processing system | |
JPH0371342A (en) | Reserved word deciding system | |
JPH07182333A (en) | Japanese processor | |
JPH05334351A (en) | Machine translating system | |
JPH076175A (en) | Machine translation system | |
JPH0567141A (en) | Machine translation machine | |
JPH07146868A (en) | Natural language processor | |
JPH05282360A (en) | Multi-language input device | |
JP3391808B2 (en) | Natural language input method and device | |
JPH05204970A (en) | Conversation processing system | |
JPH06162071A (en) | Machine translation device | |
JPH0342728A (en) | Deciding system for reservation word | |
JP2714940B2 (en) | Text search device | |
JPS62282364A (en) | Character string retrieval system | |
JPH03129465A (en) | Assistance information display device | |
JPH09101961A (en) | Machine translation device | |
JPH07244601A (en) | Method and device for accessing relational data base | |
JPH09146956A (en) | Machine translation device | |
JPH06131328A (en) | Method and device for processing document | |
JPH0381863A (en) | Kana/kanji conversion system | |
JPS63228207A (en) | Function key setting system | |
JPH1074201A (en) | Machine translation system | |
JPH0981555A (en) | Method and device for document processing | |
JPH1091624A (en) | Method and device for character processing | |
JPH05282365A (en) | Electronic dictionary device |