[go: up one dir, main page]

JPH021027A - Compiling system for compressed source program - Google Patents

Compiling system for compressed source program

Info

Publication number
JPH021027A
JPH021027A JP63128373A JP12837388A JPH021027A JP H021027 A JPH021027 A JP H021027A JP 63128373 A JP63128373 A JP 63128373A JP 12837388 A JP12837388 A JP 12837388A JP H021027 A JPH021027 A JP H021027A
Authority
JP
Japan
Prior art keywords
source program
blank
character
compressed source
input
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
JP63128373A
Other languages
Japanese (ja)
Inventor
Shinichi Shoji
荘司 信一
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP63128373A priority Critical patent/JPH021027A/en
Publication of JPH021027A publication Critical patent/JPH021027A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To shorten the compiling time by directly taking a compressed source program as the object of word and phrase analysis without decoding (expanding) this program and increasing the skip read speed of blank characters. CONSTITUTION:The compressed source program includes an 8-bit control code, and upper four bits indicate the number of characters other than blacks, and lower four bits indicate the number of following blank characters. On the compiler side, a blank is handled as a delimiter character, and one blank as well as continuous blanks have the same function. Consequently, a blank skip read processing part is provided before a word and phrase analyzing part of the compiler to skip over excess blanks at the time of reading, and at this time, a one-character input part is executed for each one character. Thus, 10 continuous blanks are substituted with the one-byte control code in the system where the compressed source program is directly taken as the object of word and phrase analysis (one-character input), and it is sufficient if the one-character input part 5 is executed once, and the compiling time is shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は圧縮形式ソースプログラムのコンパイル方式に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for compiling compressed source programs.

〔従来の技術〕[Conventional technology]

空白文字の読とばしによる字句解析の効率化に関しては
特開昭58−58655号がある。この方式はソース中
の区切文字の後が全て空白かをチエツクするものである
(全て空白でない場合はエラーとする)。したがって−
行に複数の文字が書ける最近の高級言語には適用できな
い。
Regarding improving the efficiency of lexical analysis by skipping blank characters, there is Japanese Patent Application Laid-Open No. 58-58655. This method checks whether all spaces after the delimiter in the source are blank (an error occurs if there are no blanks). Therefore-
It cannot be applied to modern high-level languages where multiple characters can be written on a line.

他にコンパイル時間を短縮する方式として特開昭58−
168153号がある。これは共通ソースを中間テキス
トとして登録しておく方式であり、共通ソースにしか効
果がない。
Another method for shortening compilation time is JP-A-58-
There is No. 168153. This is a method in which the common source is registered as intermediate text, and is effective only for the common source.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上記従来技術ではフリーフォーマットで書ける(−行に
複数の文が書ける)最近の高級言語には適用できないと
いう問題があった。
The problem with the above-mentioned prior art is that it cannot be applied to recent high-level languages that can be written in a free format (multiple sentences can be written on a - line).

また共通ソース以外の部分のソース解析には効果がない
という問題があった。
Another problem is that source analysis of parts other than the common source is ineffective.

本発明の目的はソースプロクラムの圧縮形式を利用する
ことにより、言語種別にかかわらず、また、共通ソース
か否かによらず字句解析を高速化し、コンパイル時間を
短縮させることを目的とする。
An object of the present invention is to speed up lexical analysis and shorten compile time, regardless of the language type or whether or not the source program is a common source, by using a compressed format of the source program.

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

上記目的は圧縮形式のソースプログラムをデコー1−(
伸長)せずに直接字句解析の対象とし、空白文字の読み
とばしを高速化することにより、達1戊される。
The above purpose is to decode a compressed source program (1-(
This can be achieved by making it a target of lexical analysis directly without decompression (expansion) and speeding up the reading of blank characters.

〔作用〕[Effect]

圧縮形式のソースプログラムでは連続する空白が1〜2
バイト程度に圧縮されている。(圧縮方式により異なる
) これを直接字句解析の入力とすることにより、連続する
n文字の空白の読みとばしは圧縮された1〜2バイトの
データの読みとばしで済む。このため空白の読みとげし
か高速化されコンパイル効率が向上する。
In a compressed source program, there are 1 or 2 consecutive spaces.
Compressed to about bytes. (Differs depending on the compression method) By directly using this as an input for lexical analysis, reading the blank space of n consecutive characters can be done by reading the compressed 1-2 byte data. This speeds up only the reading of blank spaces, improving compilation efficiency.

〔実施例〕〔Example〕

以下図面を参照して本発明の一実施例について説明する
An embodiment of the present invention will be described below with reference to the drawings.

まず第1図を用いて全体構成について説明する。First, the overall configuration will be explained using FIG. 1.

コンパイラ1は大きく分けると構文解析部3とコード生
成部10からなり、ソースファイル2からソースプログ
ラムを入力し、オブジェクトファイル11にオブジェク
トプログラム、リスト出力装置9にコンパイルリストを
出力する。この時ソースファイル2中のソースプログラ
ムはスペース効率向上のために圧縮形式となっている。
The compiler 1 is broadly divided into a syntax analysis section 3 and a code generation section 10, which inputs a source program from a source file 2, outputs an object program to an object file 11, and outputs a compilation list to a list output device 9. At this time, the source program in the source file 2 is in a compressed format to improve space efficiency.

字句解析部4は構文解析部3からサブルーチンとして呼
び出され、ソースプログラムの中からコンパイラにとっ
て意味のある文字の集合(名前。
The lexical analyzer 4 is called as a subroutine by the syntax analyzer 3 and extracts a set of characters (names) that are meaningful to the compiler from the source program.

演算記号2区切り記号など)の切出しを行う。(operation symbol, 2 delimiter symbol, etc.).

1文字人力部5は字句解析部4の一部であり、ソースプ
ログラムの1文字を入力バッファ7がら入力する。また
ソースプログラムのルコード分の処理を終了するとソー
ス入力部6を呼び出し次のレコードをソースファイル2
から圧縮形式のまま人力バッファ7に入力する。
The one-character human input section 5 is a part of the lexical analysis section 4, and inputs one character of the source program from the input buffer 7. Also, when the processing for the source program code is completed, the source input unit 6 is called and the next record is input to the source file 2.
The data is input into the manual buffer 7 in compressed format.

また構文解析部3はソース伸長部8を呼び出して入力バ
ッファ7中の圧縮形式のソースプロクラムを伸長(デコ
ード)シ、コンパイルリストとしてリスト出力装置9に
出力する。
The syntax analysis section 3 also calls the source decompression section 8, decompresses (decodes) the compressed source program in the input buffer 7, and outputs it to the list output device 9 as a compilation list.

次に本発明の中心的な部分である字句解析部4及び−文
字入力部5の動作について説明する。
Next, the operations of the lexical analysis section 4 and the -character input section 5, which are the central parts of the present invention, will be explained.

まず1文字入力部5が入力する圧縮形式ソースプログラ
ム21の形式を第2図に示す。この形式ではソースプロ
グラム中に1バイト(8ビツト)の制御コードをもち、
制御コードの上4ビットがスペース(空白)以外の文字
数、下4ビットがそれに続くスペースの文字数を示して
いる。
First, the format of the compressed source program 21 input by the single character input section 5 is shown in FIG. This format has a 1-byte (8-bit) control code in the source program,
The upper 4 bits of the control code indicate the number of characters other than spaces (blanks), and the lower 4 bits indicate the number of spaces following the control code.

コンパイラにとってスペース(空白)は区切り文字とな
るが連続したスペースでも1文字のスペースでも区切り
文字としての役割は同じである。
To the compiler, a space (blank) is a delimiter, but consecutive spaces or single-character spaces have the same role as delimiters.

このためコンパイラの字句解析部4は第3図に示すよう
に字句解析処理の先頭にスペース読とばし処理部41を
もち、余分なスペースを読み飛ばしており、この時1文
字人力部5が1文字ごとに実行される。
For this reason, the lexical analysis unit 4 of the compiler has a space skipping processing unit 41 at the beginning of the lexical analysis process, as shown in FIG. executed every time.

従来の方式ではソース入力時に圧縮形式を元の状態に戻
しているため、入力バッファ7には圧縮されていないソ
ースプログラムが人力されている。
In the conventional method, the compression format is returned to its original state when the source is input, so that the input buffer 7 is manually inputted with an uncompressed source program.

このためもしソースプログラム中に連続した10文字の
スペースがあった場合1文字入力部5は10回実行され
ることになる。
Therefore, if there is a space of 10 consecutive characters in the source program, the 1-character input section 5 will be executed 10 times.

しかし本発明の圧縮形式ソースプログラムを直接字句解
析(1文字入力)の対象とする方式では連続した10個
のスペースも1バイトの制御コードに置換えられている
ため、1文字人力部5は1同突行するだけで済む。
However, in the method of the present invention in which the compressed source program is subject to direct lexical analysis (one character input), ten consecutive spaces are also replaced with one byte control code, so the one character human power section 5 is All you have to do is rush forward.

圧縮形式ソースプログラムに対する1文字入力部5の処
理概要を第4図に示す。1文字入力部5は有効文字カウ
ンタ51.カレントポインタ52゜入力文字バッファ5
3を持つ。有効文字カウンタ51は人力バッファ7中の
制御コードの上4ビットであるスペース以外の文字数を
初期値として持つ。カレントポインタ52は入カバッフ
ァフ中の現在入力中の位置を示す。入力文字バッファ5
3は入力した1文字を設定する領域である。
FIG. 4 shows an outline of the processing of the single character input unit 5 for the compressed source program. The single character input section 5 has a valid character counter 51. Current pointer 52° input character buffer 5
Has 3. The effective character counter 51 has as an initial value the number of characters other than spaces, which are the upper 4 bits of the control code in the manual buffer 7. A current pointer 52 indicates the position in the input buffer that is currently being input. Input character buffer 5
3 is an area where one input character is set.

1文字入力部5ではまず有効文字カウンタ51が正かチ
エツクし、正の場合は入カバッファフのカレントポイン
タ52の示す位置から1文字入力し、入力文字バッファ
53に設定する。次に有効文字カウンタ51から1減じ
る。
The single character input section 5 first checks whether the effective character counter 51 is positive, and if it is positive, one character is input from the position indicated by the current pointer 52 of the input buffer and set in the input character buffer 53. Next, the valid character counter 51 is decremented by 1.

有効文字カウンタ51をチエツクした結果正でない場合
は入力文字バッファ53にスペース(空白)を設定し、
人カバッファフのカレントポインタ52の示す位置から
制御コードを入力し、上4ビットを有効文字カウンタ5
1に設定する。
If the result of checking the valid character counter 51 is not positive, a space (blank) is set in the input character buffer 53,
Input the control code from the position indicated by the current pointer 52 of the human buffer buffer, and input the upper 4 bits to the valid character counter 5.
Set to 1.

最後にカレントポインタに1加え、現在入方中の位置を
更新する。
Finally, add 1 to the current pointer to update the current position.

本実施例によれば圧縮形式のソースプログラムを直接字
句解析の対象とすることにより、デコード(伸長)して
から字句解析を行う場合に比ベスペース(空白)読みと
ばしが高速化できコンパイル効率が向上するという効果
がある。
According to this embodiment, by directly subjecting a compressed source program to lexical analysis, when performing lexical analysis after decoding (decompression), space (blank) reading is faster and compilation efficiency is improved. It has the effect of

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

本発明によればコンパイル時ソースプログラム中のスペ
ース(空白)の読みとばしが高速化できるのでコンパイ
ル時間を短縮できるという効果が
According to the present invention, it is possible to speed up reading of spaces (blanks) in a source program at compile time, resulting in an effect of shortening compile time.

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

第1図は本発明の一実施例のブロック図、第2図はソー
スプログラムの圧縮形式の説明図、第3図は字句解析部
の説明図、 第4図は1文字入力部の説明図である。 1・・・コンパイラ、2・・・ソースファイル、3・・
・構文解析部、4・・・字句解析部、6・・・ソース入
力部、8・・・ソース伸長部、10・・・コード生成部
Fig. 1 is a block diagram of an embodiment of the present invention, Fig. 2 is an explanatory diagram of the compression format of the source program, Fig. 3 is an explanatory diagram of the lexical analysis section, and Fig. 4 is an explanatory diagram of the single character input section. be. 1... Compiler, 2... Source file, 3...
- Syntax analysis unit, 4... Lexical analysis unit, 6... Source input unit, 8... Source decompression unit, 10... Code generation unit.

Claims (1)

【特許請求の範囲】[Claims] 1、コンパイラにおいて、圧縮形式のソースプログラム
を伸長せずに直接字句解析の対象とすることを特徴とす
る圧縮形式ソースプログラムのコンパイル方式。
1. A method for compiling a compressed source program, characterized in that the compiler directly subjects the compressed source program to lexical analysis without decompressing it.
JP63128373A 1988-05-27 1988-05-27 Compiling system for compressed source program Pending JPH021027A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63128373A JPH021027A (en) 1988-05-27 1988-05-27 Compiling system for compressed source program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63128373A JPH021027A (en) 1988-05-27 1988-05-27 Compiling system for compressed source program

Publications (1)

Publication Number Publication Date
JPH021027A true JPH021027A (en) 1990-01-05

Family

ID=14983220

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63128373A Pending JPH021027A (en) 1988-05-27 1988-05-27 Compiling system for compressed source program

Country Status (1)

Country Link
JP (1) JPH021027A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008307328A (en) * 2007-06-18 2008-12-25 Mitsubishi Electric Corp Cooker
US10684831B2 (en) 2015-06-10 2020-06-16 Fujitsu Limited Information processing apparatus, information processing method, and recording medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008307328A (en) * 2007-06-18 2008-12-25 Mitsubishi Electric Corp Cooker
US10684831B2 (en) 2015-06-10 2020-06-16 Fujitsu Limited Information processing apparatus, information processing method, and recording medium

Similar Documents

Publication Publication Date Title
US5956510A (en) Apparatus and method for revising computer program code
JPH0630066B2 (en) Table type language translation method
JP3130828B2 (en) Assembly processing method
JPH021027A (en) Compiling system for compressed source program
JPS61204741A (en) Compressing method for source program
JP3000878B2 (en) Assembler processing method
JP2868127B2 (en) Blank reading device in lexical analysis
JP3190377B2 (en) Function name converter
JPH08286927A (en) Assembler processing method
JPH036624A (en) Processing system for translation list output corresponding to plural code systems
JPS60193029A (en) Data input system
JPH0734193B2 (en) Text-separated learning system
JPH01270133A (en) Format specification processing system by character
JPH0368028A (en) Picture phrase analyzing system
JP2003022180A (en) Microcomputer and operation method thereof
JPH03186933A (en) Symbol processing system for language processing system
JPH0561687A (en) Processing system for compiler
JPH01216474A (en) Method for processing correction of duplicate expression
JPS6365530A (en) Code optimizing system
JPH0540638A (en) Vocabulary analyzing/editing system
JPH08123694A (en) C compiler
JPH0358135A (en) Output method for text modifying plural operands
JPH11232122A (en) Method for converting extended identifier in source program
JPH01316865A (en) Kana-Kanji conversion reading input function addition device
JPS63138465A (en) parser