JPH01147624A - Language processing system - Google Patents
Language processing systemInfo
- Publication number
- JPH01147624A JPH01147624A JP62304876A JP30487687A JPH01147624A JP H01147624 A JPH01147624 A JP H01147624A JP 62304876 A JP62304876 A JP 62304876A JP 30487687 A JP30487687 A JP 30487687A JP H01147624 A JPH01147624 A JP H01147624A
- Authority
- JP
- Japan
- Prior art keywords
- intermediate code
- object code
- program
- interpreter
- processing system
- 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
- 230000004913 activation Effects 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 10
- 238000000034 method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000003213 activating effect Effects 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 language processing system that can perform sequential processing using commands and has a fast execution time.
一般に、言語処理系システムには、大きく分けてインタ
プリタ型とコンパイラ型の2つの型がある。第4図はイ
ンタプリタ型の言語処理系システムの一例を示すブロッ
ク図で、(1)は入力したソースプログラムを第6図に
示す逆ボーランド記法や第7図に示す木構造などの中間
コードに変換する中間コード生成部、(2) は上記中
間コード生成部(1)により生成した中間コードを格納
する中間コード格納メモリ、(3)は上記中間コード格
納メモリ(2)より1命令分ずつ中間コードを入力し、
その中間コードを解釈しながら実行するインタプリタ部
である。In general, language processing systems can be broadly divided into two types: interpreter type and compiler type. Figure 4 is a block diagram showing an example of an interpreted language processing system, and (1) converts the input source program into intermediate code such as the reverse Borland notation shown in Figure 6 or the tree structure shown in Figure 7. (2) is an intermediate code storage memory that stores the intermediate code generated by the intermediate code generation unit (1); (3) is an intermediate code storage memory that stores intermediate code for each instruction from the intermediate code storage memory (2); Enter
This is an interpreter section that executes the intermediate code while interpreting it.
また、第5図はコンパイラ型言語処理系システムの一例
を示すブロック図で、(1)は入力したソースプログラ
ムを逆ボーランド記法(第6図参照)や木構造(第7図
参照)などの中間コードに変換する中間コード生成部、
(4)は上記中間コード生成部(1)により生成した中
間コードを機械語のオブジェクトコードに変換するオブ
ジェクトコード生成部、(5)は上記オブジェクトコー
ド生成部(4)で生成したオブジェクトコードを格納す
るオブジェクトコード格納メモリである。Figure 5 is a block diagram showing an example of a compiler-type language processing system. (1) is a block diagram showing an example of a compiler-type language processing system. An intermediate code generator that converts into code,
(4) is an object code generation unit that converts the intermediate code generated by the above intermediate code generation unit (1) into a machine language object code, and (5) stores the object code generated by the above object code generation unit (4). This is object code storage memory.
次に動作について説明する。Next, the operation will be explained.
第4図構成のインタプリタ型の言語処理系システムでは
、人力したソースプログラムは、中間コード生成部(1
)で、逆ボーランド記法(第6図)や木構造(第7図)
などの中間コードに変換され、中間コード格納メモリ(
2)に格納される。In the interpreter-type language processing system shown in Fig. 4, the manually generated source program is generated by the intermediate code generator (1
), reverse Borland notation (Figure 6) and tree structure (Figure 7)
It is converted into intermediate code such as, and the intermediate code storage memory (
2).
次いで、中間コード格納メモリ(2)から1命令分ずつ
読み取り、インタプリタ部(3)で解釈しながら実行す
る。Next, each instruction is read from the intermediate code storage memory (2) and executed while being interpreted by the interpreter section (3).
従りて、インタプリタ型では1命令ずつの逐次処理が可
能であるが、実行時に中間コードを解釈するための時間
を要することになる。Therefore, although the interpreter type allows sequential processing of one instruction at a time, it takes time to interpret the intermediate code during execution.
他方、第5図構成のコンパイラ型の言語処理系システム
では入力したソースプログラムは中間コード生成部(1
) で逆ポーランド艷法(第6図)や木構造(第7図)
などの中間コードに変換され、次いで、オブジェクトコ
ード生成部(4)で計算機によって直接実行可能な機械
語のオブジェクトコードに変換され、オブジェクトコー
ド格納メモリ(5)に格納される。実行時には計算機が
直接オブジェクトコードを実行する。On the other hand, in the compiler-type language processing system with the configuration shown in Figure 5, the input source program is processed by the intermediate code generator (1).
) and the reverse Polish method (Fig. 6) and the tree structure (Fig. 7).
The object code generator (4) then converts the code into a machine language object code that can be directly executed by a computer, and stores it in the object code storage memory (5). At runtime, the computer directly executes the object code.
従フて、コンパイラ型では計算機が直接実行できる機械
語オブジェクトコードの形でメモリに格納するため、実
行時間が速い。しかし、実行するためにはオブジェクト
コードが必要であるため1命令ずつの逐次処理をするこ
とができない。Therefore, the compiler type stores it in memory in the form of a machine language object code that can be directly executed by a computer, so the execution time is fast. However, since object code is required for execution, sequential processing of one instruction at a time is not possible.
従来のインタプリタ型の言語処理系システムは以上のよ
うに構成されているので、実行時に中間コードを解釈す
るための解釈時間が必要であるため、実行時間が遅いと
いう問題点があった。逆に、コンパイラ型の言語処理系
システムはオブジェクトコードを直接実行するので実行
時間は速いが、コマンドによる逐次処理はできないとい
う問題点があった。Since the conventional interpreter-type language processing system is configured as described above, there is a problem in that the execution time is slow because interpretation time is required to interpret the intermediate code at the time of execution. On the other hand, a compiler-type language processing system directly executes object code, so the execution time is fast, but there is a problem in that it cannot perform sequential processing using commands.
この発明は、上記のような問題点を解消するためになさ
れたもので、実行時間が速く、かつコマンドによる逐次
処理ができる言語処理系システムを得ることを目的とす
る。The present invention was made to solve the above-mentioned problems, and an object of the present invention is to provide a language processing system that has a fast execution time and can perform sequential processing using commands.
この発明に係る言語処理系システムは、オペレータによ
り与えられるコマンド文字列又はプログラムに従って特
定のハードウェアを動作させる言語処理系システムにお
いて、オペレータより与えられるコマンド文字列又はプ
ログラムを構文解析して中間コードを生成する中間コー
ド生成部と、上記中間コードを解釈し実行するインタプ
リタ部と、上記中間コードを機械語のオブジェクトコー
ドに変換するオブジェクトコード生成部と、上記オブジ
ェクトコードを格納するオブジェクトコード格納メモリ
と、オペレータによりコマンド文字列が与えられた時は
上記インタプリタ部に起動信号を送出すると共に、プロ
グラムが与えられた時には上記オブジェクトコード生成
部に起動信号を送出する判断部とを備えたものである。A language processing system according to the present invention is a language processing system that operates specific hardware according to a command string or program given by an operator, and generates intermediate code by parsing the command string or program given by the operator. an intermediate code generation unit that generates an intermediate code, an interpreter unit that interprets and executes the intermediate code, an object code generation unit that converts the intermediate code into a machine language object code, and an object code storage memory that stores the object code; The system is equipped with a determining section which sends a start signal to the interpreter section when a command string is given by the operator, and sends a start signal to the object code generator when a program is given.
コマンドによる逐次処理かプログラムによる処理かを判
断する判断部を有し、コマンドによる逐次処理用のイン
タプリタ部とプログラム処理用のオブジェクトコード生
成部及びオブジェクトコード格納メモリを有するように
したものである。The apparatus has a determining section that determines whether sequential processing is performed by commands or by a program, and includes an interpreter section for sequential processing using commands, an object code generation section for program processing, and an object code storage memory.
この発明における判断部は、コマンド文字列が与えられ
た時はインタプリタ部を起動して逐次処理を行い、プロ
グラムが与えられた時はオブジェクトコード生成部を起
動してプログラム処理を実行させる。The determining section in this invention activates the interpreter section to perform sequential processing when given a command string, and activates the object code generating section to execute program processing when given a program.
(実施例)
以下、この発明の一実施例を図について説明する。第1
図において、(1)は入力したソースプログラムを逆ボ
ーランド記法(第6図)又は木構造(第7図)などに変
換する中間コード生成部、(3)はコマンドによる逐次
処理を行うとき、中間コードを解釈し実行するインタプ
リタ部、(4)はプログラムによる処理を行うとき、中
間コードを機tt4語のオブジェクトコードに変換する
オブジェクトコード生成部、(5)は上記オブジェクト
コード生成部(4)で生成したオブジェクトコードを格
納するオブジェクトコード格納メモリである。(Example) Hereinafter, an example of the present invention will be described with reference to the drawings. 1st
In the figure, (1) is an intermediate code generator that converts the input source program into reverse Borland notation (Figure 6) or tree structure (Figure 7), etc., and (3) is an intermediate code generator that converts the input source program into reverse Borland notation (Figure 6) or tree structure (Figure 7). An interpreter section that interprets and executes the code, (4) an object code generation section that converts the intermediate code into a four-word object code when processing the program, and (5) the object code generation section (4). This is an object code storage memory that stores generated object codes.
しかして、(6)はコマンドによる逐次処理を行う時に
は上記インタプリタ部(3) を起動し、プログラムに
よる処理を行うときには上記オブジェクトフード生成部
(4)を起動する判断部で、この判断部(6)は、入力
した文字列中のキャリッジリターンで区切られる文字列
の単位をカウントするカウンタを内蔵し、そのカウント
値が1の時は上記インタプリタ部(3) に起動信号を
送出すると共に、2以上の時は上記オブジェクトコード
生成部(4)に起動信号を送出するようになっている。Therefore, (6) is a judgment unit that starts the above-mentioned interpreter unit (3) when performing sequential processing using commands, and starts the above-mentioned object food generation unit (4) when performing processing using a program. ) has a built-in counter that counts the units of character strings delimited by carriage returns in the input character string, and when the count value is 1, it sends a start signal to the interpreter section (3), and when it is 2 or more At this time, an activation signal is sent to the object code generation section (4).
次に動作について第2図(a)、(b)および第3図を
参照して説明する。入力したソースプログラムは中間コ
ード生成部(1)で構文解析し、その結果として逆ボー
ランド記法(第6図)や木構造(第7図)などの中間コ
ードに変換される。次に、判断部(6)は、入力した中
間コードの文字列中の0D)l (キャリッジリターン
)で区切られる単位をカウントしく第3図のステップS
1)、そのカウント数が1である時(第2図(b)、第
3図のステップS2)はコマンドによる逐次処理と判断
し、インタプリタ部(3)を起動する(第3図のステッ
プS3)。しかして、これに基いてインタプリタ部(3
)は上記中間コードを解釈し実行する。Next, the operation will be explained with reference to FIGS. 2(a) and 3(b) and FIG. The input source program is parsed by the intermediate code generator (1), and as a result is converted into intermediate code such as reverse Borland notation (FIG. 6) or tree structure (FIG. 7). Next, the judgment unit (6) counts the units delimited by 0D)l (carriage return) in the input intermediate code character string and steps S in FIG.
1), when the count number is 1 (FIG. 2(b), step S2 in FIG. 3), it is determined that sequential processing is performed by commands, and the interpreter section (3) is activated (step S3 in FIG. 3). ). Based on this, the interpreter section (3
) interprets and executes the above intermediate code.
また、判断部(6)は人力した中間コードの文字列中に
ODH(キャリッジリターン)で区切られる単位が複数
個ある時(第2図(a)、第3図のステップS1と52
)にはプログラムによる処理と判断し、オブジェクトコ
ード生成部(4)を起動する(第3図のステップ54)
。これに基いてオブジェクトコード生成部(4)は上記
中間コードを計算機が直接実行できる機械語のオブジェ
クトコードに変換し、オブジェクトコード格納メモリ(
5)に格納する。In addition, when there are multiple units delimited by ODH (carriage return) in the character string of the manually generated intermediate code (steps S1 and 52 in FIG. 2(a) and FIG.
) is determined to be a program-based process, and the object code generator (4) is activated (step 54 in Figure 3).
. Based on this, the object code generator (4) converts the intermediate code into a machine language object code that can be directly executed by a computer, and converts the intermediate code into a machine language object code that can be directly executed by a computer.
5).
従って実行時はメモリ内にあるオブジェクトコードを直
接実行するため、実行時間が速い。Therefore, since the object code in memory is directly executed during execution, the execution time is fast.
(発明の効果)
以上のようにこの発明によれば、コマンドによる逐次処
理時にはインタプリタ部を起動し、プログラムによる処
理時にはオブジェクトコード生成部を起動するように構
成したので、プログラムによる処理時にはコンパイラ型
の言語処理系と同様に動作するので処理時間が速く、か
つインタプリタ部を起動することによってコマンドによ
る逐次処理も可能であるという効果がある。(Effects of the Invention) As described above, according to the present invention, the interpreter section is activated during sequential processing by a command, and the object code generation section is activated during processing by a program. Since it operates in the same way as a language processing system, the processing time is fast, and by activating the interpreter section, it is possible to perform sequential processing using commands.
第1図はこの発明の一実施例による言語処理系システム
のブロック図、第2図(a)、(b)はこの発明による
判断部の判断方法の一例を示す説明図、第3図はその判
断の流れ図、第4図は従来のインタプリタ型の言語処理
系のブロック図、第5図は従来のコンパイラ型のブロッ
ク図、第6図は逆ボーランド記法の例を示す説明図、第
7図は木構造の例を示す説明図である。
(1)は中間コード生成部、
(2)は中間コード格納メそり、
(3)はインタプリタ部、
(4)はオブジェクトコード生成部、
(5)はオブジェクトコード格納メモリ、(6)は判断
部。
なお、各図中、同一符号は同−又は相当部分を示す。FIG. 1 is a block diagram of a language processing system according to an embodiment of the present invention, FIGS. 2(a) and (b) are explanatory diagrams showing an example of the determination method of the determination unit according to the present invention, and FIG. Flowchart of judgment, Figure 4 is a block diagram of a conventional interpreter type language processing system, Figure 5 is a block diagram of a conventional compiler type, Figure 6 is an explanatory diagram showing an example of reverse Borland notation, and Figure 7 is a block diagram of a conventional interpreter type language processing system. FIG. 2 is an explanatory diagram showing an example of a tree structure. (1) is intermediate code generation section, (2) is intermediate code storage memory, (3) is interpreter section, (4) is object code generation section, (5) is object code storage memory, (6) is judgment section . In each figure, the same reference numerals indicate the same or corresponding parts.
Claims (2)
プログラムに従って特定のハードウェアを動作させる言
語処理系システムにおいて、オペレータより与えられる
コマンド文字列又はプログラムを構文解析して中間コー
ドを生成する中間コード生成部と、上記中間コードを解
釈し実行するインタプリタ部と、上記中間コードを機械
語のオブジェクトコードに変換するオブジェクトコード
生成部と、上記オブジェクトコードを格納するオブジェ
クトコード格納メモリと、オペレータによりコマンド文
字列が与えられた時は上記インタプリタ部に起動信号を
送出すると共に、プログラムが与えられた時には上記オ
ブジェクトコード生成部に起動信号を送出する判断部と
を備えたことを特徴とする言語処理系システム。(1) In a language processing system that operates specific hardware according to a command string or program given by an operator, an intermediate code generation unit that generates intermediate code by parsing the command string or program given by the operator; , an interpreter section that interprets and executes the intermediate code, an object code generation section that converts the intermediate code into machine language object code, an object code storage memory that stores the object code, and a command string given by an operator. A language processing system comprising: a determining section that sends a start signal to the interpreter section when a program is given, and sends a start signal to the object code generator when a program is given.
ターンで区切られる文字列の単位をカウントするカウン
タを備え、そのカウント値が1の時は上記インタプリタ
部に起動信号を送出すると共に、2以上の時は上記オブ
ジェクトコード生成部に起動信号を送出する特許請求の
範囲第1項記載の言語処理系システム。(2) The determination unit includes a counter that counts units of character strings delimited by carriage returns in the input character string, and when the count value is 1, it sends a start signal to the interpreter unit, and 2 2. The language processing system according to claim 1, wherein in the above case, an activation signal is sent to the object code generation section.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62304876A JPH01147624A (en) | 1987-12-02 | 1987-12-02 | Language processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62304876A JPH01147624A (en) | 1987-12-02 | 1987-12-02 | Language processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01147624A true JPH01147624A (en) | 1989-06-09 |
Family
ID=17938344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62304876A Pending JPH01147624A (en) | 1987-12-02 | 1987-12-02 | Language processing system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01147624A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07244602A (en) * | 1994-03-07 | 1995-09-19 | Pfu Ltd | Data base retrieval processing system |
-
1987
- 1987-12-02 JP JP62304876A patent/JPH01147624A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07244602A (en) * | 1994-03-07 | 1995-09-19 | Pfu Ltd | Data base retrieval processing system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH05298052A (en) | Window system and event processing method | |
JPH01147624A (en) | Language processing system | |
JPH03241439A (en) | Test data preparation tool | |
JP3328056B2 (en) | Information extraction device from parse tree | |
JP2001255912A (en) | Method for executing motion program | |
JPH045703A (en) | Sequence program generating device | |
JPH0250730A (en) | Language converting system based upon common machine word | |
JPS6115236A (en) | Partial production of object list | |
JPH02207343A (en) | Debugging device | |
JPS63228341A (en) | Program syntax checking system | |
JPH0546434A (en) | Program debugging system | |
JPS63163543A (en) | Information processor | |
JPH0371229A (en) | Program controller | |
JPH01194053A (en) | Processing system for command procedure | |
JPS6375830A (en) | Command control system | |
JPH01188956A (en) | Program exception processing system | |
JPH06274351A (en) | Optimizing system for compiler | |
JPH04107605A (en) | Control program language processor | |
JPH04333146A (en) | Program execution control system for debugging | |
JPS62182930A (en) | Function dividion type parallel compiling system | |
JPS63640A (en) | Execution control system for partial unit of data flow | |
JPS629950B2 (en) | ||
JPH04165533A (en) | Data information offering device | |
JPH04178734A (en) | Program language processor | |
JPH04344527A (en) | Input command parameter analyzing device |