JPH0126090B2 - - Google Patents

Info

Publication number
JPH0126090B2
JPH0126090B2 JP15644981A JP15644981A JPH0126090B2 JP H0126090 B2 JPH0126090 B2 JP H0126090B2 JP 15644981 A JP15644981 A JP 15644981A JP 15644981 A JP15644981 A JP 15644981A JP H0126090 B2 JPH0126090 B2 JP H0126090B2
Authority
JP
Japan
Prior art keywords
character
compiler
record
source program
byte position
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
Application number
JP15644981A
Other languages
Japanese (ja)
Other versions
JPS5858655A (en
Inventor
Fumio Sugimoto
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP15644981A priority Critical patent/JPS5858655A/en
Publication of JPS5858655A publication Critical patent/JPS5858655A/en
Publication of JPH0126090B2 publication Critical patent/JPH0126090B2/ja
Granted legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 本発明は、コンパイラにおける文字分析処理を
高速で行い得るようにした文字分析方式に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a character analysis method that enables a compiler to perform character analysis processing at high speed.

第1図はコンパイラ・システムの概要を示すも
のであつて、1は紙テープ、2は紙カード、3は
磁気テープ、4は磁気デイスク、5は読込装置、
6はシステム空間、7は処理プロ・コンパイラ、
8は作業用フアイル、9は結果フアイル、10は
出力装置、11はLPリスト、12は磁気テープ、
13は磁気デイスクをそれぞれ示している。ソー
ス・プログラムは、紙テープ1や紙カード2、磁
気テープ3、磁気デイスク4などの入力記録媒体
に書込まれている。
Figure 1 shows an overview of the compiler system, in which 1 is a paper tape, 2 is a paper card, 3 is a magnetic tape, 4 is a magnetic disk, 5 is a reading device,
6 is the system space, 7 is the processing professional compiler,
8 is a work file, 9 is a result file, 10 is an output device, 11 is an LP list, 12 is a magnetic tape,
Reference numeral 13 indicates a magnetic disk. A source program is written on an input recording medium such as a paper tape 1, a paper card 2, a magnetic tape 3, or a magnetic disk 4.

これらの入力記録媒体に記録されているソー
ス・プログラムは読込装置5によつてシステム空
間6(コンパイラに割当てられたメモリ空間)に
読込まれ、コンパイラ7によつて処理される。コ
ンパイラ7は、ソース・プログラムの文字列の解
析、構文解析、最適化およびオブジエクト・コー
ドの生成などを行う。作業フアイル8は、コンパ
イル過程における中間結果を一時的に格納するも
のである。コンパイラ7によつて生成されたオブ
ジエクト・コードは結果フアイル9に書込まれ、
ソース・プログラムのオブジエクト・プログラム
への変換が全て完了した後、結果フアイル9の内
容は出力装置10によつてLPリスト11又は磁
気テープ12又は磁気デイスク13に出力され
る。
The source programs recorded on these input recording media are read into the system space 6 (memory space allocated to the compiler) by the reading device 5 and processed by the compiler 7. The compiler 7 performs character string analysis, syntax analysis, optimization, and object code generation of the source program. The work file 8 is used to temporarily store intermediate results in the compilation process. The object code generated by the compiler 7 is written to a result file 9,
After the conversion of the source program into the object program is completely completed, the contents of the result file 9 are outputted to the LP list 11, the magnetic tape 12, or the magnetic disk 13 by the output device 10.

第2図は従来の文字分析方式を説明するもので
ある。先ず、文字分析の対象となる1レコード分
の文字列を取出す。そしてこのレコード上の1文
字を読み文字分析を行い、その文字の種類を決定
する。例えばその文字が英字であれば英字の処理
を行い、数字であれば数字の処理を行い、演算子
であれば演算子の処理を行い、区切文字であれば
区切文字の処理を行う。各文字の処理部はその文
字が第幾番目の文字であるかのチエツクをも行
い、区切文字の後に文字が検出された場合にはエ
ラーとする。1文字についての文字の処理を行つ
た後、レコードから読出すべきバイト位置を次に
進め、レコードが終了したか否かを調べる。Yes
の場合には終了として次のレコードを取出し、
NOの場合には次の文字についての文字分析を行
う。
FIG. 2 explains a conventional character analysis method. First, a character string for one record to be subjected to character analysis is extracted. Then, each character on this record is read and character analysis is performed to determine the type of character. For example, if the character is an alphabetic character, the alphabetic character is processed, if the character is a number, the numeric character is processed, if the character is an operator, the operator is processed, and if the character is a delimiter, the delimiter is processed. The processing unit for each character also checks what number the character is, and if a character is detected after the delimiter, an error occurs. After character processing is performed for one character, the byte position to be read from the record is advanced to the next byte position, and it is checked whether the record has ended. Yes
In this case, fetch the next record as the end,
If NO, perform character analysis on the next character.

第2図に示すような文字分析方式は、nバイト
のレコードを1バイト目からnバイト目まで1バ
イトずつ全てチエツクしており、このためIOア
クセス回数が増加すること、作業領域が大きくな
ること、および処理ステツプ数が大きくなること
等の欠点を有しており、さらに、データ対応の処
理が複雑となるので、バクが発生し易いという欠
点が存在する。
The character analysis method shown in Figure 2 checks every byte of an n-byte record from the 1st byte to the nth byte, which increases the number of IO accesses and increases the work area. , and the number of processing steps becomes large.Furthermore, since data handling becomes complicated, bugs are likely to occur.

本発明は、上記の欠点を除去するものであつ
て、コンパイラにおける文字分析を効率的に行い
得るようになつた文字分析方式を提供することを
目的としている。そしてそのため、本発明の文字
分析方式は、ソース・プログラムを読込む読込装
置と、読込んだソース・プログラムをオブジエク
ト・プログラムに変換するコンパイラ作成用プロ
セツサと、該コンパイラ作成用プロセツサによつ
て作成されたオブジエクト・プログラムを出力す
る出力装置とを備え、上記コンパイラ作成用プロ
セツサは、読込まれたソース・プログラムからデ
ータを1レコードずつ取出し、取出したレコード
を構成する文字を分析するように構成されている
コンパイラ・システムにおいて、文字分析処理を
行う際、区切文字が検出された場合には次のバイ
ト位置からレコードの最後のバイト位置までのデ
ータを正常予想パターンと比較することを特徴と
するものである。以下、本発明を図面を参照しつ
つ説明する。
The present invention aims to eliminate the above-mentioned drawbacks and to provide a character analysis method that enables a compiler to efficiently perform character analysis. Therefore, the character analysis method of the present invention includes a reading device that reads a source program, a processor for creating a compiler that converts the read source program into an object program, and a processor for creating an object program. and an output device for outputting a read object program, and the compiler creation processor is configured to extract data one record at a time from the read source program and analyze characters constituting the extracted records. In the compiler system, when performing character analysis processing, if a delimiter is detected, the data from the next byte position to the last byte position of the record is compared with a normal expected pattern. . Hereinafter, the present invention will be explained with reference to the drawings.

第3図は本発明の1実施例を説明するものであ
る。第3図において、xは区切文字の検出バイト
位置を示している。先ず、1レコード分の文字列
を取出す。そして、このレコード上の1文字を読
み、文字分析を行い、その文字の種類を決定す
る。その文字が英字の場合には第2図に示すよう
に英字の処理を行い、数字であれば数字の処理を
行い、演算子の場合には演算子の処理を行う。し
かし、本発明の場合には、各文字の処理部はその
文字が第幾番目の文字であるかをチエツクする必
要がない。文字処理を行つた後、レコードから読
出すバイト位置を次に進め、レコード終了である
か否かを調べる。Yesの場合には終了とし、NO
の場合には次の文字の分析を行う。文字の分析結
果が区切文字の場合には、レコード上のx+1バ
イト目からnバイト目までのデータを(n−x+
1)ビツトがオール「0」の空白パターンと比較
する。nビツトの空白パターンが予め準備されて
おり、このnビツトの空白パターンから(n−x
+1)ビツトの空白パターンが切出される。区切
文字の次の位置から最後の位置までのデータと
(n−x+1)ビツトの空白パターンとを比較し、
一致すれば終了として次のレコードを取出し、不
一致であればエラー表示を行う。
FIG. 3 illustrates one embodiment of the present invention. In FIG. 3, x indicates the detected byte position of the delimiter. First, a character string for one record is extracted. Then, one character on this record is read, character analysis is performed, and the type of the character is determined. If the character is an alphabetic character, the alphabetic character is processed as shown in FIG. 2, if the character is a numeric character, the numeric character is processed, and if the character is an operator, the operator is processed. However, in the case of the present invention, the processing unit for each character does not need to check the number of the character. After character processing is performed, the byte position read from the record is advanced to the next byte position, and it is checked whether the record has ended. If Yes, terminate, NO
In this case, the next character is analyzed. If the character analysis result is a delimiter, the data from the x+1st byte to the nth byte on the record is (n-x+
1) Compare with a blank pattern in which all bits are "0". An n-bit blank pattern is prepared in advance, and from this n-bit blank pattern (n-x
+1) A blank pattern of bits is cut out. Compare the data from the next position of the delimiter to the last position with a blank pattern of (n-x+1) bits,
If they match, the process ends and the next record is retrieved; if they do not match, an error is displayed.

以上の説明から明らかなように、本発明によれ
ば、文字種毎の処理部がその文字が第幾番目のも
のであるかを意識する必要がないので処理が簡単
化されること、データのアクセス回数が減少する
こと、およびダイナミツク・ステツプ数が削減さ
れること等の顕著な作用効果を奏することが出来
る。
As is clear from the above description, according to the present invention, the processing unit for each character type does not need to be aware of the number of the character, so processing is simplified, and data access is simplified. Remarkable effects such as a reduction in the number of steps and a reduction in the number of dynamic steps can be achieved.

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

第1図はコンパイラ・システムの概要を示す
図、第2図は従来の文字分析方式を説明する図、
第3図は本発明の1実施例を説明するものであ
る。 1……紙テープ、2……紙カード、3……磁気
テープ、4……磁気デイスク、5……読込装置、
6……システム空間、7……処理プロ・コンパイ
ラ、8……作業用フアイル、9……結果フアイ
ル、10……出力装置、11……LPリスト、1
2……磁気テープ、13……磁気デイスク。
Figure 1 is a diagram showing an overview of the compiler system, Figure 2 is a diagram explaining the conventional character analysis method,
FIG. 3 illustrates one embodiment of the present invention. 1... paper tape, 2... paper card, 3... magnetic tape, 4... magnetic disk, 5... reading device,
6...System space, 7...Processing professional compiler, 8...Work file, 9...Result file, 10...Output device, 11...LP list, 1
2...magnetic tape, 13...magnetic disk.

Claims (1)

【特許請求の範囲】[Claims] 1 ソース・プログラムを読込む読込装置と、読
込んだソース・プログラムをオブジエクト・プロ
グラムに変換するコンパイラ作成用プロセツサ
と、該コンパイラ作成用プロセツサによつて作成
されたオブジエクト・プログラムを出力する出力
装置とを備え、上記コンパイラ作成用プロセツサ
は、読込まれたソース・プログラムからデータを
1レコードずつ取出し、取出したレコードを構成
する文字を分析するように構成されているコンパ
イラ・システムにおいて、文字分析処理を行う
際、区切文字が検出された場合には次のバイト位
置からレコードの最後のバイト位置までのデータ
を正常予想パターンと比較することを特徴とする
文字分析方式。
1 A reading device that reads a source program, a compiler creation processor that converts the read source program into an object program, and an output device that outputs the object program created by the compiler creation processor. The compiler creation processor extracts data one record at a time from the loaded source program and performs character analysis processing in a compiler system configured to analyze characters constituting the extracted records. A character analysis method that is characterized in that when a delimiter is detected, the data from the next byte position to the last byte position of the record is compared with a normal expected pattern.
JP15644981A 1981-09-30 1981-09-30 Character analyzing system Granted JPS5858655A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15644981A JPS5858655A (en) 1981-09-30 1981-09-30 Character analyzing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15644981A JPS5858655A (en) 1981-09-30 1981-09-30 Character analyzing system

Publications (2)

Publication Number Publication Date
JPS5858655A JPS5858655A (en) 1983-04-07
JPH0126090B2 true JPH0126090B2 (en) 1989-05-22

Family

ID=15627985

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15644981A Granted JPS5858655A (en) 1981-09-30 1981-09-30 Character analyzing system

Country Status (1)

Country Link
JP (1) JPS5858655A (en)

Also Published As

Publication number Publication date
JPS5858655A (en) 1983-04-07

Similar Documents

Publication Publication Date Title
JPS63201834A (en) Generation of object module
JPH0793186A (en) Reusing method for existing test program
JPH0126090B2 (en)
JP2636058B2 (en) A device for converting an assembler source program into a COBOL source program
JP3033091B2 (en) Automatic translation method from digital circuit data to logic simulation description language
JP2721377B2 (en) BASIC program compression method
JPS60122435A (en) Memory damp system
JP3466792B2 (en) Drawing search method and apparatus
JPH1165837A (en) Data exception detecting method for external file data and storage medium where data exception detection program for external file data is recorded
JP2604551B2 (en) File dump output support method
JPH04178829A (en) File definition information editing system in load module
JPH0350293B2 (en)
JP2990200B2 (en) Object creation method
JP2500385B2 (en) Input data management method
JP3394879B2 (en) Data recording medium conversion processing method and apparatus
JPH0118514B2 (en)
JPH0756632B2 (en) Assembler instruction boundary error detection processing method
EP0369027A1 (en) Rom writing apparatus
JPH0667942A (en) Log extraction system
JPS5862743A (en) Recording system including software change
JPH0833858B2 (en) Data base file withdrawal method
JPH11282691A (en) Software development system
JPH0237428A (en) Replacement processing system at the time of developing library
JPH0267636A (en) Program execution procedure file converting system
JPH03139719A (en) Installation verification system for program