JPH0690669B2 - Character string manipulation instruction compilation processing method - Google Patents
Character string manipulation instruction compilation processing methodInfo
- Publication number
- JPH0690669B2 JPH0690669B2 JP10396887A JP10396887A JPH0690669B2 JP H0690669 B2 JPH0690669 B2 JP H0690669B2 JP 10396887 A JP10396887 A JP 10396887A JP 10396887 A JP10396887 A JP 10396887A JP H0690669 B2 JPH0690669 B2 JP H0690669B2
- Authority
- JP
- Japan
- Prior art keywords
- subscript
- text
- instruction
- character string
- read
- 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.)
- Expired - Fee Related
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Description
【発明の詳細な説明】 〔概要〕 添字評価時期が命令実行の最初に1回だけ行うように定
められた文字列操作系命令の翻訳処理にあたって,中間
テキストが添字である場合には,それを直ちにオブジェ
クト展開し,添字以外である場合には,一旦,作業用テ
キスト記憶部に格納しておき,その命令についての中間
テキスト終了時に,順次,作業用テキスト記憶部から読
み込んでオブジェクト展開することにより,簡単な処理
構成で,添字評価を先に行うことができるようにしてい
る。DETAILED DESCRIPTION OF THE INVENTION [Outline] When an intermediate text is a subscript when translating a character string manipulation instruction whose subscript evaluation time is determined to be performed only once at the beginning of instruction execution, The object is immediately expanded, and if it is other than the subscript, it is temporarily stored in the work text storage unit, and when the intermediate text for the instruction is finished, the object is sequentially read from the work text storage unit and the object is expanded. , With a simple processing configuration, subscript evaluation can be performed first.
本発明は,例えばCOBOLコンパイラなどの文字列操作系
命令コンパイル処理方式に関するものである。The present invention relates to a character string manipulation instruction compilation processing method such as a COBOL compiler.
計算機言語の1つであるCOBOLにおける表の扱いでは,
一意名を添字として使用することが可能である。この添
字評価時期については,COBOLの標準規格により,各命令
単位に決定されている。命令の中で添字付けされたデー
タが記述された時点と,添字評価時期が異なる場合に
も,簡単に統一的に,予め定められた位置において,添
字のオブジェクトを展開することが必要とされる。When handling tables in COBOL, which is one of the computer languages,
It is possible to use a unique name as a subscript. The subscript evaluation time is determined for each instruction unit according to the COBOL standard. Even when the subscripted data is described in the instruction and the subscript evaluation time are different, it is necessary to easily and uniformly expand the subscript object at a predetermined position. .
第5図は従来方式の問題点説明図である。 FIG. 5 is a diagram for explaining the problems of the conventional method.
例えば,COBOLコンパイラは,COBOL言語で記述された原始
プログラムを入力し,実行可能形式となっているプログ
ラム(以下,オブジェクトモジュールという)に翻訳す
る処理を行う。このコンパイラは,構文解析フェーズと
コード生成フェーズとからなり,2つのフェーズ間には,
中間テキストと呼ばれる特殊コードが介在する。For example, a COBOL compiler inputs a source program written in COBOL and translates it into an executable program (hereinafter referred to as an object module). The compiler consists of a parsing phase and a code generation phase, with two phases:
A special code called intermediate text intervenes.
ところで,COBOL原始プログラムには,「表操作」という
データの扱いがある。1つのデータ形式を複数個集め
て,1つのデータとして扱うもので,各々の要素を参照す
るために,指標付けまたは添字付けを行う。通常,COBOL
の各命令において,指標や添字は,そのデータが記述さ
れた時点で評価すればよいので,構文解析フェーズは,
指標や添字が出現したタイミングで,添字評価用の中間
テキストを出力し,コード生成フェーズも,添字評価用
の中間テキストを読み込んだときに,そのオブジェクト
を展開するという処理を行う。By the way, COBOL source programs handle data called "table operations". It collects multiple data formats and handles them as one data. Indexing or subscripting is performed to refer to each element. Usually COBOL
In each instruction of, the index and subscript may be evaluated at the time when the data is described, so the parsing phase is
When the index or subscript appears, the intermediate text for subscript evaluation is output, and the code generation phase also expands the object when the intermediate text for subscript evaluation is read.
ところが,例えばANS COBOL(American National Stan
dard COBOL)1985の規格では,いわゆるINSPECT命令,ST
RING命令,UNSTRING命令などの文字列操作系の命令で,
一意名に関する添字は,命令の実行の最初に1回だけ評
価するという規格になっている。文字列操作系命令は,
複数個の中間テキストに分割され,構文解析フェーズ
は,文字列操作系命令の添字の評価時期を意識せずに中
間テキストを作成するので,前述のように中間テキスト
の読み込み順に,オブジェクトを展開した場合,上記文
字列操作系命令の規格にそぐわないオブジェクトモジュ
ールが生成されることになる。However, for example, ANS COBOL (American National Stan
dard COBOL) 1985 standard, so-called INSPECT instruction, ST
Character string manipulation commands such as RING command and UNSTRING command.
The subscript for a unique name is a standard that is evaluated only once at the beginning of execution of an instruction. The character string manipulation commands are
It is divided into multiple intermediate texts, and in the parsing phase, the intermediate texts are created without being aware of the evaluation time of the subscript of the character string manipulation type instruction, so the objects are expanded in the order of reading the intermediate texts as described above. In this case, an object module that does not meet the above-mentioned character string manipulation instruction standard will be generated.
これを第5図に従って,さらに詳細に説明する。This will be described in more detail with reference to FIG.
例えば,第5図(イ)に示す命令について,構文解析フ
ェーズでは,命令単位の添字評価時期を意識せずに,第
5図(ロ)に示すような複数個の中間テキストを作成す
る。従って,コード生成フェーズでは,命令によって規
定されている添字評価時期を考慮してオブジェクト展開
をする必要がある。For example, for the instruction shown in FIG. 5 (a), in the syntax analysis phase, a plurality of intermediate texts as shown in FIG. 5 (b) are created without paying attention to the subscript evaluation time for each instruction. Therefore, in the code generation phase, it is necessary to expand the object in consideration of the subscript evaluation time specified by the instruction.
即ち,例えば,第5図(イ)に示す命令において,図示
(a)のデータに作用の結果が転記された後,図示
(b)のデータに作用の結果が転記される命令があると
する。(a)のデータに作用の結果が転記されると,当
然,AやBの値が変更されるので,(b)のデータに作用
結果を転記する場合,変更前の値を添字の値として使用
するか,変更後の値を使用するかで,結果が大きく変わ
ってくるからである。That is, for example, in the instruction shown in FIG. 5A, it is assumed that there is an instruction in which the result of the action is copied to the data shown in FIG. 5A and then the result of the action is copied to the data shown in FIG. . When the result of the action is transcribed to the data of (a), the values of A and B are naturally changed, so when transcribing the action result to the data of (b), the value before the change is used as the subscript value. This is because the result will change greatly depending on whether you use it or the changed value.
しかし,従来方式によれば,コード生成フェーズは,中
間テキストの入力,各命令のオブジェクト展開,添字評
価に関するオブジェクト展開などのサブルーチン化され
た処理部によって構成され,通常,添字に関する中間テ
キストが現れた時点で,添字評価に関するオブジェクト
展開のための処理部を呼び出し,その他の場合には,各
命令単位のオブジェクト展開処理部を呼び出すので,オ
ブジェクト展開順序が,第5図(ロ)に示すように,中
間テキストの並びの順番になる。従って,前述の文字列
操作系命令のように,添字と評価時期が命令の実行の最
初に1回だけとなっているものについては、上記各処理
部を無条件に呼び出すと,規格にそぐわないオブジェク
トが生成されることになる。However, according to the conventional method, the code generation phase is configured by a processing unit that is a subroutine such as input of intermediate text, object expansion of each instruction, and object expansion related to subscript evaluation, and the intermediate text related to subscript usually appears. At this point, the processing unit for the object expansion related to the subscript evaluation is called, and in other cases, the object expansion processing unit for each instruction is called, so that the object expansion order is as shown in FIG. It becomes the order of the sequence of the intermediate text. Therefore, if the subscript and the evaluation time are only once at the beginning of the execution of the instruction, such as the above-mentioned character string manipulation type instruction, if the above processing units are unconditionally called, the object that does not conform to the standard Will be generated.
上記問題を解決するための手段として,最初に考えられ
るのは,構文解析フェーズが作成する中間テキストの順
序を,命令毎の規格にあったものにすることである。し
かし,命令毎の添字評価時期を意識して中間テキストを
作成するのは,構文解析フェーズの改造が大きく,体系
的な処理が困難であるという問題がある。As a means for solving the above problem, the first conceivable solution is to make the order of the intermediate texts created by the parsing phase conform to the standard for each instruction. However, creating an intermediate text in consideration of the subscript evaluation time for each instruction has a problem in that the parsing phase is greatly modified and systematic processing is difficult.
次に,コード生成フェーズにおいて,文字列操作系命令
が出現した場合のみを特別に意識して処理することが考
えられる。この場合,メインの処理部だけでなく,添字
評価に関するオブジェクト展開のための処理部も,特別
に文字列操作系命令を意識しなければならないし,その
他の命令では,メインの処理部が中間テキスト入力およ
び添字評価に関するオブジェクト展開の処理をしてか
ら,命令別の処理部を呼び出すのに対して,文字列操作
系命令においては,その処理部が中間テキストの入力か
ら添字評価に関するオブジェクト展開までの機能も網羅
しなければならなくなり,処理負担が極めて大きいとい
う問題が発生する。Next, in the code generation phase, it is conceivable to process with special consideration only when a character string manipulation type instruction appears. In this case, not only the main processing unit, but also the processing unit for expanding the object relating to the subscript evaluation must be specially aware of the character string manipulation type command. In other commands, the main processing unit uses the intermediate text. After processing the object expansion related to input and subscript evaluation, the processing unit for each instruction is called, whereas in the character string manipulation type commands, that processing unit performs processing from input of intermediate text to object expansion related to subscript evaluation. The function must be covered, which causes a problem that the processing load is extremely large.
本発明は上記問題点の解決を図り,命令の中で添字付け
されたデータが記述された時点と,添字評価時期が異な
る場合にも,簡単な処理構成で,統一的にオブジェクト
展開を行う手段を提供することを目的としている。The present invention solves the above-mentioned problems, and means for performing uniform object expansion with a simple processing configuration even when the subscript evaluation time is different from the time when the subscripted data is described in the instruction. Is intended to provide.
第1図は本発明の原理ブロック図を示す。 FIG. 1 shows a block diagram of the principle of the present invention.
第1図において,10は高級計算機言語で記述された原始
プログラム,11はCPUおよびメモリなどからなる処理装
置,12は原始プログラム10を機械語コードに翻訳するコ
ンパイラ,13は構文分析フェーズ,14は中間テキスト,15
は中間テキストからオブジェクトのコードを生成するコ
ード生成フェーズ,16は表操作等に用いられる添字を判
定する添字判定部,17は添字のオブジェクトを展開する
添字オブジェクト展開処理部,18は文字列操作系命令の
オブジェクトを展開する文字列操作系命令オブジェクト
展開処理部,19は一般の各命令について命令単位でオブ
ジェクトを展開する他の命令オブジェクト展開処理部,2
0は作業用メモリや外部記憶装置等の作業用テキスト記
憶部,21は1つの命令の終了を判定する命令終了判定部,
22は中間テキストを作業用テキスト記憶部に書き出す中
間テキスト書き出し部,23は作業用テキスト記憶部20か
ら読み込んでオブジェクト展開を行うオブジェクト展開
部,24は翻訳結果であるオブジェクトのコードが格納さ
れるオブジェクトモジュールを表す。In FIG. 1, 10 is a source program written in a high-level computer language, 11 is a processing unit consisting of a CPU and memory, 12 is a compiler that translates the source program 10 into machine language code, 13 is a syntax analysis phase, and 14 is Intermediate text, 15
Is a code generation phase that generates an object code from intermediate text, 16 is a subscript determination unit that determines subscripts used for table operations, 17 is a subscript object expansion processing unit that expands subscript objects, and 18 is a character string operation system A character string operation type instruction object expansion processing unit that expands an instruction object, 19 is another instruction object expansion processing unit that expands an object for each general instruction in units of instructions, 2
0 is a work text storage unit such as a work memory or an external storage device, 21 is an instruction end determination unit that determines the end of one instruction,
22 is an intermediate text writing unit that writes the intermediate text to the working text storage unit, 23 is an object expansion unit that reads the object from the working text storage unit 20 and expands the object, and 24 is an object that stores the code of the object that is the translation result Represents a module.
本発明では,文字列操作系命令に現れる添字について,
命令の最初に1回だけ評価することを実現するため,次
のような処理が行われる。In the present invention, regarding subscripts appearing in character string manipulation commands,
In order to realize the evaluation only once at the beginning of the instruction, the following processing is performed.
構文解析フェーズ13は,原始プログラム10を読み込ん
で,文法上のエラーチェック等を行いながら,解析結果
を内部コードである中間テキスト14として出力する。こ
の処理は,従来と同様である。In the syntax analysis phase 13, the source program 10 is read, and the analysis result is output as an intermediate text 14, which is an internal code, while checking the syntax and the like. This process is similar to the conventional one.
コード生成フェーズ15は,中間テキスト14を読み込んで
オブジェクトモジュール24を出力する。この際,読み込
んだ中間テキスト14が,添字に関するものであれば,添
字判定部16による判定によって,添字オブジェクト展開
処理部17が起動され,添字オブジェクト展開処理部17
は,添字を評価する機械語コードをオブジェクトモジュ
ール24に出力する。添字以外の場合には,各命令単位の
オブジェクト展開を行うサブルーチンによって構成され
る命令オブジェクト展開処理部が呼び出されるが,特に
文字列操作系命令に関するものである場合には,文字列
操作系命令オブジェクト展開処理部18が呼び出される。The code generation phase 15 reads the intermediate text 14 and outputs the object module 24. At this time, if the read intermediate text 14 is related to the subscript, the subscript determination unit 16 determines that the subscript object expansion processing unit 17 is activated and the subscript object expansion processing unit 17 is executed.
Outputs the machine language code for evaluating the subscript to the object module 24. If it is not a subscript, the instruction object expansion processing unit that is composed of a subroutine that expands the object for each instruction is called, but if it is related to a character string operation type instruction, it is a character string operation type instruction object. The expansion processing unit 18 is called.
文字列操作系命令オブジェクト展開処理部18は,命令終
了判定部21によって,文字列操作系命令の終了が判定さ
れるまで,中間テキスト書き出し部22を呼び出し,中間
テキスト14と順次作業用テキスト記憶部20に出力する。
作業用テキスト記憶部20には,添字に関するもの以外の
中間テキストが一時的に格納されることになる。命令終
了判定部21によって,命令の終了が検出されると,オブ
ジェクト展開部23が呼び出され,オブジェクト展開部23
は,作業用テキスト記憶部20から順次中間テキストを読
み込んで,それをオブジェクトに展開し,オブジェクト
モジュール24に出力する。The character string manipulation type instruction object expansion processing unit 18 calls the intermediate text writing unit 22 until the command end determination unit 21 determines the end of the character string manipulation type command, and sequentially stores the intermediate text 14 and the working text storage unit. Output to 20.
The work text storage unit 20 temporarily stores intermediate texts other than those related to subscripts. When the instruction end determination unit 21 detects the end of the instruction, the object expansion unit 23 is called and the object expansion unit 23
Reads the intermediate text sequentially from the work text storage unit 20, develops it into an object, and outputs it to the object module 24.
本発明によれば,添字の評価時期が中間テキスト14の並
びの順でいいものについては,従来と同様に順番にオブ
ジェクト展開がなされる。例えば,ANS COBOL 1985の
規格における文字列操作系命令のように,添字評価時期
が命令の最初でなければならないものについては,添字
が出現したときに,添字オブジェクト展開処理部17によ
って,直ちにオブジェクトモジュール24への出力が行わ
れるが,それ以外の文字列操作系命令の途中の中間テキ
ストは,作業用テキスト記憶部20に書き出され,文字列
操作系命令の中間テキストが終了したときに,改めて,
作業用テキスト記憶部20からの読み込みによって,オブ
ジェクト展開がなされる。従って,従来の処理構成を大
幅に変更することなく,添字評価時期を中間テキストの
並びにかかからず,命令の最初とすることができる。According to the present invention, if the evaluation time of the subscript is good in the order of the arrangement of the intermediate text 14, the object expansion is performed in order as in the conventional case. For example, for a character string manipulation instruction in the ANS COBOL 1985 standard, when the subscript evaluation time must be the first of the instruction, the subscript object expansion processing unit 17 immediately causes the object module Although the output to 24 is performed, the intermediate text in the middle of the other character string manipulation commands is written to the work text storage unit 20 and is restarted when the intermediate text of the character string manipulation commands is completed. ,
Objects are expanded by reading from the work text storage unit 20. Therefore, it is possible to set the subscript evaluation time to the beginning of the instruction without the intermediate text being arranged, without significantly changing the conventional processing configuration.
第2図は本発明の一実施例に係るコード生成フェーズ処
理説明図,第3図は本発明の一実施例に係る文字列操作
系命令オブジェクト展開処理説明図,第4図は本発明の
一実施例説明図である。FIG. 2 is an explanatory diagram of a code generation phase process according to an embodiment of the present invention, FIG. 3 is an explanatory diagram of a character string operation type instruction object expansion process according to an embodiment of the present invention, and FIG. It is an explanatory view of an example.
第1図に示すコード生成フェーズ15の処理概要は,例え
ば第2図に示すようになっている。以下の説明における
番号〜は,第2図に示す処理に対応する。An outline of the process of the code generation phase 15 shown in FIG. 1 is as shown in FIG. 2, for example. The numbers 1 to 4 in the following description correspond to the processes shown in FIG.
中間テキストを1レコードずつ読む。 Read the intermediate text one record at a time.
読むべき中間テキストがなくなった場合,処理を終
了する。When there are no more intermediate texts to read, the process ends.
読み込んだ中間テキストのレコードが,添字に関す
るものであるか否かを判定する。添字である場合,処理
を実行し,添字でない場合,処理を実行する。It is determined whether the read intermediate text record is related to a subscript. If it is a subscript, the process is executed. If it is not a subscript, the process is executed.
添字を評価するオブジェクトを展開する。その後,
処理へ制御を戻して同様に処理を繰り返す。Expand the object whose subscript is evaluated. afterwards,
The control is returned to the processing and the processing is repeated in the same manner.
各命令単位に用意されたオブジェクト展開処理部を
呼び出し,それぞれオブジェクト展開を行う。その後,
処理へ制御を戻す。The object expansion processing unit prepared for each instruction is called and the object is expanded respectively. afterwards,
Return control to processing.
第1図に示す文字列操作系命令オブジェクト展開処理部
18は,例えば第3図に示すように処理する。この処理
は,前述した第2図に示す処理の1つである。以下の
説明における番号〜は,第3図に示す処理〜に
対応する。Character string manipulation instruction object expansion processing unit shown in FIG.
18 is processed as shown in FIG. 3, for example. This process is one of the processes shown in FIG. 2 described above. The numbers ~ in the following description correspond to the processes ~ shown in Fig. 3.
中間テキストの並びが終了したか否かを判定する。
終了した場合,処理へ制御を移す。It is determined whether the arrangement of the intermediate text is completed.
When finished, transfer control to processing.
終了でない場合,第1図に示す作業用テキスト記憶
部20に,中間テキストのレコードをそのまま出力する。
その後,次の中間テキストを読み込むため,呼び出し元
へ制御を戻す。If it is not finished, the intermediate text record is output as it is to the work text storage section 20 shown in FIG.
It then returns control to the caller to read the next intermediate text.
中間テキストの並びが終了した場合,上記処理で
書き出しておいた中間テキストを,作業用テキスト記憶
部20から1レコードずつ読む。When the arrangement of the intermediate texts is completed, the intermediate texts written in the above process are read from the work text storage unit 20 one record at a time.
作業用テキスト記憶部20におけるテキストの終了を
判定し,テキストがなくなった場合,次の命令の処理の
ために制御を呼び出し元へ戻す。The end of the text in the working text storage unit 20 is determined, and when there is no more text, control is returned to the calling source for processing the next instruction.
作業用テキスト記憶部20から読み込んだ中間テキス
トについて,文字列操作系命令のオブジェクトを展開す
る。その後,処理へ制御を戻し,同様に処理を繰り返
す。With respect to the intermediate text read from the work text storage unit 20, the object of the character string manipulation type instruction is expanded. After that, the control is returned to the process, and the process is repeated.
次に,第4図に従って,簡単な具体例を説明する。な
お,この例は,添字評価が命令の最初でなくても,結果
的には同様になるが,添字評価の時期を命令の実行の最
初に行わなければならない例として説明する。Next, a simple concrete example will be described with reference to FIG. Note that this example will be the same even if the subscript evaluation is not at the beginning of the instruction, but the subscript evaluation will be described as an example that must be performed at the beginning of execution of the instruction.
第4図に示す原始プログラム10中の文字列操作系命令
は,いわゆるANS COBOL 1985の規格によるSTRING命令
であって,データ名がそれぞれA,B,Cのデータを係合し
て,データ名D(A)に作用結果を転記することを指示
する命令である。構文解析フェーズ13による解析によ
り,中間テキスト14が出力される。中間テキスト14にお
いて,「BEGIN」は命令の開始,「STR1」,「STR2」は
文字列操作系命令の詳細コード,「INDEX」は添字,「E
ND」は命令の終了を表す。The character string manipulation instruction in the source program 10 shown in FIG. 4 is a so-called STRING instruction according to the standard of ANS COBOL 1985, and data names A, B, and C are engaged, and a data name D is obtained. It is an instruction to instruct (A) to transcribe the operation result. The intermediate text 14 is output by the analysis in the syntax analysis phase 13. In the intermediate text 14, “BEGIN” is the start of the instruction, “STR1” and “STR2” are the detailed codes of the character string manipulation instructions, “INDEX” is the subscript, and “E”.
"ND" indicates the end of the instruction.
コード生成フェーズ15では,中間テキスト14から順次,1
レコードずつ読み込み,(1)〜(3)および(5)の
ように,添字に関するもの以外のレコードを,作業用フ
ァイル40に書き出す。「INDEX」については,(4)の
ように,直ちに添字評価用のコードが生成され,オブジ
ェクトモジュール24に出力される。In the code generation phase 15, the intermediate text 14
Each record is read, and records other than those relating to subscripts are written to the work file 40 as in (1) to (3) and (5). As for (INDEX), a code for subscript evaluation is immediately generated and output to the object module 24 as in (4).
「END」により命令の終了が検出されると,(6)のよ
うに,作業用ファイル40から中間テキストを1レコード
ずつ読み込み,オブジェクト展開をして,結果をオブジ
ェクトモジュール24に出力する。When the end of the instruction is detected by "END", as shown in (6), the intermediate text is read record by record from the work file 40, the object is expanded, and the result is output to the object module 24.
なお,文字列操作系命令として,STRING命令以外に,文
字列を分解するUNSTRING命令や,文字列の置換,文字数
のカウント等を行うINSPECT命令についても,同様に添
字評価を命令の最初に行う。In addition to the STRING instruction, the UNSTRING instruction that decomposes a character string and the INSPECT instruction that replaces a character string and counts the number of characters are also used as character string manipulation-related instructions at the beginning of the instruction.
以上説明したように,本発明によれば,命令の中で添字
付けされたデータが記述された時点と,添字評価時期が
異なる場合にも,簡単な処理構成で,統一的にオブジェ
クト展開を行うことが可能になる。As described above, according to the present invention, even when the subscripted data is described in an instruction and the subscript evaluation time is different, the object expansion is performed uniformly by a simple processing configuration. It will be possible.
第1図は本発明の原理ブロック図,第2図は本発明の一
実施例に係るコード生成フェーズ処理説明図,第3図は
本発明の一実施例に係る文字列操作系命令オブジェクト
展開処理説明図,第4図は本発明の一実施例説明図,第
5図は従来方式の問題点説明図である。 図中,10は原始プログラム,11は処理装置,12はコンパイ
ラ,13は構文解析フェーズ,14は中間テキスト,15はコー
ド生成フェーズ,16は添字判定部,17は添字オブジェクト
展開処理部,18は文字列操作系命令オブジェクト展開処
理部,19は他の命令オブジェクト展開処理部,20は作業用
テキスト記憶部,21は命令終了判定部,22は中間テキスト
書き出し部,23はオブジェクト展開部,24はオブジェクト
モジュールを表す。FIG. 1 is a block diagram of the principle of the present invention, FIG. 2 is an explanatory diagram of a code generation phase process according to an embodiment of the present invention, and FIG. 3 is a character string operation type instruction object expansion process according to an embodiment of the present invention. FIG. 4 is an explanatory view of an embodiment of the present invention, and FIG. 5 is an explanatory view of problems in the conventional method. In the figure, 10 is a source program, 11 is a processing device, 12 is a compiler, 13 is a syntax analysis phase, 14 is an intermediate text, 15 is a code generation phase, 16 is a subscript determination unit, 17 is a subscript object expansion processing unit, and 18 is Character string operation type instruction object expansion processing unit, 19 is another instruction object expansion processing unit, 20 is a work text storage unit, 21 is an instruction end determination unit, 22 is an intermediate text writing unit, 23 is an object expansion unit, and 24 is Represents an object module.
Claims (1)
規定された文字列操作系命令の仕様を有する原始プログ
ラムのコンパイル処理方式であって,構文解析フェーズ
により生成された中間テキストを,コード生成フェーズ
においてオブジェクトに展開するコンパイル処理方式に
おいて, 上記中間テキストが一時的に格納される作業用テキスト
記憶部(20)と, 上記コード生成フェーズにおける中間テキストの読み込
み時に,読み込んだ中間テキストが添字に関するもので
あるか否かを判定する添字判定手段(16)と, 読み込んだ中間テキストが添字である場合に,添字に関
するオブジェクト展開を行う添字オブジェクト展開処理
手段(17)と, 読み込んだ中間テキストが添字以外の上記文字列操作系
命令に関するものである場合に,その命令に関する中間
テキストの並びが終了するまで,その読み込んだ中間テ
キストを上記作業用テキスト記憶部に書き出すと共に,
その命令に関する中間テキストの並びが終了した場合
に,上記作業用テキスト記憶部から中間テキストを順次
読み込み,文字列操作系命令に関するオブジェクト展開
を行う文字列操作系命令オブジェクト展開処理手段(1
8)とを備えたことを特徴とする文字列操作系命令コン
パイル処理方式。1. A compile processing method of a source program having a specification of a character string manipulation type instruction specified to perform subscript evaluation at the beginning of instruction execution, wherein an intermediate text generated by a syntax analysis phase is In the compile processing method that expands to an object in the code generation phase, the work text storage unit (20) in which the above intermediate text is temporarily stored, and the intermediate text read when the intermediate text is read in the above code generation phase are subscripted. The subscript determination means (16) for determining whether or not it is related to the subscript, and the subscript object expansion processing means (17) for expanding the object regarding the subscript when the read intermediate text is a subscript, and the read intermediate text If it is related to the above string manipulation commands other than the subscript, the command The read intermediate text is written in the working text memory until the arrangement of the intermediate texts related to the command is completed, and
When the arrangement of the intermediate texts related to the command is completed, the intermediate texts are sequentially read from the work text storage unit and the object expansion related to the character string operation related command is executed.
8) A character string manipulation instruction compile processing method characterized by having and.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10396887A JPH0690669B2 (en) | 1987-04-27 | 1987-04-27 | Character string manipulation instruction compilation processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10396887A JPH0690669B2 (en) | 1987-04-27 | 1987-04-27 | Character string manipulation instruction compilation processing method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63269229A JPS63269229A (en) | 1988-11-07 |
| JPH0690669B2 true JPH0690669B2 (en) | 1994-11-14 |
Family
ID=14368155
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10396887A Expired - Fee Related JPH0690669B2 (en) | 1987-04-27 | 1987-04-27 | Character string manipulation instruction compilation processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0690669B2 (en) |
-
1987
- 1987-04-27 JP JP10396887A patent/JPH0690669B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63269229A (en) | 1988-11-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0630066B2 (en) | Table type language translation method | |
| JPH0690669B2 (en) | Character string manipulation instruction compilation processing method | |
| JPH11154093A (en) | Program Compiler and Recording Medium Recording Compiler Program | |
| JPS5846439A (en) | Program editing method of computer | |
| JP2827724B2 (en) | Program debug processing method | |
| JP2764782B2 (en) | Data structure expansion method for COBOL programs | |
| JP2000181691A (en) | Program structure analysis system | |
| JPS6367695B2 (en) | ||
| JP2590083B2 (en) | Source program translation processing method | |
| KR100229567B1 (en) | Coordination and text value generation method | |
| JP3240647B2 (en) | Computer language structured processing | |
| JPS59231649A (en) | Output processing system for compiled program list | |
| JPH05143354A (en) | Text file conversion system | |
| JPH03186933A (en) | Symbol processing system for language processing system | |
| JPH04270422A (en) | Precompile processing system | |
| JPH0334029A (en) | Designating system for input/output of index | |
| JPH0358135A (en) | Output method for text modifying plural operands | |
| JPH0535497A (en) | Realization system for logical language | |
| JPH0778100A (en) | Data conversion processor | |
| Hoadley et al. | A remote assembler for PDP-8 programs | |
| JPH02178845A (en) | Precompiling system for data base operation language | |
| JPH04209029A (en) | Parallel process program translation processor | |
| JPS61206041A (en) | Extension method for program language | |
| JPH0495139A (en) | Cross reference output system for language processing program | |
| JPH02207343A (en) | debug equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |