JPH04312130A - Language processing program - Google Patents
Language processing programInfo
- Publication number
- JPH04312130A JPH04312130A JP3103616A JP10361691A JPH04312130A JP H04312130 A JPH04312130 A JP H04312130A JP 3103616 A JP3103616 A JP 3103616A JP 10361691 A JP10361691 A JP 10361691A JP H04312130 A JPH04312130 A JP H04312130A
- Authority
- JP
- Japan
- Prior art keywords
- check
- inspection
- language
- type
- test
- 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
- 238000000034 method Methods 0.000 claims abstract description 21
- 230000006870 function Effects 0.000 claims abstract description 7
- 238000007689 inspection Methods 0.000 claims description 38
- 238000012360 testing method Methods 0.000 claims description 24
- 238000012217 deletion Methods 0.000 abstract 1
- 230000037430 deletion Effects 0.000 abstract 1
- 238000005457 optimization Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000010998 test method Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000015654 memory Effects 0.000 description 1
- 238000011017 operating method Methods 0.000 description 1
Abstract
Description
【0001】0001
【産業上の利用分野】本発明は警告メッセージ出力の対
象とする言語仕様の種別を柔軟に変更することができる
ように改良した言語処理プログラムに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a language processing program improved so that the type of language specification for which a warning message is output can be flexibly changed.
【0002】0002
【従来の技術】一般に、原始プログラムから目的プログ
ラムを生成する言語処理プログラムにおいて、原始プロ
グラムに含まれている言語仕様に合致しない場合、また
はプログラムが予期しない実行結果となる場合に警告メ
ッセージまたは誤りメッセージを出力する。[Background Art] Generally, in a language processing program that generates a target program from a source program, a warning message or an error message is sent when the language specifications included in the source program are not met or when the program produces an unexpected execution result. Output.
【0003】従来、この種の言語処理プログラムにおけ
る言語処理の詳細は、たとえば、1977年にアディソ
ン・ウェスリー・パブリッシング・カンパニーより発行
されたエイ・ブイ・エイホ(A.V.Ahao)および
ジェイ・ディ・ウルマン(J.D.Ullman)著作
の「コンパイラ設計の原理(Principlesof
Compiler Design)」に記載され
ているように、主として言語処理プログラムの字句解析
部および構文解析部において、言語仕様との相違を検査
している。したがって、言語仕様のうち、特定の機能を
使用したとき警告を通知する場合は、これらの字句解析
部または構文解析部の処理の内部を機能毎に修正してい
る。[0003] Conventionally, details of language processing in this type of language processing program have been described, for example, in A.V. Ahao and J.D., published by Addison-Wesley Publishing Company in 1977.・Principles of Compiler Design written by J.D. Ullman
Compiler Design), the lexical analysis section and syntactic analysis section of the language processing program mainly check for differences with the language specifications. Therefore, if a warning is to be issued when a specific function is used in the language specifications, the internal processing of the lexical analyzer or syntactic analyzer is modified for each function.
【0004】0004
【発明が解決しようとする課題】しかし、上述した従来
の言語処理プログラムでは、言語仕様の特定機能を利用
するときに警告を通知するためには、対象とする警告の
種類に合わせて言語処理プログラムの各中間処理を修正
しているため、警告の種別を変更、追加または削除する
ことが簡単にできないという欠点があった。[Problems to be Solved by the Invention] However, in the conventional language processing program described above, in order to notify a warning when using a specific function of the language specification, the language processing program must be Since each intermediate process is modified, the warning type cannot be easily changed, added, or deleted.
【0005】本発明はこのような従来の問題を解決する
ものであり、警告の種別の変更、追加および削除を簡単
にすることができる言語処理プログラムを提供すること
を目的とする。SUMMARY OF THE INVENTION The present invention is intended to solve these conventional problems, and it is an object of the present invention to provide a language processing program that can easily change, add, and delete warning types.
【0006】[0006]
【課題を解決するための手段】上記の目的を達成するた
めに、本発明においては、原始プログラムを入力し、目
的プログラムを生成する言語処理プログラムにおいて、
利用者が設定した起動パラメータに基づいてどの種の言
語仕様を使用しているときに警告メッセージを出力する
かを決定する検査種別判定手段と、言語仕様の特定の機
能を検査する複数の検査手順から成る検査部と、これら
複数の検査手順の中から前記検査種別判定手段によって
判定された検査種別に対応する検査手順を呼び出す検査
部呼び出し手段とを有している。[Means for Solving the Problems] In order to achieve the above object, the present invention provides a language processing program that inputs a source program and generates a target program.
A test type determination means that determines which type of language specification is used to output a warning message based on startup parameters set by the user, and multiple test procedures that test specific features of the language specification. and an inspection section calling means for calling a test procedure corresponding to the test type determined by the test type determining means from among the plurality of test procedures.
【0007】[0007]
【作用】本発明はこのように構成されているので、言語
仕様の検査部を字句解析部および構文解析部から独立さ
せて設けることによって、柔軟な検査内容を変更するこ
とができる。[Operation] Since the present invention is constructed as described above, by providing the language specification inspection section independently from the lexical analysis section and the syntactic analysis section, it is possible to flexibly change the inspection contents.
【0008】[0008]
【実施例】以下本発明の実施例を図面によって説明する
。図1は本発明の一実施例における構成を示すブロック
図である。同図において、1は原始フムログラム11を
入力し、中間コード12および目的プログラム13を生
成する言語処理プログラムである。2は原始プログラム
11を字句の要素に分解する字句解析部、3は原始プロ
グラム11の構文を解析する構文解析部、4は字句解析
部2および構文解析部3から得られた解析結果に基づい
て中間コード12を生成する中間コード生成部、5は中
間コード12を修正して演算処理時間の短縮や必要メモ
リ数を圧縮するための最適化部、6は機械語命令を生成
して目的プログラム13としてファイルするコード生成
部である。7は利用者が言語処理プログラムを起動する
ときに与えた起動パラメータを判別し、どの種の検査を
実施するかを判定して検査内容を決定する検査種別判定
手段、8は検査種別判定手段7によって決定された検査
内容に基づいてどの検査手順を呼び出すかを決定し、検
査部9から必要な検査手順を呼び出す検査部呼び出し手
段、9は検査部であって、中間コード12を参照し、対
象とする言語仕様上特定の機能を使用しているか否かを
検査し、もし使用されていれば利用者に通知する。検査
部9は異なる言語仕様の検査をする複数の検査手順9−
iから成り、必要に応じて任意の1個、または複数個が
呼び出される。検査手順は容易に追加または削除するこ
とができるように検査内容別に独立している。10は制
御部であって、字句解析部2、構文解析部3、中間コー
ド生成部4を順次呼び出して朝刊コード12を生成した
直後に検査種別判定手段7を呼び出し、検査部呼び出し
手段8が検査の終了を確認した時点で最適化部5および
コード生成部6を順次呼び出して目的プログラム13を
生成するように制御する。DESCRIPTION OF THE PREFERRED EMBODIMENTS Examples of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. In the figure, 1 is a language processing program that inputs a primitive humulogram 11 and generates an intermediate code 12 and a target program 13. 2 is a lexical analysis unit that decomposes the source program 11 into lexical elements; 3 is a syntax analysis unit that analyzes the syntax of the source program 11; 4 is a lexical analysis unit that analyzes the source program 11 based on the analysis results obtained from the lexical analysis unit 2 and the syntactic analysis unit 3; An intermediate code generator 5 generates the intermediate code 12; an optimization unit 5 modifies the intermediate code 12 to shorten calculation processing time and the number of required memories; and 6 a target program 13 that generates machine language instructions. This is a code generator that files files as . Reference numeral 7 denotes a test type determining means that determines the startup parameters given by the user when starting the language processing program, determines the type of test to be performed, and determines the test content; 8, the test type determining means 7; Inspection unit calling means determines which inspection procedure to call based on the inspection content determined by and calls the necessary inspection procedure from the inspection unit 9; 9 is an inspection unit that refers to the intermediate code 12, and It checks whether a specific function is used according to the language specification, and if it is used, the user is notified. The inspection unit 9 performs multiple inspection procedures 9- for inspecting different language specifications.
i, and one or more of them can be called as needed. Test procedures are independent of each test content so that they can be easily added or deleted. 10 is a control unit which sequentially calls the lexical analysis unit 2, syntactic analysis unit 3, and intermediate code generation unit 4 to generate the morning paper code 12, and immediately calls the test type determination means 7, and the test unit calling means 8 executes the test. When the end of the program is confirmed, the optimization section 5 and the code generation section 6 are sequentially called to generate the target program 13.
【0009】次に、図2および図3を参照して上記実施
例の動作について説明する。図2は検査種別判定手段7
の動作手順を示すフローチャートである。中間コード1
2が生成された後制御部10によって呼び出されると、
最初に起動パラメータが保存されている起動パラメータ
リストを取得する(ステップS21)。起動パラメータ
リストには、利用者によって設定された「目的プログラ
ムリストを出力する」、「最適化を実施する」などとい
うコンパイルに対する要求事項が保存されている。次に
、この起動パラメータリストを解析してパラメータリス
トから検査種別を示しているものを抜き出し(ステップ
S22)、検査種別毎に検査種別表20へ登録する(ス
テップS23)。検査種別表20にはあらかじめ予定さ
れる検査手順が登録できるように欄が設けられているが
、それ以外の検査手順も登録することができるように、
「その他」の欄が用意されている。同図の検査種別表2
0の例では、「その他」の欄に(a)RECRという入
口名を持つ検査手順が登録されていることを示す。Next, the operation of the above embodiment will be explained with reference to FIGS. 2 and 3. Figure 2 shows the test type determination means 7.
3 is a flowchart showing the operating procedure. intermediate code 1
2 is generated and is called by the control unit 10,
First, a startup parameter list in which startup parameters are stored is obtained (step S21). The startup parameter list stores compiling requirements such as "output a target program list" and "perform optimization" set by the user. Next, this startup parameter list is analyzed to extract those indicating the test type from the parameter list (step S22), and each test type is registered in the test type table 20 (step S23). The inspection type table 20 has a column so that pre-scheduled inspection procedures can be registered, but other inspection procedures can also be registered.
An "Other" column is provided. Inspection type table 2 in the same figure
An example of 0 indicates that an inspection procedure with the entry name (a) RECR is registered in the "Others" column.
【0010】図3は検査部呼び出し手段8の動作手順を
示すフローチャートである。検査部呼び出し手段8は検
査種別判定手段7の終了にともなって制御部10から呼
び出されると、検査種別判定手段7が先に登録した検査
種別表20からエントリを1個取り出す(ステップS3
1)。検査手順が検査部呼び出し表30に登録されてい
るかどうか検索し(ステップS32、ステップS33)
、登録されている場合は、対応する検査手順を検査部9
から呼び出す(ステップS34)。登録されていない場
合は、検査種別表20に設定されている「その他」欄の
入口名を持つ検査手順を呼び出す。複数の検査手順が検
査種別表20に設定されている場合は(ステップS36
)、ステップS31へ戻って検査種別表20に設定され
ている全ての検査を終了するまで同様の動作を繰り返す
。FIG. 3 is a flowchart showing the operation procedure of the inspection section calling means 8. When the inspection unit calling unit 8 is called by the control unit 10 upon completion of the inspection type determination unit 7, the inspection unit calling unit 8 extracts one entry from the examination type table 20 previously registered by the inspection type determination unit 7 (step S3).
1). Search whether the inspection procedure is registered in the inspection department call table 30 (step S32, step S33)
, if registered, the corresponding inspection procedure will be sent to the inspection section 9.
(step S34). If it is not registered, the test procedure having the entrance name in the "Others" column set in the test type table 20 is called. If multiple inspection procedures are set in the inspection type table 20 (step S36
), the process returns to step S31 and the same operation is repeated until all the tests set in the test type table 20 are completed.
【0011】検査が終了した中間コード12は最適化部
5による最適化処理、およびコード生成部6による機械
語生成を経て目的プログラム13が生成される。The intermediate code 12 that has been inspected is subjected to optimization processing by the optimization section 5 and machine language generation by the code generation section 6, so that the target program 13 is generated.
【0012】0012
【発明の効果】以上説明したように、本発明は検査して
いる言語仕様に適合していないという検査以外に、対象
とする言語仕様の特定の機能を使用したか否かの検査を
行ないたい場合、その検査を従来のように中間処理の中
で行なわず、独立した処理として呼び出す手段を提供す
ることによって、容易に検査内容を追加、削除すること
ができる効果がある。[Effects of the Invention] As explained above, in addition to checking whether the language specification is not conforming to the language specification being inspected, the present invention can also check whether a specific function of the target language specification has been used. In this case, by providing means for calling the test as an independent process instead of performing it in intermediate processing as in the past, it is possible to easily add or delete the test contents.
【図1】本発明の一実施例における構成を示すブロック
図FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention.
【図2】検査種別判定手段の動作手順を示すフローチャ
ート[Fig. 2] Flowchart showing the operation procedure of the test type determination means
【図3】検査部呼び出し手段の動作手順を示すフローチ
ャート[Fig. 3] Flowchart showing the operation procedure of the inspection unit calling means
1 言語処理プログラム 2 字句解析部 3 構文解析部 4 中間コード生成部 5 最適化部 6 コード生成部 7 検査種別判定手段 8 検査部呼び出し手段 9 検査部 10 制御部 11 原始プログラム 12 中間コード 13 目的プログラム 20 検査種別表 30 検査部呼び出し表 1 Language processing program 2 Lexical analysis section 3. Syntax analysis section 4 Intermediate code generation section 5 Optimization section 6 Code generation section 7 Test type determination means 8 Inspection department calling means 9 Inspection Department 10 Control section 11 Primitive program 12 Intermediate code 13 Purpose program 20 Inspection type table 30 Inspection department call list
Claims (1)
ラムを生成する言語処理プログラムにおいて、利用者が
設定した起動パラメータに基づいてどの種の言語仕様を
使用しているときに警告メッセージを出力するかを決定
する検査種別判定手段と、言語仕様の特定の機能を検査
する複数の検査手順から成る検査部と、これら複数の検
査手順の中から前記検査種別判定手段によって判定され
た検査種別に対応する検査手順を呼び出す検査部呼び出
し手段とを含むことを特徴とする言語処理プログラム。[Claim 1] In a language processing program that inputs a source program and generates a target program, it is possible to determine which type of language specification is used to output a warning message based on startup parameters set by the user. an inspection unit consisting of a plurality of inspection procedures for inspecting a specific function of the language specification; and a test corresponding to the inspection type determined by the inspection type determination means from among the plurality of inspection procedures. A language processing program comprising: inspection unit calling means for calling a procedure.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3103616A JPH04312130A (en) | 1991-04-10 | 1991-04-10 | Language processing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3103616A JPH04312130A (en) | 1991-04-10 | 1991-04-10 | Language processing program |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH04312130A true JPH04312130A (en) | 1992-11-04 |
Family
ID=14358707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3103616A Pending JPH04312130A (en) | 1991-04-10 | 1991-04-10 | Language processing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH04312130A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020262456A1 (en) * | 2019-06-26 | 2020-12-30 | コネクトフリー株式会社 | Execution code provision method and software development system |
-
1991
- 1991-04-10 JP JP3103616A patent/JPH04312130A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020262456A1 (en) * | 2019-06-26 | 2020-12-30 | コネクトフリー株式会社 | Execution code provision method and software development system |
JP2021005250A (en) * | 2019-06-26 | 2021-01-14 | コネクトフリー株式会社 | Execution code provision method and software development system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5287444A (en) | Message processing system | |
JPH0950389A (en) | Apparatus and method for mounting by using computer system | |
JPH05257709A (en) | Parallelism discriminating method and parallelism supporting method using the same | |
JPH08202545A (en) | Object-oriented system and method for generation of target language code | |
US6330714B1 (en) | Method and computer program product for implementing redundant lock avoidance | |
JPH0748182B2 (en) | Program error detection method | |
JPH04312130A (en) | Language processing program | |
JP2002288004A (en) | Program source processing device and method, and program source processing program | |
JPH01177165A (en) | Definition-quotation relation checking system for array | |
JP3328056B2 (en) | Information extraction device from parse tree | |
JPH0667871A (en) | Automatic program updating system | |
JPH0520093A (en) | Method and device for compilation of module | |
JPH08249193A (en) | Checking system for language specification range of program | |
JP2672968B2 (en) | Source list output processing method for debugging | |
Gyén et al. | Code Comprehension for the Move Semantics in C+ | |
JP2815178B2 (en) | Compiler unit | |
JPH0954704A (en) | Automatic test program generating system for language processor | |
JP3167386B2 (en) | Automatic program parallelization method | |
JPH0695890A (en) | Name replacement system in compiler | |
JPH08212105A (en) | Program managing device | |
JPH05204705A (en) | Processing method for detecting undefined parameter | |
JPH1195995A (en) | Device and method for analyzing data flow, and recording medium recording computer program therefor | |
JPH04340629A (en) | Language processing device | |
JPH03223926A (en) | Device for preventing double registration of program parts | |
JPH10207738A (en) | Language processing system |