JPH02128224A - Internal structure data additional processing method - Google Patents

Internal structure data additional processing method

Info

Publication number
JPH02128224A
JPH02128224A JP63281306A JP28130688A JPH02128224A JP H02128224 A JPH02128224 A JP H02128224A JP 63281306 A JP63281306 A JP 63281306A JP 28130688 A JP28130688 A JP 28130688A JP H02128224 A JPH02128224 A JP H02128224A
Authority
JP
Japan
Prior art keywords
internal structure
definition information
structure data
syntax
user
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
JP63281306A
Other languages
Japanese (ja)
Inventor
Kyoko Tsuchiya
恭子 土屋
Kaoru Satou
佐藤 かおる
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.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
Agency of Industrial Science and Technology
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 Agency of Industrial Science and Technology filed Critical Agency of Industrial Science and Technology
Priority to JP63281306A priority Critical patent/JPH02128224A/en
Publication of JPH02128224A publication Critical patent/JPH02128224A/en
Pending legal-status Critical Current

Links

Landscapes

  • Machine Translation (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To unnecessitate the knowledge on the internal structure of a system for a user and to facilitate definition by extracting an indispensable construction element from definition information based on redundant element designation information, generating prescribed internal structure data based on the indispensable construction element and adding internal structure data to definition information. CONSTITUTION:An internal structure data additional processing part 30 reads and processes definition information 31 of a construction rule which the user has inputted, and generates new definition information 32. A parser 34 which performs a processing corresponding to the construction rule which the user has defined is generated by processing the information 32 as the input of a parser generator 33. Here, the indispensable construction element is extracted from definition information based on redundant element designation information, prescribed internal structure data based on the indispensable construction element is generated and the internal structure data is added to definition information. Thus, the user can easily define the construction rule without description which requires the knowledge of the internal structure.

Description

【発明の詳細な説明】 〔概 要〕 計算機における、利用者の定義する構文規則の内部構造
データの処理に関し、 利用者が構文規則を定義する場合に、利用者にシステム
の内部構造に関する知識を不要にして定義を容易にする
、内部構造データ付加処理方法を目的とし、 構文規則の定義情報に基づいて、該構文規則に従って文
を処理する構文解析プログラムを生成する計算機のシス
テムにおいて、該定義情報の中に、構文の意味解釈上冗
長な構文要素を必須構文要素と区別して指定する所定形
式の冗長要素指定情報を設け、該冗長要素指定情報に基
づいて、該定義情報から該必須構文要素を抽出し、該抽
出した必須構文要素に基づく所定の内部構造データを生
成して、該定義情報に該内部構造データを付加するよう
に構成する。
[Detailed Description of the Invention] [Summary] Regarding the processing of internal structure data of syntax rules defined by the user in a computer, when the user defines the syntax rules, the user is provided with knowledge about the internal structure of the system. A computer system that generates a syntax analysis program that processes sentences according to syntax rules based on definition information of syntax rules, with the purpose of a processing method for adding internal structure data that makes definitions easier by eliminating the need for the definition information. is provided with redundant element specification information in a predetermined format that specifies syntactic elements that are redundant in terms of semantic interpretation of the syntax, distinguishing them from essential syntax elements, and based on the redundant element specification information, the essential syntax elements are extracted from the definition information. The configuration is configured to extract the essential syntax elements, generate predetermined internal structure data based on the extracted essential syntax elements, and add the internal structure data to the definition information.

〔産業上の利用分野〕[Industrial application field]

本発明は、計算機における、利用者の定義する構文規則
に内部構造データを付加する処理方法に関する。
The present invention relates to a processing method for adding internal structure data to syntax rules defined by a user in a computer.

例えば証明問題の処理を支援するシステムに、論理式等
を入力する場合に、その論理式を表す入力データの文法
は問題の分野によって異なることがあり、又新しい論理
関係等を定義することによって、より簡明な記述を可能
にする等の改良が行われるので、利用者が構文規則を定
義し、それに応じて必要な構文解析プログラムを生成で
きるようにしたシステムが望まれる。
For example, when inputting a logical formula etc. into a system that supports the processing of proof problems, the grammar of the input data representing the logical formula may differ depending on the field of the problem, and by defining new logical relationships etc. Since improvements such as enabling simpler descriptions will be made, a system that allows users to define syntactic rules and generate necessary syntactic analysis programs accordingly is desired.

〔従来の技術と発明が解決しようとする課題〕利用者が
構文規則を定義するようにしたシステムでは、各構文規
則に対応してそれぞれの構文解析プログラム(即ちパー
ザ)を必要とし、例えばシステムにパーザ・ジェネレー
タを持って、各構文規則に対応して各パーザを生成でき
るようにする。
[Prior art and problems to be solved by the invention] In a system in which a user defines syntax rules, a syntax analysis program (i.e., a parser) is required for each syntax rule. Have a parser generator and be able to generate each parser corresponding to each syntax rule.

生成されるパーザは、入力する文を当該構文規則に従っ
て解析し、その文が所定の種類の文として構文的に正し
い識別するが、システムによっては更に、その文からシ
ステム内部の処理に応じて定められたデータ構造(以下
において内部構造という)を持つデータを生成する処理
を実行することが要求される。
The generated parser parses the input sentence according to the syntactic rules and identifies the sentence as a syntactically correct type of sentence. It is required to perform processing to generate data having a specified data structure (hereinafter referred to as internal structure).

そのために利用者は構文規則を、例えば第5図に示すよ
うな形式で定義する。図の式1は矢印の右辺に記述され
た記号pと文字定数「(」と、記号■と、文字定数「)
」とを、この順に並べた構文を有する文を、左辺に示す
記号Sで表される種類の文として扱うことを規定すると
共に、内部構造においては、記号Sを引数A、記号pを
引数X、記号■を引数Yに対応させて、引数Aを内部構
造データとして扱う。引数Aの値は中括弧内に示すA=
 [X、Y]  (AをXとYのペアで構成することを
意味する)で指定される。
To this end, the user defines syntax rules in the format shown in FIG. 5, for example. Formula 1 in the figure is the symbol p written on the right side of the arrow, the character constant "(", the symbol ■, and the character constant ")"
'', the sentence with the syntax arranged in this order is treated as the type of sentence represented by the symbol S shown on the left side, and in the internal structure, the symbol S is the argument A, and the symbol p is the argument X. , the symbol ■ corresponds to the argument Y, and the argument A is treated as internal structure data. The value of argument A is shown in curly brackets as A=
[X, Y] (means that A is composed of a pair of X and Y).

式lにおけるpは、式2及び式3で文字定数rfJかr
gJと規定され、■は式4及び弐5で文字定数rxJか
ryJと規定されると共に、それぞれに内部構造におい
てそれらの文字定数を引数Xの値とするプログラムが指
定されている。
p in formula l is a character constant rfJ or r in formulas 2 and 3.
gJ, and ■ is defined as a character constant rxJ or ryJ in equations 4 and 25, and a program that uses these character constants as the value of argument X is specified in the internal structure of each.

パーザ・ジェネレータは以上の構文規則の定義から、例
えば入力文としてf (x)を受は取ってその構文を解
析して、それが記号Sの種類の正しい構文であることを
識別し、その文で人力された必要データの間の関係に従
う内部構造を前記プログラムに対応させて生成する機能
を有するパーザを構成することができる。
From the definition of the syntax rules above, the parser generator takes, for example, f (x) as an input sentence, parses its syntax, identifies that it is a correct syntax of the type of symbol S, and converts the sentence It is possible to configure a parser that has a function of generating an internal structure corresponding to the above-mentioned program according to the relationship between the necessary data manually inputted in the above-mentioned program.

しかし、このために利用者は構文規則の定義において、
システムの内部構造を熟知して、構文規則との対応まで
記述しなければならないという問題がある。
However, this requires the user to
There is a problem in that it is necessary to thoroughly understand the internal structure of the system and to describe the correspondence with the syntax rules.

本発明は、利用者が構文規則を定義する場合に、利用者
にシステムの内部構造に関する知識を不要にして定義を
容易にする、内部構造データ付加処理方法を目的とする
An object of the present invention is to provide an internal structure data addition processing method that facilitates the definition by eliminating the need for the user to have knowledge of the internal structure of a system when the user defines a syntax rule.

〔課題を解決するための手段〕[Means to solve the problem]

第1図は、本発明の構成を示す処理の流れ図である。 FIG. 1 is a process flowchart showing the configuration of the present invention.

図は構文規則に内部構造データを付加する処理の流れを
示し、10は構文規則を読み込む処理ステップ、11〜
13は構文規則に内部構造データを付加する処理ステッ
プである。
The figure shows the flow of processing for adding internal structure data to syntax rules, 10 is a processing step for reading syntax rules, 11 -
13 is a processing step for adding internal structure data to the syntax rules.

〔作 用〕[For production]

構文規則の定義情報に基づいて、その構文規則に従って
文を処理する構文解析プログラムを生成するシステムで
、構文規則の定義情報の中に、文の意味解釈上冗長な構
文要素を必須構文要素と区別して指定する所定形式の冗
長要素指定情報を設けておき、システムは処理ステップ
10でこの定義情報を読み込むと、処理ステップllで
冗長要素指定情報に基づいて、定義情報から必須構文要
素を抽出する。
A system that generates a syntax analysis program that processes sentences according to the syntax rules based on the definition information of the syntax rules. Redundant element specification information in a predetermined format that is separately specified is provided, and when the system reads this definition information in processing step 10, essential syntax elements are extracted from the definition information based on the redundant element specification information in processing step 11.

次に処理ステップ12で、抽出した必須構文要素に基づ
く所定の内部構造データを生成し、定義情報にこの内部
構造データを付加して、新定義情報とする。
Next, in processing step 12, predetermined internal structure data is generated based on the extracted essential syntax elements, and this internal structure data is added to the definition information to obtain new definition information.

処理ステップ13で識別して、各規則について順次以上
の処理を行い、すべての規則について処理を完了する。
It is identified in processing step 13, and the above processing is performed for each rule in sequence, and the processing for all rules is completed.

このようにして内部構造データを付加した新定義情報を
パーザ・ジェネレータに入力すれば所要の構文解析プロ
グラムを生成することができる。
By inputting the new definition information with internal structure data added to the parser generator in this way, a required parsing program can be generated.

以上の処理方法により、利用者は内部構造の知識を要す
る記述なしに構文規則を定義することが可能になる。
The above processing method allows the user to define syntax rules without requiring knowledge of the internal structure.

〔実施例〕〔Example〕

本発明により、利用者は例えば第2図に示すような形式
で構文規則の定義情報を入力する。
According to the present invention, a user inputs syntax rule definition information in the format shown in FIG. 2, for example.

第2図の式21〜25は、第5図の式1〜5について前
述したと同様の規則を構文についてのみ定義する記述で
ある。こ\で式21の右辺におけるように、記号と並ん
で使用される引用符号「”」は、引用符号で囲まれる部
分が文字定数であることを示すと共に、本発明によりそ
の部分が文の意味解釈上で必須でない冗長構文要素であ
ることを示す冗長要素指定情報として使用される。
Equations 21 to 25 in FIG. 2 are descriptions that define only the syntax of the same rules as described above for equations 1 to 5 in FIG. Here, as in the right-hand side of Equation 21, the quotation marks "'' used alongside the symbol indicate that the part surrounded by the quotation marks is a character constant, and according to the present invention, the part surrounded by the quotation marks is a literal constant. It is used as redundant element specification information to indicate that it is a redundant syntax element that is not essential for interpretation.

第3図はシステムの構成例を示すブロック図であり、内
部構造データ付加処理部30は、利用者が入力した構文
規則の定義情報31を読み込んで処理し、新定義情報3
2を生成する。これをパーザ・ジェネレータ33の入力
として処理することにより、利用者の定義した構文規則
に従う処理を行うパーザ34を生成する。
FIG. 3 is a block diagram showing an example of the system configuration, and the internal structure data addition processing unit 30 reads and processes definition information 31 of syntax rules input by the user, and processes new definition information 31.
Generate 2. By processing this as input to the parser generator 33, a parser 34 is generated that performs processing according to the syntax rules defined by the user.

第4図は内部構造データ付加処理部30の処理例を示す
処理の流れ図である。内部構造データ付加処理部30は
処理ステップ40で1つの構文の定義情報のレコードを
読み込み、処理ステップ41でそれが例えばファイルの
終わりを示すレコードでなければ処理ステップ42以降
の処理に進む。
FIG. 4 is a process flowchart showing an example of the process of the internal structure data addition processing unit 30. The internal structure data addition processing section 30 reads a record of the definition information of one syntax in a processing step 40, and if it is not a record indicating the end of a file, for example, in a processing step 41, the process proceeds to processing steps 42 and subsequent steps.

処理ステップ42で定義情報を矢印記号を境界として左
辺と右辺に分割し、処理ステップ43で先ず右辺につい
て、「、」を構文要素の区切り記号として区分すること
により、構文要素の個数りを求める。
In processing step 42, the definition information is divided into the left side and right side using the arrow symbol as a boundary, and in processing step 43, the number of syntactic elements is determined by first classifying the right side using "," as a delimiter of syntactic elements.

次に右辺の各構文要素を順次処理するために、構文要素
の順位を示す値Nを処理ステップ44で1にし、処理ス
テップ45で識別して、NがLより大きくなければ、N
番目の構文要素を処理するために処理ステップ46に進
む。
Next, in order to sequentially process each syntax element on the right side, the value N indicating the rank of the syntax element is set to 1 in processing step 44, and is identified in processing step 45. If N is not greater than L, N
Proceed to processing step 46 to process the syntax element.

処理ステップ46でN番目の構文要素を取り出し、処理
ステップ47で識別してL≠1なら処理ステップ48で
その構文要素が内部構造を作るのに必要な必須構文要素
か否かを引用符げ”」で囲まれているか否かにより識別
し、引用符で囲まれた要素ノ場合にはそのま\で処理を
要しないので処理ステップ52に進む。
In processing step 46, the Nth syntax element is extracted, and in processing step 47, it is identified, and if L≠1, in processing step 48, it is determined whether the syntax element is an essential syntax element necessary to create the internal structure or not. If the element is enclosed in quotation marks, it is left as is and no processing is required, so the process proceeds to step 52.

引用符で囲まれていない構文要素の場合には、処理ステ
ップ49で引数を定めてその構文要素に割り当て、処理
ステップ50でその引数を引数記憶領域に構文要素の順
番に保存する。
In the case of an unquoted syntax element, a process step 49 defines and assigns an argument to the syntax element, and a process step 50 stores the arguments in the argument storage area in the order of the syntax elements.

L=1の場合には、処理ステップ47から処理ステップ
51に分岐してその構文要素を引数記憶領域に保存する
。この処理は第2図の式22等の場合に該当し、右辺が
1構文要素の場合には文字定数であることによる。
If L=1, processing branches from processing step 47 to processing step 51, and the syntax element is stored in the argument storage area. This process corresponds to the case of equation 22 in FIG. 2, etc., because if the right side is one syntax element, it is a character constant.

以上の処理を終わると処理ステップ52でNを+1して
、処理ステップ45に戻る。このようにして右辺の構文
要素を順番に処理し、すべて処理したことを処理ステッ
プ45で識別すると処理ステップ53に分岐して、内部
構造データを作成する。
When the above processing is completed, N is incremented by 1 in processing step 52, and the process returns to processing step 45. In this way, the syntax elements on the right side are processed in order, and when it is determined in processing step 45 that all the syntax elements have been processed, the process branches to processing step 53 to create internal structure data.

即ち、処理ステップ53で引数記憶領域に保存した引数
(又は1個の文字定数)によって、例えば第5図の式1
で示したような内部構造データの右辺を作り、処理ステ
ップ54で定義情報の左辺の構文要素に割り当てる引数
を決定し、処理ステップ55で内部構造データを完成し
、処理ステップ56で以上の引数及び内部構造データを
構文規則の定義情報に付加して、例えば第2図の式21
から第5図の式1のような新定義情報を出力する。
That is, by using the argument (or one character constant) saved in the argument storage area in processing step 53, for example, equation 1 in FIG.
The right side of the internal structure data as shown in is created, the argument to be assigned to the syntax element on the left side of the definition information is determined in processing step 54, the internal structure data is completed in processing step 55, and the above arguments and By adding the internal structure data to the definition information of the syntax rule, for example, expression 21 in Figure 2
Then, new definition information such as Equation 1 in FIG. 5 is output.

その後処理ステップ40に戻って、定義情報の次のレコ
ードを読み、以上の処理を全定義情報を処理するまで繰
り返して処理を終わる。
Thereafter, the process returns to step 40, reads the next record of definition information, and repeats the above process until all definition information is processed, ending the process.

〔発明の効果〕〔Effect of the invention〕

以上の説明から明らかなように本発明によれば、計算機
における構文解析プログラムの生成処理のために、利用
者が構文規則を定義する場合に、システムの内部構造に
関する知識を不要として、定義を容易にし且つ誤りを減
少してシステムの利用性を改善するという著しい工業的
効果がある。
As is clear from the above description, according to the present invention, when a user defines syntax rules for the generation process of a syntax analysis program in a computer, knowledge of the internal structure of the system is not required, making the definition easy. There are significant industrial benefits in reducing errors and improving system usability.

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

第1図は本発明の構成を示す処理の流れ図、第2図は本
発明の定義情報例を示す図、第3図は本発明のシステム
構成側ブロック図、第4図は本発明の実施例の処理の流
れ図、第5図は従来の定義情報例を示す図である。 図において、 1〜5.21〜25は式、 10〜13.40〜56は処理ステップ30は内部構造
データ付加処理部、 31は定義情報、    32は新定義情報を示す。 特許出願人 工業技術院長 飯 塚 幸 三オン発g月
n構成を示す処チ里刀ラバーれ刀第 図 本衾明n完義情報例を示す図 第 ? 図 A交gIllAシステム構成例10ツク図第 図 イ差ヌを膓定A惰嘴及例を示、す図 第 図 ノ!>(94711月のWe−4yIJ cyr ax
\Er&t1−25?〕亨 %
FIG. 1 is a process flowchart showing the configuration of the present invention, FIG. 2 is a diagram showing an example of definition information of the present invention, FIG. 3 is a block diagram of the system configuration of the present invention, and FIG. 4 is an embodiment of the present invention. FIG. 5 is a diagram showing an example of conventional definition information. In the figure, 1 to 5. 21 to 25 are formulas, 10 to 13. 40 to 56 are processing steps 30, an internal structure data addition processing unit, 31 is definition information, and 32 is new definition information. Patent Applicant: Director of the Agency of Industrial Science and Technology Yuki Iizuka A figure showing an example of three-on, three-on, three-on, three-on, three-on, three-on, three-on, three-on, rubber, and complete information examples? Figure A shows an example of a system configuration. >(947November's We-4yIJ cyr ax
\Er&t1-25? 〕Toru%

Claims (1)

【特許請求の範囲】 構文規則の定義情報に基づいて、該構文規則に従って文
を処理する構文解析プログラムを生成する計算機のシス
テムにおいて、 該定義情報の中に、該文の意味解釈上冗長な構文要素を
必須構文要素と区別して指定する所定形式の冗長要素指
定情報を設け、 該冗長要素指定情報に基づいて、該定義情報から該必須
構文要素を抽出し(10、11)、該抽出した必須構文
要素に基づく所定の内部構造データを生成して、該定義
情報に該内部構造データを付加する(12、13)よう
に構成されていることを特徴とする内部構造データ付加
処理方法。
[Claims] In a computer system that generates a syntactic analysis program that processes a sentence according to a syntactic rule based on definition information of a syntactic rule, the definition information includes a syntax that is redundant in terms of semantic interpretation of the sentence. Provide redundant element specification information in a predetermined format that specifies elements as distinct from essential syntax elements, extract the essential syntax elements from the definition information based on the redundant element specification information (10, 11), and extract the extracted essential syntax elements from the definition information (10, 11). An internal structure data addition processing method, comprising: generating predetermined internal structure data based on a syntax element, and adding the internal structure data to the definition information (12, 13).
JP63281306A 1988-11-09 1988-11-09 Internal structure data additional processing method Pending JPH02128224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63281306A JPH02128224A (en) 1988-11-09 1988-11-09 Internal structure data additional processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63281306A JPH02128224A (en) 1988-11-09 1988-11-09 Internal structure data additional processing method

Publications (1)

Publication Number Publication Date
JPH02128224A true JPH02128224A (en) 1990-05-16

Family

ID=17637243

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63281306A Pending JPH02128224A (en) 1988-11-09 1988-11-09 Internal structure data additional processing method

Country Status (1)

Country Link
JP (1) JPH02128224A (en)

Similar Documents

Publication Publication Date Title
US5287444A (en) Message processing system
JPS6375835A (en) Apparatus for generating intended code, program, list and design document
Zhu et al. A neural network architecture for program understanding inspired by human behaviors
JPH05266069A (en) Two-way machie translation system between chinese and japanese languages
JPH02112068A (en) System for simply displaying text
JPH02128224A (en) Internal structure data additional processing method
JP3553984B2 (en) Apparatus and method for generating character string replacement rule
US20180011833A1 (en) Syntax analyzing device, learning device, machine translation device and storage medium
MacLennan The Synmac syntax macroprocessor: Introduction and manual, version 5
JP3003459B2 (en) Program creation support device
Komleva et al. Quality attributes of formal grammars and languages in translator engineering
JPH0728630A (en) Program generating device
JP4399154B2 (en) Translation apparatus and translation program
JP2598082B2 (en) Documentation device and documentation method for knowledge processing language
JPH0833895B2 (en) Sentence generation processing method in machine translation system
JPH08286927A (en) Assembler processing system
JPS63136265A (en) Mechanical translating device
JPH0573336A (en) Unparser automatic generation processor
JP3044463B2 (en) Data conversion method
Wildman et al. Composing grammar transformations to construct a specification of a parser
Pretorius et al. Regular expressions: enabling the development of computational aids for Zulu natural language processing
JPH08241319A (en) Machine translation system
JP2019152712A (en) Analyzer and program
Taylor Lily: A parser generator for LL (1) languages
White Converting context-free grammars to constraint dependency grammars