JPH06236250A - Device and method for encoding - Google Patents

Device and method for encoding

Info

Publication number
JPH06236250A
JPH06236250A JP5288488A JP28848893A JPH06236250A JP H06236250 A JPH06236250 A JP H06236250A JP 5288488 A JP5288488 A JP 5288488A JP 28848893 A JP28848893 A JP 28848893A JP H06236250 A JPH06236250 A JP H06236250A
Authority
JP
Japan
Prior art keywords
procedure
buffer
memory
binary
encoding
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.)
Granted
Application number
JP5288488A
Other languages
Japanese (ja)
Other versions
JP3499589B2 (en
Inventor
Motoyama Tetsurou
モトヤマ テツロウ
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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
Priority claimed from US08/002,283 external-priority patent/US5375204A/en
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Publication of JPH06236250A publication Critical patent/JPH06236250A/en
Application granted granted Critical
Publication of JP3499589B2 publication Critical patent/JP3499589B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PURPOSE:To provide the method and device for efficiently converting the text expression of a nested procedure into a birnary format. CONSTITUTION:In a grammer analysis step 4, a clear text SPDL file 2 is decomposed to a basic unit and in a binary encoding step 6, this is converted to, the binary format. In the case of this binary encoding, a temporary storage buffer is generated by the first procedure among the nested procedures, memory location for storing a procedure length is secured in the buffer, and next, the procedure is binary encoded and continuously stored in the same memory location. Concerning each procedure nested inside the first procedure, the memory location for storing the length is secured in the buffer as well and when each procedure is completed, the length is calculated and stored in the memory location. The temporary storage buffer is composed of a single memory buffer or logically continued plural small buffers regarded as the single memory buffer.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、プリンタへ送られる情
報の圧縮・符号化及びプリンタの制御に関する。ここに
おいて、プリンタとは、普通のコンピュータ用プリンタ
のみならず、リモートファクスプリンタ、その他のディ
スプレイもしくはプレゼンテーション装置の類も意味す
る。より具体的には、本発明はコンピュータ言語のバイ
ナリ符号化に係り、特に、バイナリ表現中にプロシージ
ャ長に関するフィールドが含れる、ネストされたプロシ
ージャの効率的なバイナリ符号化のための装置及び方法
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to compression / encoding of information sent to a printer and control of the printer. Here, the printer means not only an ordinary computer printer, but also a remote fax printer and other types of displays or presentation devices. More particularly, the present invention relates to computer language binary encoding, and more particularly to an apparatus and method for efficient binary encoding of nested procedures that includes a field for procedure length in the binary representation. .

【0002】[0002]

【従来の技術】世界中で毎日、膨大な量の情報がプリン
タへ送られる。今日の忙しいオフィス環境においては、
しばしば、より速やかに情報を印刷して利用できるよう
要求される。
BACKGROUND OF THE INVENTION A huge amount of information is sent to printers every day in the world. In today's busy office environment,
Often, information is required to be printed and available more quickly.

【0003】従来より、デジタルデータのストリームを
圧縮されたデジタルコード信号へ符号化し、また、圧縮
されたデジタル符号信号を再びオリジナルデータへ復号
するデータ圧縮方式が知られている。データ圧縮方式の
目的とするところは、一定量のデジタル情報を記憶また
は伝送するために要するメモリ量または時間を減らすこ
とである。圧縮は、データ記憶の必要メモリまたはデー
タ伝送時間を減らすことにより、費用の削減につなが
る。データファイルの記憶のためにテープまたはディス
クを使用する場合、圧縮されたファイルの記憶に必要な
テープまたがディスクが少なくてすむ。電話回線または
衛星回線を利用してデジタル情報を伝送する場合、伝送
に先だってデータを圧縮すれば、必要な伝送時間が短く
なるのでコストが下がることになる。
Conventionally, a data compression method is known in which a stream of digital data is encoded into a compressed digital code signal, and the compressed digital code signal is decoded again into original data. The purpose of data compression schemes is to reduce the amount of memory or time required to store or transmit a fixed amount of digital information. Compression leads to cost savings by reducing the required memory for data storage or data transmission time. When using tapes or disks to store data files, fewer tapes or disks are needed to store the compressed files. In the case of transmitting digital information using a telephone line or satellite line, compressing the data prior to transmission shortens the required transmission time, resulting in cost reduction.

【0004】例えば、日刊新聞や週刊時事通信の内容を
衛星回線や電話回線により遠隔地へ送って印刷したいと
する。適当な装置によって、新聞や時事通信の内容を文
字のデータストリームへ変換して通信回線を介し伝送す
る。この新聞または時事通信の内容を構成するシンボル
が圧縮されてから伝送され、受信機で再現されたとする
と、伝送時間を大幅に削減できる。
For example, suppose that the contents of daily newspaper or weekly newsletter are to be sent to a remote place for printing via a satellite line or a telephone line. With a suitable device, the contents of the newspaper or newsletter are converted into a character data stream and transmitted via the communication line. If the symbols that compose the contents of the newspaper or the current newsletter are compressed and then transmitted and reproduced by the receiver, the transmission time can be greatly reduced.

【0005】別の例を挙げる。大会社のネットワークフ
ァイルサーバー上のワードプロセシングデータファイル
のような膨大な文書群を保管する場合、文書を構成する
シンボル信号全体が圧縮されてから格納され、その後利
用する場合に、その圧縮されたファイルより伸長される
とすれば、記憶スペースは著しく削減されよう。
Another example will be given. When storing a huge document group such as a word processing data file on a network file server of a large company, the entire symbol signal that composes the document is compressed and then stored, and the compressed file is then used. If it were more stretched, the storage space would be significantly reduced.

【0006】デジタルデータの圧縮のための基本的な必
要条件は、圧縮方式が可逆的でなければならないという
ことである。すなわち、圧縮されたデータを、情報を変
化させたり失うことなしに、再び元の形に伸長もしくは
復号することができなければならない。復号されたデー
タとオリジナルデータは、全く同一でなければならな
い。
The basic requirement for compression of digital data is that the compression scheme must be lossless. That is, the compressed data must be able to be decompressed or decoded again in its original form without changing or losing information. The decrypted data and the original data must be exactly the same.

【0007】最もよく知られ、最も広く利用されている
汎用のデータ圧縮プロシージャは、米国特許第4,46
4,650号で開示されたLempel,Ziv外の方
式で、以下、これを”LZ”方式と呼ぶことにする。こ
のLZ方式は、テキストデータ用のロスのないダイナミ
ックオンライン方式である。LZ方式では、頻出するキ
ャラクタのストリングをメモリに記憶しておく。記憶さ
れたキャラクタストリングに合致する新たなキャラクタ
のストリングが入力ストリング中に出現した時に、記憶
されたキャラクタストリングへのポインタが、ストリン
グ全体の代わりに伝送される。記憶されたキャラクタの
ストリングと一致し、また、1つ以上のキャラクタから
なるキャラクタのストリングが入力ストリーム中に出現
した時に、その一致したストリングのためのポインタが
当該新しいキャラクタ・ストリングの先頭のキャラクタ
と一緒に伝送されるが、その先頭のキャラクタは圧縮さ
れない形で伝送される。
The best known and most widely used general purpose data compression procedure is US Pat.
The method other than Lempel and Ziv disclosed in U.S. Pat. No. 4,650, hereinafter referred to as "LZ" method. This LZ method is a lossless dynamic online method for text data. In the LZ method, a string of frequently appearing characters is stored in a memory. When a new string of characters that matches the stored character string appears in the input string, a pointer to the stored character string is transmitted instead of the entire string. When a string of characters that matches the stored string of characters and that consists of one or more characters appears in the input stream, the pointer for the matched string is the first character of the new character string. Although transmitted together, the leading character is transmitted in uncompressed form.

【0008】しかし、LZデータ圧縮方式の問題点は、
この方式が通常、膨大なコンピュータメモリと処理時間
を必要とすることである。そのうえ、頻繁に繰り返し現
われるキャラクタ・ストリングを記憶するメモリが一旦
満杯になると、LZ方式はその頻出キャラクタ・ストリ
ングを動的に変更することが難しい。
However, the problem with the LZ data compression method is that
This method usually requires a large amount of computer memory and processing time. Moreover, once the memory that stores the frequently repeated character strings is full, the LZ scheme has difficulty dynamically changing the frequent character strings.

【0009】Storeは米国特許第4,876,54
1号において、前記のLempel外の特許の問題点を
解決し、圧縮される頻出キャラクタ・ストリングの更新
を可能にするデータ圧縮方式を開示している。このSt
oreのデータ圧縮方式においては、符号器及び復号器
の両方が頻出キャラクタ・ストリングを記憶するための
辞書を備える。各ストリングは固有のポインタによって
識別される。入力データストリングは、解析され、そし
て、マッチングアルゴリズムを使用して符号器の辞書中
のストリングと照合される。そして、一致したストリン
グに関するポインタが離れた場所へ伝送されて記憶また
は復号される。その後、更新アルゴリズムを使用し、符
号器の辞書は上記一致したデータストリングに基づき新
しいデータを含むよう更新される。
Store, US Pat. No. 4,876,54
No. 1 discloses a data compression method that solves the problems of the above-mentioned Lempel patent and enables updating of a frequent character string to be compressed. This St
In the ore data compression scheme, both the encoder and the decoder have dictionaries for storing frequent character strings. Each string is identified by a unique pointer. The input data string is parsed and matched against a string in the encoder's dictionary using a matching algorithm. Then, a pointer for the matched string is transmitted to a remote location for storage or decoding. Then, using an update algorithm, the encoder dictionary is updated to include new data based on the matched data string.

【0010】別のデータ圧縮方式がFriedman外
によって米国特許第5,027,376号で開示され、
これはMicrocom System社へ譲渡され
た。Friedmanの圧縮方式は、MNP(Micr
om NetworkingPortocol)モデム
に使われている。Friedman方式においては、圧
縮用モデムが入力データストリームを受信し、そのデー
タストリーム中の各キャラクタは圧縮されたキャラクタ
コードによって再編成され、そのコード長はそのキャラ
クタのデータストリーム中での頻度に依存する。頻度テ
ーブルが備えられることによって、データストリーム中
のキャラクタの相対頻度の変化を圧縮用モデムが認識で
き、それに応じて、かかるキャラクタを表現する圧縮キ
ャラクタが入れ替えられる。伸長用モデムは、通信回線
を介し圧縮用モデムと接続されるが、圧縮キャラクタコ
ードを、圧縮用モデムのコード処理のやり方と逆の順序
で処理する。伸長用モデムも相対頻度テーブルを備えて
おり、色々なキャラクタの相対頻度が変化した時に圧縮
コードによって表現される実際のキャラクタも変更され
なければならない。以上に述べた各データ圧縮方式は伝
送または記憶するためのデータを圧縮する場合には非常
に効率的であろうが、いくつか欠点がある。第1に、圧
縮されたファイルは直接読むことができないフォーマッ
トで記憶される。すなわち、ファイルを何等かの目的に
使用するには、その前にファイルを伸長しなければなら
ない。この情報伸長にプロセッサ時間をかけてはじめ
て、圧縮情報をオリジナルの形に戻すことができる。
Another data compression scheme was disclosed by Friedman et al. In US Pat. No. 5,027,376,
It was transferred to Microcom System. Friedman's compression method is MNP (Micr
om Networking Protocol) Used for modems. In the Friedman scheme, a compression modem receives an input data stream and each character in the data stream is reorganized with a compressed character code, the code length of which depends on the frequency of the character in the data stream. . The provision of the frequency table allows the compression modem to recognize changes in the relative frequency of the characters in the data stream, and correspondingly replaces the compressed characters representing such characters. The decompression modem is connected to the compression modem via a communication line, but processes the compressed character code in the reverse order of the code processing method of the compression modem. The decompression modem also has a relative frequency table, and when the relative frequency of various characters changes, the actual character represented by the compression code must also be changed. While each of the data compression schemes described above would be very efficient at compressing data for transmission or storage, it does have some drawbacks. First, the compressed file is stored in a format that cannot be read directly. That is, the file must be decompressed before it can be used for any purpose. Only by spending processor time on this information expansion can the compressed information be restored to its original form.

【0011】第2に、データの圧縮の際に、圧縮ファイ
ル中にコードとして記憶される使用頻度の高いキャラク
タ・ストリングを記憶するために、膨大なメモリを必要
とすることが多い。
Secondly, when compressing data, an enormous memory is often required to store a frequently used character string stored as a code in a compressed file.

【0012】データ圧縮ルーチンは、ワードプロセッシ
ングファイルに対して特に有用である。データプロセシ
ングファイルを記憶する一方法は、ファイルのテキスト
情報とフォーマット用コマンドからなるページ記述言語
を用いる方法である。ページ記述言語(PDL)は現に
コンピュータのプリンタの制御に用いられており、テキ
ストとグラフィックスの両方を含む文書を印刷する場合
に理想的である。
The data compression routines are particularly useful for word processing files. One way to store a data processing file is to use a page description language consisting of file text information and formatting commands. Page Description Language (PDL) is currently used to control computer printers and is ideal for printing documents that contain both text and graphics.

【0013】PDLの例として、Adobe社のポスト
スクリプト(PostScript,登録商標)とXe
rox社のインタープレス(Interpress,登
録商標)がある。
As an example of PDL, PostScript (PostScript, registered trademark) from Adobe and Xe
There is an interpress (registered trademark) of Rox.

【0014】本発明を、標準ページ記述言語(SPD
L)に関連して説明する。このSPDLは、Inter
national Standard Organiz
ation(”ISO”)の一セクションへ、ISO/
IEC DIS 10180として、草案が現在出され
ており、ニューヨークにある AmericanNat
ional Standards Institute
(”ANSI”)を通じて入手できる。
The present invention is described in the standard page description language (SPD).
It will be described in relation to L). This SPDL is Inter
national Standard Organiz
ation (“ISO”) section, ISO /
The draft is currently being drafted as IEC DIS 10180 and is located in American Nat, New York.
Ional Standards Institute
(“ANSI”).

【0015】SPDLの文書は文書の最終フォームであ
る。すなわち、この文書は、生成され、編集され、当該
文書に関するコンポジション、フォーマッティング及び
配置の全てが決定済みである。SPDL文書は、プリン
タあるいは文書の最終フォームを表示するコンピュータ
モニターなどのプレゼンテーション装置によるプレゼン
テーションが可能である。SPDL文書は、通信回線を
介し他のコンピュータやファクシミリ装置へ伝送するこ
ともできる。
The SPDL document is the final form of the document. That is, this document has been created, edited, and the composition, formatting, and placement for that document have all been determined. The SPDL document can be presented by a printer or a presentation device such as a computer monitor that displays the final form of the document. The SPDL document can also be transmitted to another computer or a facsimile machine via a communication line.

【0016】SPDL文書には二つの基本パーツ、すな
わち構造とコンテント(content)がある。文書
の構造は、そのコンテントに依存しないが、コンテント
のための解釈の環境(コンテキスト)を確立する。例え
ば、ボールドフェイス(肉太活字体)を利用できるとき
は、解釈の環境はボールドフェイスが利用可能リソース
中にあることを指示するが、テキスト自体はコンテント
である。
An SPDL document has two basic parts: structure and content. The structure of a document does not depend on its content, but establishes an interpretation environment (context) for the content. For example, when boldface is available, the interpretation environment indicates that the boldface is among the available resources, but the text itself is content.

【0017】構造エレメントの例は、係属中の米国特許
出願第07/876,601号に述べられているよう
に、文書、ピクチャー、辞書ジェネレータ及びトークン
シーケンスである。トークンシーケンスは、文書コンテ
ントを含む特殊な構造エレメントである。
Examples of structural elements are documents, pictures, dictionary generators and token sequences, as described in pending US patent application Ser. No. 07 / 876,601. A token sequence is a special structural element that contains document content.

【0018】SPDLは、ここに引用により組み込まれ
るところのISO 8824:1990及びISO 8
825:1990で定義されたアブストラクト・シンタ
ックス・ノーテーション1(Abstract Syn
tax Notation1;ANS.1)を使用する
が、これはバイナリ構造符号化用でトークンシーケンス
を8ビットバイトのシーケンスであるオクテットストリ
ングとして定義する。ISO 8897:1986で定
義された標準一般化マークアップ言語(Standar
d Generalized Markup Lang
uage;”SGML”)が、クリア(clear)テ
キスト構造符号化のために用いられる。
SPDL is ISO 8824: 1990 and ISO 8 which are hereby incorporated by reference.
825: 1990 Abstract Syntax Notation 1 (Abstract Synth)
tax Notification1; ANS. 1) is used, which defines the token sequence as an octet string which is a sequence of 8-bit bytes for binary structure encoding. Standard Generalized Markup Language (Standard) defined in ISO 8897: 1986
d Generalized Markup Lang
age; "SGML") is used for clear text structure encoding.

【0019】SPDL文書は2種類のフォーマット、つ
まりクリアテキストフォーマットとバイナリフォーマッ
トで表現できる。クリアテキストフォーマットは、人が
読んで分かる形式で文書を表現し、SPDLページ記述
言語を熟知している者は判読可能である。他方、バイナ
リSPDLフォーマットは、コンピュータの理解できる
バイナリ形式で文書を表現する。
SPDL documents can be represented in two formats: clear text format and binary format. The clear text format represents a document in a human readable format and is readable by those who are familiar with the SPDL page description language. Binary SPDL format, on the other hand, represents a document in a computer-readable binary format.

【0020】バイナリ符号化の欠点は、それが人が読ん
でも分からないことである。したがって、SPDLファ
イルのバイナリ符号中にエラーがあっても、そのエラー
を簡単には訂正できない。例えば、文書が他のシステム
へ伝送されたが印刷することができない場合、その文書
を受信したシステムのユーザはバイナリ形式の文書を訂
正できないであろう。
The drawback of binary encoding is that it is not visible to human reading. Therefore, even if there is an error in the binary code of the SPDL file, the error cannot be easily corrected. For example, if a document was transmitted to another system but cannot be printed, the user of the system that received the document would not be able to correct the binary form of the document.

【0021】クリアテキストSPDLファイルは、人、
コンピュータのどちらでも読むことができるが、大きな
記憶スペースが必要であり、通信回線による伝送の速度
が遅く、印刷するのに長い処理時間を要する。しかし、
クリアテキストSPDLファイルとバイナリSPDLフ
ァイルは完全に等価である。すなわち、一方で表現でき
る機能は、構文変換によって他方で表現することができ
る。
The clear text SPDL file is
It can be read by either computer, but it requires a large amount of storage space, is slow in transmission over communication lines, and requires a long processing time to print. But,
Clear text SPDL files and binary SPDL files are fully equivalent. That is, a function that can be expressed on the one hand can be expressed on the other by syntactic conversion.

【0022】SPDLファイルは、インタープレスやポ
ストスクリプトと異なった符号化方式を使用する。イン
タープレスはバイナリ符号化ファイルしか扱えず、これ
らファイルはバイナリSPDLファイルと等価でない。
ポストスクリプトは、初めはクリアテキスト表現しか使
用できなかったが、現在では、クリアテキストとバイナ
リ符号化の両方をサポートしている。しかし、ポストス
クリプトのクリアテキストとバイナリ符号化はSPDL
のそれとは異なっている。
The SPDL file uses a different encoding method from Interpress and Postscript. Interpress can only handle binary encoded files, and these files are not equivalent to binary SPDL files.
Initially, Postscript could only use clear text representation, but now it supports both clear text and binary encoding. However, PostScript clear text and binary encoding is SPDL
Is different from that.

【0023】クリアテキストSPDL文書は”{”
と”}”の間の情報によって表わされたプロシージャを
含むことができる。プロシージャがバイナリフォーマッ
トで表現される時、プロシージャの始まりは例えば67
Hで表わされ、その後にプロシージャの表現に必要なバ
イト数を表わす2バイト、例えばプロシージャが8バイ
ト長であることを表わす00H 08Hが続き、その後
にプロシージャのバイナリ表現が続く。
The clear text SPDL document is "{"
And a procedure represented by the information between "}". When the procedure is represented in binary format, the start of the procedure is, for example, 67
It is represented by H, followed by 2 bytes representing the number of bytes required to represent the procedure, for example 00H 08H representing that the procedure is 8 bytes long, followed by the binary representation of the procedure.

【0024】クリアテキストのプロシージャのバイナリ
表現への変換中に、各クリアテキストのオペランドまた
は命令はバイナリに変換されながら記憶バッファへ書き
込まれる。テキストルーチン全体がバイナリに変換され
て記憶バッファに記憶されると、67HがバイナリSP
DLファイルに書き込まれ、その後に、当該ルーチンを
表わすのに必要とされるバイト数の2バイトのフィール
ドが書き込まれ、これに続いて、クリアテキストルーチ
ンのバイナリ表現を含む記憶バッファのコンテントが書
き込まれる。したがって、クリアテキストプロシージャ
をバイナリ表現へ書き換えるには、予め、そのプロシー
ジャのバイナリ表現でのバイト数を知る必要がある。
During the conversion of the clear text procedure to a binary representation, each clear text operand or instruction is written to a storage buffer while being converted to binary. When the entire text routine is converted to binary and stored in the storage buffer, 67H is returned to the binary SP.
It is written to a DL file, followed by a 2-byte field of the number of bytes needed to represent the routine, followed by the content of the storage buffer containing the binary representation of the cleartext routine. . Therefore, in order to rewrite a clear text procedure into a binary representation, it is necessary to know the number of bytes in the binary representation of the procedure in advance.

【0025】主要な問題点は、プロシージャのバイナリ
表現を記憶するためのバッファが各プロシージャ毎に必
要であること、及び多数のネストされたプロシージャが
多数のバッファを必要とし、このことがメモリ管理の問
題を招くということである。クリアテキストのネストさ
れたプロシージャ”{1 add {2 add{3
add}}}”が単純な方法によってバイナリ表現に変
換される様子を次に説明する。上記プロシージャは在来
方法の動作及び問題を簡潔に説明するためのものであ
る。
The main problem is that each procedure needs a buffer to store the binary representation of the procedure, and many nested procedures require many buffers, which is a memory management concern. It is a problem. Clear text nested procedure "{1 add {2 add {3
The following describes how "add}}}" is converted into a binary representation by a simple method. The above procedure is intended to briefly explain the operation and problems of the conventional method.

【0026】”{1 add”に出会った時に、”1
add”のバイナリ表現を保持する一つのバッファが生
成される。2番目の”{”に出会った時には、一つのネ
ストされたプロシージャがあるので、”2 add”の
バイナリ表現を保持する2つ目のバッファが生成され
る。3番目の”{”に出会った時に、”3 add”の
バイナリ表現を保持する3つ目のバッファが生成され
る。
When "{1 add" is encountered, "1
A single buffer is created to hold the binary representation of "add". When the second "{" is encountered, there is one nested procedure, so the second one holding the binary representation of "2 add". The third buffer is created which holds the binary representation of "3 add" when the third "{" is encountered.

【0027】最初の”}”に出会った時に、”3 ad
d”を内容とする3番目のプロシージャは終了する。そ
の時に67H、3番目のバッファの長さを表わす2バイ
ト、及び3番目のバッファの内容が、この順に2番目の
バッファに付加される。
When the first "}" is encountered, "3 ad
The third procedure, whose contents are d ", ends. At that time, 67H, 2 bytes representing the length of the third buffer, and the contents of the third buffer are added to the second buffer in this order.

【0028】2番目の”}”に出会った時に、バイナリ
形式に変換された2番目のネストされたルーチンが終了
する。この時に、67H、2番目のルーチンの長さ(例
えば”2 add”の2バイト表現の長さと3番目のル
ーチンの長さの合計)を表わす2バイト数、2番目のバ
ッファの内容が、この順に1番目のバッファに付加され
る。同様の手順が3番目の”}”についても行なわれ、
ネストされたプロシージャを符号化したものがファイル
または他の記憶場所へ書き込まれる。
When the second "}" is encountered, the second nested routine converted to binary format ends. At this time, the number of 2 bytes representing the length of 67H, the second routine (for example, the length of the 2-byte representation of "2 add" and the length of the third routine), and the contents of the second buffer are They are sequentially added to the first buffer. The same procedure is performed for the third "}",
An encoded version of the nested procedure is written to a file or other storage location.

【0029】このような在来の方法は、空きのある多数
のバッファを必要とする点でメモリの使用効率が低い。
さらに、複数のネストされたプロシージャがある場合、
これらの多数のバッファの特殊な管理が必要である。
Such a conventional method has a low memory usage efficiency in that it requires a large number of buffers with space.
In addition, if you have multiple nested procedures,
Special management of these numerous buffers is required.

【0030】[0030]

【発明が解決しようとする課題】したがって、本発明の
一つの目的は、クリアテキストSPDLファイルを、よ
り少ない記憶スペースに記憶できるように、より短い時
間で伝送できるように、さらには、より高速に印刷でき
るように、バイナリファイルに圧縮することが可能なク
リアテキストSPDLファイルの表現方法を提供するこ
とである。
SUMMARY OF THE INVENTION Accordingly, one object of the present invention is to enable clear text SPDL files to be stored in less storage space, transmitted in less time, and faster. It is to provide a method for representing a clear text SPDL file that can be compressed into a binary file for printing.

【0031】本発明のもう一つの目的は、プロシージャ
のバイナリ表現が長さフィールドを含むところの、ネス
トされたプロシージャをバイナリ符号化するための効率
的な装置を提供することである。
Another object of the invention is to provide an efficient apparatus for binary encoding a nested procedure, where the binary representation of the procedure contains a length field.

【0032】本発明の他の目的は、最少の一時記憶バッ
ファを使用して、ネストされたプロシージャをバイナリ
形式に符号化することができる効率的な方法及び装置を
提供することである。
Another object of the present invention is to provide an efficient method and apparatus capable of encoding a nested procedure in binary format using a minimum of temporary storage buffers.

【0033】[0033]

【課題を解決するための手段】本発明により提供される
符号化方法及び符号化装置の主要な特徴は、1つの論理
的に連続したメモリバッファが符号化後のプロシージャ
の一時記憶用バッファとして用いられることである。
The main feature of the encoding method and the encoding apparatus provided by the present invention is that one logically continuous memory buffer is used as a buffer for temporary storage of a procedure after encoding. Is to be done.

【0034】本発明の第1の態様によれば、上記一時記
憶用バッファとして、単一のメモリバッファが用いられ
るが、本発明の第2及び第3の態様によれば、上記一時
記憶用バッファとして、複数のバッファが論理的に連続
するように、必要となった時にバッファが割り当てられ
る。
According to the first aspect of the present invention, a single memory buffer is used as the temporary storage buffer. According to the second and third aspects of the present invention, the temporary storage buffer is used. As such, buffers are allocated when needed so that a plurality of buffers are logically continuous.

【0035】本発明の第2の態様によれば、ポインタ配
列を用いて複数のバッファが管理される。本発明の第3
の態様によれば、二重リンクリストデータ構造を用いて
複数のバッファが管理される。この二重リンクリストデ
ータ構造は、前の二重リンクリストデータ構造へのポイ
ンタと次のリンクリストデータ構造へのポインタを有す
る。
According to the second aspect of the present invention, a plurality of buffers are managed using the pointer array. Third of the present invention
According to this aspect, a plurality of buffers are managed using the doubly linked list data structure. This doubly linked list data structure has a pointer to the previous doubly linked list data structure and a pointer to the next linked list data structure.

【0036】[0036]

【作用】本発明の第1の態様によれば、符号化後のプロ
シージャの一時記憶のために文字通り単一のメモリバッ
ファを用いるため、複数のバッファを用いる場合に比
べ、メモリ管理のためのオーバーヘッドが減少し、効率
的な符号化が可能である。また、複数のバッファを使用
した場合のようなメモリの細分化と、それによるメモリ
使用効率の低下の問題を回避できる。
According to the first aspect of the present invention, since a single memory buffer is literally used for temporary storage of a procedure after encoding, the overhead for memory management is greater than that when a plurality of buffers are used. Is reduced and efficient encoding is possible. In addition, it is possible to avoid the problem that the memory is subdivided as in the case of using a plurality of buffers and the memory usage efficiency is deteriorated.

【0037】本発明の第2及び第3の態様によれば、複
数のバッファが論理的に連続するように割り当てられ
る。論理的に連続するとは、各バッファが前のバッファ
の論理的な終端に続いているということであり、メモリ
ロケーションが物理的に隣合っている必要はない。この
ような論理的に連続した複数のバッファは、全体として
単一のバッファとみなすことができる。そして、複数の
バッファを使用するといっても、従来のようにプロシー
ジャ毎に小バッファを1個ずつ持つのではなく、あるバ
ッファが一杯になった時に、このバッファの論理的な終
端に次のバッファを付加する。各バッファのオーバーフ
ローを考える必要がないため、各バッファのサイズを従
来より十分に小さくすることができる。したがって、従
来のように比較的サイズの大きな空きバッファが多数、
無用にメモリを占有するという問題を解決し、メモリを
効率的に使用できる。
According to the second and third aspects of the present invention, the plurality of buffers are allocated so as to be logically continuous. Logically contiguous means that each buffer follows the logical end of the previous buffer and that memory locations do not have to be physically adjacent. A plurality of such logically consecutive buffers can be regarded as a single buffer as a whole. And, even if multiple buffers are used, instead of having one small buffer for each procedure as in the past, when a certain buffer becomes full, the logical end of this buffer becomes the next buffer. Is added. Since it is not necessary to consider the overflow of each buffer, the size of each buffer can be made sufficiently smaller than before. Therefore, there are many free buffers with a relatively large size, as in the past.
The problem of unnecessarily occupying memory is solved, and memory can be used efficiently.

【0038】[0038]

【実施例】以下、本発明について3つの好適な実施例を
例にして説明するが、まず各実施例の概要を説明する。
BEST MODE FOR CARRYING OUT THE INVENTION The present invention will be described below with reference to three preferred embodiments. First, an outline of each embodiment will be described.

【0039】本発明の第1の実施例により提供される方
法及び装置によれば、符号化後のネストされたプロシー
ジャの一時記憶のためにバッファを1個だけ使用して、
クリアテキストフォーマットのネストされたプロシージ
ャの符号化を効率的に行なうことができる。
According to the method and apparatus provided by the first embodiment of the present invention, only one buffer is used for temporary storage of the nested procedure after encoding,
Encoding of nested procedures in clear text format can be performed efficiently.

【0040】プロシージャがクリアテキストからバイナ
リフォーマットに符号化される時に、最初のプロシージ
ャの始まりで、67H 00H 00Hが書き込まれた
一つの記憶バッファが生成される。この67Hはプロシ
ージャの始まりを意味し、また、00H 00Hはプロ
シージャのバイナリ表現の長さが後に書き込まれるスペ
ースを確保する。プロシージャのバイナリ表現は、67
H 00H 00Hに続けてバッファに書き込まれる。
最初のプロシージャの後に2番目以降のプロシージャが
ある場合、バッファの終わりに67H 00H 00H
が書き込まれ、それに続けて、そのプロシージャのバイ
ナリ表現が書き込まれる。後続の各プロシージャの始ま
りで、同様の処理が発生する。
When the procedure is encoded from clear text to binary format, at the beginning of the first procedure, a storage buffer is created into which 67H 00H 00H is written. This 67H means the beginning of the procedure, and 00H 00H reserves space for the length of the binary representation of the procedure to be written later. The binary representation of the procedure is 67
It is written into the buffer following H00H00H.
67H 00H 00H at the end of the buffer if there is a second or subsequent procedure after the first
Is written, followed by the binary representation of the procedure. Similar processing occurs at the beginning of each subsequent procedure.

【0041】1つのプロシージャの終わりを意味す
る”}”に出会った時に、処理中の最後のプロシージャ
の長さが計算され、そのプロシージャ用に確保された0
0H 00Hに上書きされる。同様の処理が後続の各プ
ロシージャの終わりで発生する。本発明の第2の実施例
及び第3の実施例は、第1の実施例とほぼ同様に作用す
るが、第1実施例ほど一時記憶バッファ用に多くのメモ
リを割り当てない。
When "}" is encountered, which means the end of one procedure, the length of the last procedure being processed is calculated and the 0 reserved for that procedure.
Overwritten with 0H 00H. Similar processing occurs at the end of each subsequent procedure. The second and third embodiments of the present invention operate in much the same way as the first embodiment, but do not allocate as much memory for temporary storage buffers as the first embodiment.

【0042】第2及び第3の実施例では、記憶バッファ
が満杯になった時に、追加情報の記憶のため必要に応じ
て追加の記憶バッファが割り当てられる。しかし、第2
実施例及び第3実施例における複数の記憶バッファの使
用方法は、複数の一時記憶バッファが論理的に連続する
ので、先に述べた従来技術における複数バッファの使用
方法とは異なる。すなわち、次の一つの記憶バッファの
先頭に記憶する情報は、その前の記憶バッファと一致す
ることはない。したがって、複数のバッファが用いられ
ても、それらは全体として、論理的に連続した一つの記
憶バッファとみるべきである。
In the second and third embodiments, additional storage buffers are allocated as needed to store additional information when the storage buffers are full. But the second
The method of using the plurality of storage buffers in the embodiment and the third embodiment is different from the method of using the plurality of buffers in the above-mentioned conventional technique because the plurality of temporary storage buffers are logically continuous. That is, the information stored at the beginning of the next one storage buffer does not match the previous storage buffer. Therefore, even if multiple buffers are used, they should be viewed as one logically contiguous storage buffer.

【0043】本発明の第2の実施例は、複数の記憶バッ
ファに配列インデックスを割り当て、これらを用いて複
数のバッファを管理する。
In the second embodiment of the present invention, array indexes are assigned to a plurality of storage buffers, and these are used to manage the plurality of buffers.

【0044】本発明の第3の実施例は二重リンクリスト
データ構造を用いて複数の記憶バッファを管理する。こ
の二重リンクリストデータ構造は、前のデータ構造への
ポインタと、次のデータ構造へのポインタとを持ってい
る。
The third embodiment of the present invention uses a doubly linked list data structure to manage multiple storage buffers. This doubly linked list data structure has a pointer to the previous data structure and a pointer to the next data structure.

【0045】以下、図面を参照して説明するが、各図面
中の同一の参照数字は同一または対応部分を示す。
Hereinafter, description will be given with reference to the drawings, and the same reference numerals in the drawings indicate the same or corresponding portions.

【0046】まず図1を参照する。図1に示したバイナ
リ符号化プロセスにおいて、クリアテキストSPDLフ
ァイル2がバイナリSPDLファイル8へ変換される
が、クリアテキストSPDLファイル2は普通、例えば
ワードプロセッサまたはグラフィックスプログラムによ
り生成される。
First, referring to FIG. Although the clear text SPDL file 2 is converted to a binary SPDL file 8 in the binary encoding process shown in FIG. 1, the clear text SPDL file 2 is typically produced by, for example, a word processor or graphics program.

【0047】クリアテキストSPDLファイルのバイナ
リフォーマットへの変換で、ファイルは元のサイズの約
30%またはそれ以上に圧縮され、したがって、ファイ
ルの記憶に要するスペースは約30%またはそれ以上削
減される。本発明によれば、構造の量に比べてコンテン
トの量が少ないクリアテキストファイルのサイズを、バ
イナリへ変換したときに90%削減可能であることが判
明した。通信回線を介してファイルをプリンタまたはネ
ットワークへ伝送するのに必要な時間も同様に、30%
またはそれ以上短縮される。さらに、バイナリSPDL
ファイルは、クリアテキストファイルより非常に高速に
印刷することができる。バイナリSPDLファイルが高
速に印刷される理由は、例えば、クリアテキストコマン
ドが等価なバイナリOPコード(opcode)へ変換
されているが、このOPコードがクリアテキストコマン
ドに比べはるかに高速に処理できるからである。また、
バイナリSPDLファイルは、各プロシージャの先頭に
プロシージャの長さが記述されるので、プロシージャ終
了コマンドについて調べる必要がないからである。
Converting a clear text SPDL file into a binary format compresses the file to about 30% or more of its original size, thus reducing the space required to store the file by about 30% or more. According to the present invention, it has been found that the size of a clear text file having a smaller amount of content than the amount of structure can be reduced by 90% when converted to binary. The time required to transfer a file to a printer or network via a communication line is also 30%.
Or more shortened. In addition, the binary SPDL
Files can be printed much faster than clear text files. The reason why the binary SPDL file is printed at high speed is that, for example, the clear text command is converted into an equivalent binary OP code (opcode), but this OP code can be processed much faster than the clear text command. is there. Also,
This is because there is no need to check the procedure end command in the binary SPDL file because the procedure length is described at the beginning of each procedure.

【0048】本発明は、クリアテキストSPDLファイ
ルのバイナリSPDLファイルへの変換に限定されるも
のではなく、ワードプロセッシングプログラムやページ
記述ファイル生成プログラム等のアプリケーションプロ
グラムによるバイナリSPDLファイルの直接生成へも
適用できる。したがって、処理プログラムが初めにクリ
アテキストSPDLファイルを生成する必要はなく、ア
プリケーションプログラムがファイルを直接、バイナリ
SPDLフォーマットへ符号化してもよい。さらに、後
に符号化されるところのプロシージャの生成の繰り返し
によって、符号化すべきどのような種類のデータもメモ
リに書き込むことができる。このデータは、予め生成さ
れたファイル、例えばバイナリSPDLファイルに変換
すべく前もって生成されたクリアテキストSPDLファ
イルから読み出されたデータなどである。
The present invention is not limited to the conversion of a clear text SPDL file into a binary SPDL file, but can be applied to the direct generation of a binary SPDL file by an application program such as a word processing program or a page description file generation program. . Therefore, the processing program does not have to first generate the clear text SPDL file, but the application program may directly encode the file into the binary SPDL format. Furthermore, any kind of data to be encoded can be written to the memory by repeated generation of the procedure, which is then encoded. This data is, for example, data read from a pre-generated file, eg a clear text SPDL file previously generated to be converted into a binary SPDL file.

【0049】本発明の第1実施例の単一バッファは、複
数バッファの方法に比べ、少ない資源を用いてメモリ管
理をすることができ、また、記憶バッファが1個のとき
は複数のバッファを使用したときに生じるメモリ細分化
の問題を生じない。
The single buffer of the first embodiment of the present invention can manage memory using less resources as compared with the method of multiple buffers. Moreover, when there is only one storage buffer, multiple buffers are used. It does not cause the problem of memory fragmentation that occurs when used.

【0050】ここで述べる処理及び例は、バイナリ表現
への符号化を説明するが、本発明の特徴は、本発明によ
り遂行される物理的変換である。メモリ内のクリアテキ
ストデータの物理的表現は、バイナリフォーマットの等
価な情報の物理的表現より大きい。データがディスクの
ようなメモリ内に表現される時、データはディスク上の
0及び1の磁気的変調として記憶される。よって、ファ
イルの表現を変換すると、同じ情報を表現するのに必要
なディスク上の磁気材料が少なくてすむ。一方、データ
をRAMに記憶する場合、データは磁気的にではなく、
電気的に記憶される。したがって、バイナリ表現は、必
要とする電気信号が減少し、より少ないメモリロケーシ
ョンに記憶される。
Although the processes and examples described herein describe encoding to a binary representation, a feature of the invention is the physical transformation performed by the invention. The physical representation of clear text data in memory is greater than the physical representation of equivalent information in binary format. When data is represented in a memory such as a disk, the data is stored as a 0 and 1 magnetic modulation on the disk. Thus, translating the file representation requires less magnetic material on the disk to represent the same information. On the other hand, when storing data in RAM, the data is not magnetic
It is stored electrically. Therefore, the binary representation requires less electrical signals and is stored in fewer memory locations.

【0051】図1に示した最初の処理ステップは文法解
析(parsing)ステップ4である。この文法解析
ステップは、クリアテキストSPDLファイルのコンポ
ーネントを、バイナリ符号化ステップ6により機械命令
に変換可能な構造エレメントやコンテント等の基本ユニ
ットに分解する。一般的な文法解析はソフトウエアまた
はハードウエアのいずれかで容易に実現されるので、そ
の詳細については説明簡略化のため省略する。
The first processing step shown in FIG. 1 is a grammar parsing step 4. This grammar analysis step decomposes the components of the cleartext SPDL file into basic units such as structural elements and content that can be converted into machine instructions by the binary encoding step 6. Since general grammar analysis is easily realized by either software or hardware, its details are omitted for simplification of description.

【0052】つぎに、ステップ6によって解析された基
本ユニットはステップ6でバイナリフォーマットに符号
化されて、バイナリSPDLファイル8に格納される。
このバイナリ符号化のプロセスが本発明の目的とするス
テップであるので、その詳細を説明するが、それに先だ
って、本発明の処理を実施するために用いられるハード
ウエアを説明する。前述のように、最初のクリアテキス
トフォーマットへのファイルの符号化を行なわずに、フ
ァイルをバイナリ表現へ符号化することも可能である。
Next, the basic unit analyzed in step 6 is encoded in the binary format in step 6 and stored in the binary SPDL file 8.
This binary encoding process is a target step of the present invention, and therefore its details will be described, but prior to that, the hardware used for carrying out the process of the present invention will be described. As mentioned above, it is also possible to encode the file into a binary representation without first encoding the file into the clear text format.

【0053】図2は本発明により構築された装置のブロ
ック図を示す。ハードディスク等の記憶装置18から与
えられるクリアテキストSPDLファイル2は、処理シ
ステム10内のCPU12へ送られる。CPU12は、
文法解析ルーチン14及びバイナリ符号化ルーチン16
を使用し、図1に示したプロセスの文法解析ステップ4
及びバイナリ符号化ステップ6を実行することにより、
クリアテキストSPDLファイルをバイナリSPDLフ
ァイル8に符号化する。このバイナリSPDLファイル
8は、それを得たい場合に記憶装置18へ戻し、あるい
は、プリンタ20またはネットワーク22中の他の装置
へ送ることができる。
FIG. 2 shows a block diagram of an apparatus constructed according to the present invention. The clear text SPDL file 2 provided from the storage device 18 such as a hard disk is sent to the CPU 12 in the processing system 10. CPU 12
Grammar analysis routine 14 and binary encoding routine 16
Grammar analysis step 4 of the process shown in FIG.
And by performing the binary encoding step 6,
Encode the clear text SPDL file into a binary SPDL file 8. This binary SPDL file 8 can be returned to storage device 18 if desired, or sent to printer 20 or other device in network 22.

【0054】図3は、図2の処理装置10と、それに接
続される周辺装置の詳細図である。記憶装置18はクリ
アテキストSPDLファイル2を記憶しているが、この
ファイルはディスクコントローラ26及びシステムバス
36を利用してRAM40へ送られる。CPU12は、
ハードディスク18に格納された文法解析ルーチン14
及びバイナリ符号化ルーチン16を使用し、RAM40
に格納されたクリアテキストSPDLファイルの文法解
析及び符号化をするために使用される。また、この文法
解析ルーチンとバイナリ符号化ルーチンの両方または一
方をROM38に格納することができる。符号化された
バイナリファイルは、記憶装置18(例えばハードディ
スク)にバイナリSPDLファイル8として格納するこ
とも、ディスクコントローラ26に接続されたフロッピ
ードライブ28に格納することも、あるいは、SCSI
バスを介してI/Oコントローラ46に接続されたもう
一つのハードディスク48へ格納することもできる。ま
た、このファイルは、例えばRS232Cラインを用い
てI/Oコントローラ46に接続されたプリンタ20に
よって印刷され、または、通信コントローラ24を利用
し一般的なイーサネット(Ethernet,登録商
標)ネットワーク等のネットワーク22へ送出される。
ディスプレイコントローラ42より送られる情報をCR
T44に表示できる。この処理装置10は、例えば入力
コントローラ34に接続できるキーボードやマウスを介
し、ユーザーにより制御される。ROM38は、CPU
12が必要とする様々なルーチンを記憶するために用い
られる。
FIG. 3 is a detailed view of the processing device 10 shown in FIG. 2 and peripheral devices connected thereto. The storage device 18 stores the clear text SPDL file 2, which is sent to the RAM 40 using the disk controller 26 and the system bus 36. CPU 12
Grammar analysis routine 14 stored in the hard disk 18
And the binary encoding routine 16 using the RAM 40
Used for grammar parsing and encoding of clear text SPDL files stored in. Further, the grammar analysis routine and / or the binary encoding routine can be stored in the ROM 38. The encoded binary file may be stored on the storage device 18 (eg, hard disk) as the binary SPDL file 8, on the floppy drive 28 connected to the disk controller 26, or on the SCSI.
It can also be stored in another hard disk 48 connected to the I / O controller 46 via the bus. Further, this file is printed by the printer 20 connected to the I / O controller 46 using, for example, the RS232C line, or the network 22 such as a general Ethernet (registered trademark) network using the communication controller 24. Sent to.
CR the information sent from the display controller 42
Can be displayed at T44. The processing device 10 is controlled by the user via a keyboard or a mouse that can be connected to the input controller 34, for example. ROM 38 is a CPU
It is used to store the various routines that 12 needs.

【0055】図4は、バイナリ符号化ルーチン16中の
各種ルーチンを示す。クリアテキストSPDLファイル
の符号化の開始時に、メインバイナリ符号化ルーチン1
00が実行される。このメイバイナリ符号化ルーチン1
00は、コンテントまたは構造のいずれを符号化中であ
るか判定して、メインコンテントバイナリ符号化ルーチ
ン104または構造バイナリ符号化ルーチン112をコ
ールする。構造バイナリ符号化ルーチン112は、バイ
ナリフォーマットへ符号化すべき構造のタイプを調べる
ので、適当なコンテント解釈環境を達成できる。SPD
L言語では様々な構造が使用されるが、その例としてピ
クチャー、プロローグ、辞書ジェネレータがある。構造
は各種の利用可能なコンポーネント、例えば初期状態変
数や、コンテント解釈時に使用される辞書を定義する。
FIG. 4 shows various routines in the binary encoding routine 16. At the start of the cleartext SPDL file encoding, the main binary encoding routine 1
00 is executed. This May binary encoding routine 1
00 determines whether content or structure is being encoded and calls the main content binary encoding routine 104 or the structure binary encoding routine 112. The Structure Binary Encoding Routine 112 looks up the type of structure to be encoded into a binary format so that a suitable content interpretation environment can be achieved. SPD
Various structures are used in the L language, examples of which include pictures, prologues, and dictionary generators. The structure defines the various available components, such as initial state variables and dictionaries used when interpreting content.

【0056】各種の構造に関するより詳しい説明は、本
発明を理解するために必要ではないが、係属中の199
1年10月17日付米国特許出願第07/778,57
8号、1992年4月30日付米国特許出願第07/8
76,251号、1992年4月30日付米国特許出願
第07/876,601号、1992年8月11日付米
国特許出願第07/931,808号に述べられてい
る。
A more detailed description of the various structures is not necessary to an understanding of the invention, but is pending 199.
U.S. Patent Application No. 07 / 778,57 dated October 17, 1
No. 8, US Patent Application No. 07/8, dated April 30, 1992.
76,251, U.S. patent application Ser. No. 07 / 876,601 dated April 30, 1992, U.S. patent application Ser. No. 07 / 931,808 dated August 11,1992.

【0057】構造バイナリ符号化ルーチン112によっ
て構造が判定されると、コンテントバイナリ符号化ルー
チン102は、各種トークンのクリアテキスト表現をテ
キストフォーマットからバイナリフォーマットへ変換す
ることができる。プロシージャがこのバイナリフォーマ
ットへ符号化される時に、プロシージャの長さ(すなわ
ちバイト数)をプロシージャの先頭に記述させる必要が
ある。トークンシーケンスは、コンテントを含む特殊な
構造エレメントであり、1つ以上のプロシージャを含む
ことができ、また、1つのプロシージャ内に1つ以上の
ネストしたプロシージャを入れることができる。すなわ
ち、プロシージャは内部に1つ以上の別のプロシージャ
を持つことができる。また、トークンシーケンスを持つ
ことができるが、トークンシーケンスはネストされたプ
ロシージャを全く含まない。トークンシーケンスが含む
ことができるのは、例えばオペレーションを1個だけで
ある。
Once the structure is determined by the Structure Binary Encoding Routine 112, the Content Binary Encoding Routine 102 can convert the clear text representation of various tokens from a text format to a binary format. When a procedure is encoded into this binary format, the length of the procedure (ie the number of bytes) must be described at the beginning of the procedure. A token sequence is a special structural element that contains content and can contain one or more procedures and can contain one or more nested procedures within a procedure. That is, a procedure can have one or more other procedures inside. It can also have a token sequence, but the token sequence does not contain any nested procedures. The token sequence can contain, for example, only one operation.

【0058】プロシージャ開始ルーチン106及びプロ
シージャ終了ルーチン108は、トークンシーケンス内
のプロシージャの開始と終了を管理するとともに、プロ
シージャのネスティングを管理する。その他符号化ルー
チン110は、トークンシーケンスのコンテントの符号
化を扱う。メインコンテントバイナリ符号化ルーチン1
04は、プロシージャの開始、コンテント、または終了
があるか判定し、どのようなコンテントが出現したかに
応じて、プロシージャ開始ルーチン106、その他符号
化ルーチン110、または、プロシージャ終了ルーチン
108をコールする。
The procedure start routine 106 and the procedure end routine 108 manage the start and end of the procedure in the token sequence and the nesting of the procedure. The other encoding routine 110 handles encoding of the content of the token sequence. Main content binary encoding routine 1
04 determines whether there is a start, content, or end of the procedure, and calls the procedure start routine 106, other encoding routine 110, or procedure end routine 108 depending on what kind of content appears.

【0059】図4の各ルーチンは分離した形に表わされ
ているが、これは簡略化のためであって、2つ以上のル
ーチンを組み合わせて1つのルーチンにすることも可能
である。例えば、メインバイナリ符号化ルーチン100
と構造バイナリ符号化ルーチン110を1つのルーチン
にまとめることができる。文法解析の機能を、メインバ
イナリ符号化ルーチン100または構造符号化ルーチン
112によって遂行させることも可能である。本発明の
簡単な実施例は全てのバイナリ符号化ルーチンをCPU
12に実行させるが、実行速度を上げるため、構造バイ
ナリ符号化ルーチン112用の構造プロセッサと、コン
テントバイナリ符号化ルーチン102用のコンテントプ
ロセッサを別々に持つことも可能である。
Although each routine in FIG. 4 is shown in a separate form, this is for simplification and it is also possible to combine two or more routines into one routine. For example, the main binary encoding routine 100
The binary coding routine 110 can be combined into one routine. The grammar parsing function may be performed by the main binary encoding routine 100 or the structure encoding routine 112. A simple embodiment of the present invention uses all binary encoding routines in the CPU.
However, in order to increase the execution speed, the structure processor for the structure binary encoding routine 112 and the content processor for the content binary encoding routine 102 may be separately provided.

【0060】図5に示したプロシージャ開始ルーチン及
び図6に示したプロシージャ終了ルーチンは、本発明の
第1実施例に従ってコンテントのバイナリ符号化を遂行
するが、その際に、ネストしたプロシージャの個数を管
理するために1つのバッファPROC_BUFFER、
1つのスタックPOSITION_STACK、変数P
ROC_FLAGを使用し、また変数NEXTをPRO
C_BUFFER内の位置を管理するために使用する。
The procedure start routine shown in FIG. 5 and the procedure end routine shown in FIG. 6 perform the binary encoding of the content according to the first embodiment of the present invention. One buffer PROC_BUFFER to manage,
One stack POSITION_STACK, variable P
Use ROC_FLAG and set the variable NEXT to PRO
Used to manage position in C_BUFFER.

【0061】PROC_BUFFERは例えば1個の物
理的に連続したメモリバッファ(すなわち、メモリ内で
物理的に隣合ったロケーションを占有する)であるか、
あるいは、シーケンシャルなアドレスを持つメモリバッ
ファ(すなわち、バッファ内の各ロケーションのアドレ
スが順に前のロケーションのアドレスに続く)である。
このメモリバッファは、複数のメモリバッファを持つ論
理的に連続したメモリバッファとすることも可能であ
る。これら複数のメモリバッファは、インデックスまた
はリンクリストデータ構造を利用して管理されるが、
これについては本発明の第2及び第3の実施例に関連し
て後に詳細に述べる。
PROC_BUFFER is, for example, one physically contiguous memory buffer (ie, occupies physically adjacent locations in memory), or
Alternatively, it is a memory buffer with sequential addresses (ie, the address of each location in the buffer sequentially follows the address of the previous location).
This memory buffer can also be a logically continuous memory buffer having a plurality of memory buffers. These multiple memory buffers are managed using an index or linked list data structure,
This will be described in detail later in connection with the second and third embodiments of the present invention.

【0062】図5のフローチャートに示したプロシージ
ャ開始ルーチン106は、例えばキャラクタ”{”で表
わされるプロシージャの先頭が検出された時に、メイン
コンテントバイナリ符号化ルーチン104によってコー
ルされる。プロシージャ開始ルーチンの最初のステップ
202は、変数PROC_FLAGが0であるか判定す
る。PROC_FLAGが0ならば、このルーチンはも
う一つのプロシージャの内部ではなく、符号化されるべ
き最初のルーチンである。処理の流れはライン204を
沿ってステップ206に進み、ここで216+2バイトの
メモリがPROC_BUFFER用に割り当てられる。
つぎにステップ208で、PRO_BUFFER内の位
置を管理するための変数NEXTを0に初期化する。
The procedure start routine 106 shown in the flowchart of FIG. 5 is called by the main content binary encoding routine 104 when the beginning of the procedure represented by the character "{" is detected, for example. The first step 202 of the procedure start routine determines if the variable PROC_FLAG is zero. If PROC_FLAG is 0, this routine is the first routine to be encoded, not inside another procedure. Process flow proceeds along line 204 to step 206, where 2 16 +2 bytes of memory are allocated for PROC_BUFFER.
Next, at step 208, the variable NEXT for managing the position in PRO_BUFFER is initialized to 0.

【0063】ステップ202においてPROC_FLA
Gが0でない場合、これはネストされたプロシージャで
あり、PROC_BUFFERが既に存在する。処理の
流れはライン210に沿ってステップ212へ進み、こ
こでNEXTの値が調べられ、NEXTが216−1より
大きいか調べることによってPROC_BUFFERは
当該プロシージャのために3バイト以上利用できるか判
定する。3バイト以上利用できないときには、処理の流
れはステップ214へ進み、エラーコード1を返す。こ
のエラーコードは、現在のルーチンを符号化するために
必要なスペースがPROC_BUFFERに残っていな
いことを意味する。後に詳述するが、第3実施例では、
ここで処理を終わりにするのではなく、二重リンクリス
トを用いてPROC_BUFFERを管理し、また、第
2実施例では配列インデックスを用いてPROC_BU
FFERを管理する。これら各実施例においては、新し
いバッファが割り当てられ、それに応じて変数が調整さ
れる。もし十分なスペースがあるときには、処理の流れ
はステップ216へ進む。
In step 202, PROC_FLA
If G is non-zero then this is a nested procedure and PROC_BUFFER already exists. The process flow proceeds along line 210 to step 212, where the value of NEXT is examined to determine if PROC_BUFFER is available for more than 3 bytes for the procedure by checking if NEXT is greater than 2 16 -1. . When 3 bytes or more cannot be used, the processing flow proceeds to step 214 and error code 1 is returned. This error code means that there is not enough space left in PROC_BUFFER to encode the current routine. As will be described later in detail, in the third embodiment,
Instead of ending the processing here, PROC_BUFFER is managed using a doubly linked list, and PROC_BU is used using an array index in the second embodiment.
Manage FFER. In each of these embodiments, a new buffer is allocated and the variables are adjusted accordingly. If there is sufficient space, then process flow proceeds to step 216.

【0064】ステップ216でNEXTを1だけインク
リメントし、そしてステップ226でPROC_BUF
FER(NEXT)に00Hをロードする。次にステッ
プ222で、NEXTの値がPOSISION_STA
CKにプッシュされる。NEXT値をPOSISION
_STACKにプッシュすることによって、ネストされ
たプロシージャの長さが最終的に書き込まれるPROC
_BUFFER内の位置が記憶される。
In step 216, NEXT is incremented by one, and in step 226, PROC--BUF.
Load 00H to FER (NEXT). Next, at step 222, the value of NEXT is POSITION_STA.
Pushed to CK. NEXT value to POSITION
PROC where the length of the nested procedure is finally written by pushing to _STACK
The position in _BUFFER is stored.

【0065】ステップ224でNEXTを1だけインク
リメントし、そしてステップ226でPROC_BUF
FER(NEXT)に00Hをロードする。PROC_
BUFFERに00Hをロードすることで、プロシージ
ャの長さが最終的に書き込まれるスペースを確保する。
プロシージャの長さのための2バイトを確保するた
め、”00H 00H”がバッファに書き込まれる。こ
れにより、1つのプロシージャ及びその中にネストされ
たプロシージャの長さは64Kバイトまで許される。必
要ならば2バイトを超えて使用でき、2バイトというの
は例にすぎない。ステップ228でNEXTを1だけイ
ンクリメントし、その結果、PROC_BUFFERに
書き込まれる情報は空き位置へ書き込まれるようにな
る。ステップ230でPROC_FLAGを1だけイン
クリメントするが、これはネストレベルを1だけ増加さ
せたことを意味する。そして、処理の流れはメインコン
テントバイナリ符号化ルーチン104へ戻る。
In step 224, NEXT is incremented by one, and in step 226, PROC--BUF.
Load 00H to FER (NEXT). PROC_
Loading 00H into BUFFER ensures the space where the procedure length is finally written.
"00H 00H" is written to the buffer to reserve 2 bytes for the length of the procedure. This allows up to 64 Kbytes in length for one procedure and procedures nested within it. If necessary, more than 2 bytes can be used, and 2 bytes is only an example. In step 228, NEXT is incremented by 1 so that the information written to PROC_BUFFER will be written to the empty position. In step 230, PROC_FLAG is incremented by 1, which means that the nesting level is increased by 1. Then, the process flow returns to the main content binary encoding routine 104.

【0066】プロシージャ開始ルーチン106が終了し
て、その他符号化ルーチン110によって情報のコンテ
ントが処理されている時に、コンテントのバイナリ表現
がPROC_BUFFERに書き込まれ、PROC_B
UFFERに1バイト書き込まれる毎にNEXTは1ず
つインクリメントされる。現プロシージャのコンテント
がその他符号化ルーチンによって処理されている時に、
このプロシージャに1つのプロシージャをネストさせ、
あるいは、プロシージャを終了させることができる。他
のプロシージャの開始が検出されると、図5に示したプ
ロシージャ開始ルーチン106が再びコールされる。プ
ロシージャの終了が検出されると、図6のプロシージャ
終了ルーチン108がメインコンテントバイナリ符号化
ルーチン104によりコールされる。
When the procedure start routine 106 is finished and the content of the information is being processed by the other encoding routine 110, the binary representation of the content is written to PROC_BUFFER and PROC_B.
NEXT is incremented by 1 each time one byte is written in UFFER. When the content of the current procedure is being processed by other encoding routines,
Nest one procedure in this procedure,
Alternatively, the procedure can be terminated. When the start of another procedure is detected, the procedure start routine 106 shown in FIG. 5 is called again. When the end of the procedure is detected, the procedure end routine 108 of FIG. 6 is called by the main content binary encoding routine 104.

【0067】図6のプロセスに示されたプロシージャ終
了ルーチン108の最初のステップ302において、P
ROC_FLAGが0より大きいか判定する。PROC
_FLAGが0より大きくない場合、プロシージャの始
まりがないのにプロシージャの終わりが検出されたとい
うことであるので、エラーが発生している。したがっ
て、処理の流れはステップ304へ進み、ここでエラー
コード2が返される。PROC_FLAGが0より大き
い場合、処理の流れはステップ306へ進み、ここでN
EXTの値を調べることによりバッファのオーバーフロ
ーが起こったか判定する。NEXTがバッファサイズよ
り大きいときは、このルーチンはステップ308でエラ
ーコード1を返しリターンする。バッファがオーバーフ
ローしていなければ、処理の流れはステップ310へ進
み、ここでPOSITION_STACKのトップの値
がポップされて、一時的に変数Pに格納される。ステッ
プ312で、バッファ内の次の位置の値つまりNEXT
を取り出し、これから現ルーチンの開始位置を表わすス
タック中の数値Pを差し引くことにより、今終了したプ
ロシージャの長さを調べ、そして位置の長さを格納する
ためにPROC_BUFFER内に2キャラクタが存在
するので、得られた値から2が差し引かれる。ステップ
314,316で、プロシージャの長さをPROC_F
LAGの長さフィールドに入れる。ステップ314は、
LENの値から最下位の2バイトを取り除き、最上位の
2バイトをPROC_BUFFERのP位置に書き込む
働きをする。ステップ316は、最下位の2バイトをP
ROC_BUFFERのP+1位置へ書き込む。次に、
今はネストされたプロシージャが1個未満であるので、
ステップ318でPROC_FLAGを1だけデクリメ
ントする。ステップ320でPROC_FLAGが0で
あると判定されたときは、これ以上ネストされたプロシ
ージャはないので、ステップ320において、PROC
_BUFFERの内容をTOKENSEQUENCE_
BUFFERへ追加することができる。TOKENSE
QUENCE_BUFFERは、SPDLのコンテント
部であるトークンシーケンス構造エレメントのバイナリ
符号を保持するバッファである。バイナリ符号化された
プロシージャを保持しているのはPROC_BUFFE
Rの初めのNEXTバイトだけであるので、これらのバ
イトだけTOKENSEQUENCE_BUFFERへ
追加するだけでよい。この追加を行なうための擬似コー
ドの例は、 TOKENSEQUENCE_BUFFER = PROC_BUFFER[i],i = 0
to NEXT-1 である。TOKENSEQUENCE_BUFFERは
どのような種類のメモリであってもよく、例えばランダ
ムアクセスメモリやディスクである。プロシージャ終了
メモリは終了し、処理はステップ324でメインコンテ
ントバイナリ符号化ルーチン104へリターンする。
In the first step 302 of the procedure termination routine 108 shown in the process of FIG.
Determine whether ROC_FLAG is greater than 0. PROC
If _FLAG is not greater than 0, it means that the end of the procedure has been detected without the beginning of the procedure, so an error has occurred. Therefore, the process flow proceeds to step 304, where error code 2 is returned. If PROC_FLAG is greater than 0, then process flow proceeds to step 306, where N
Determine if a buffer overflow has occurred by examining the value of EXT. If NEXT is larger than the buffer size, this routine returns error code 1 in step 308 and returns. If the buffer has not overflowed, the process flow proceeds to step 310, where the top value of POSITION_STACK is popped and temporarily stored in the variable P. In step 312, the value at the next position in the buffer, or NEXT
To determine the length of the procedure just finished by subtracting from it the number P in the stack representing the starting position of the current routine, and because there are two characters in PROC_BUFFER to store the length of the position. , 2 is subtracted from the obtained value. In steps 314 and 316, the procedure length is set to PROC_F.
Put in LAG length field. Step 314 is
It operates to remove the least significant 2 bytes from the value of LEN and write the most significant 2 bytes to the P position of PROC_BUFFER. Step 316 sets the two least significant bytes to P
Write to the P + 1 position of ROC_BUFFER. next,
Now there is less than one nested procedure, so
In step 318, PROC_FLAG is decremented by 1. If PROC_FLAG is determined to be 0 in step 320, there are no more nested procedures, so in step 320 PROC
_BUFFER contents to TOKENSEQUENCE_
Can be added to BUFFER. TOKENSE
QUENCE_BUFFER is a buffer that holds the binary code of the token sequence structure element that is the content part of SPDL. PROC_BUFFE holds the binary coded procedure
Since these are only the first NEXT bytes of R, we only need to add these bytes to TOKENSEQUENCE_BUFFER. An example of pseudo code to make this addition is TOKENSEQUENCE_BUFFER = PROC_BUFFER [i], i = 0
It is to NEXT-1. TOKENSEQUENCE_BUFFER may be any type of memory, such as random access memory or disk. The procedure termination memory is terminated and processing returns to the main content binary encoding routine 104 at step 324.

【0068】以下、トークンシーケンスのクリアテキス
ト表現をバイナリ表現へ変換する例について述べる。図
7はトークンシーケンスのクリアテキスト表現 1 1 ADD{1 ADD{1 ADD}} を示している。ここに示したトークンシーケンスは、簡
便にするため単純な数式しか含まないが、本発明は、よ
り複雑なネストしたルーチンにも適用できるものであ
る。また、プロシージャが初めにクリアテキストフォー
マットに符号化される必要はなく、ページ記述生成装置
やアプリケーションプログラムで直接にプロシージャを
バイナリ符号化フォーマットへ符号化することができ
る。図8(A)のステップAに示すように、バイナリ符
号化のステップAで、”1 1 ADD”がバイナリフ
ォーマットに変換されて、TOKENSEQUENCE
_BUFFERに入れられる。TOKENSEQUEN
CE_BUFFERは、コンテントバイナリ符号化ルー
チン102の出力を保持し、図1,図2及び図3のバイ
ナリSPDLファイル8の一部となることができる。
An example of converting a clear text representation of a token sequence into a binary representation will be described below. FIG. 7 shows a clear text representation of the token sequence 1 1 ADD {1 ADD {1 ADD}}. Although the token sequence shown here contains only simple mathematical formulas for simplicity, the invention is applicable to more complex nested routines. In addition, the procedure does not need to be first encoded in the clear text format, but the procedure can be directly encoded in the binary encoding format by the page description generation device or the application program. As shown in step A of FIG. 8 (A), in step A of binary encoding, "1 1 ADD" is converted into a binary format, and TOKENSEQUENCE is converted.
It is put in _BUFFER. TOKENSEQUEN
CE_BUFFER holds the output of the content binary encoding routine 102 and can be part of the binary SPDL file 8 of FIGS. 1, 2 and 3.

【0069】最初の”{”はプロシージャの始まりを示
すので、メインコンテント符号化ルーチン104は図5
に示したプロシージャ開始ルーチン106をコールす
る。プロシージャ開始ルーチンがコールされる時は、こ
れが最初のルーチンであるのでPROC_FLAGは0
であり、PROC_BUFFERのためのメモリが割り
当てられ、またNEXTは0にセットされる。そして、
PROC_BUFFERの位置0に67Hが入れられ、
位置1及び位置2に00Hが入れられる。00Hとして
確保された初めの長さフィールドはPROC_BUFF
ERの位置1にあるので、1がPOSISION_ST
ACKにプッシュされている。したがって、ステップB
の終わりにおいて、最初のルーチンが処理中であるから
PROC_FLAGは1であり、また、データが書き込
まれることになるPROC_BUFFER内のNEXT
位置は3であるのでNEXTは3である。
Since the first "{" indicates the beginning of the procedure, the main content encoding routine 104 is shown in FIG.
The procedure start routine 106 shown in FIG. When the procedure start routine is called, PROC_FLAG is 0 because this is the first routine.
, The memory for PROC_BUFFER is allocated, and NEXT is set to 0. And
67H is put in position 0 of PROC_BUFFER,
00H is put in position 1 and position 2. The first length field reserved as 00H is PROC_BUFF.
Position 1 of ER, so 1 is POSITION_ST
It has been pushed to ACK. Therefore, step B
At the end of the, PROC_FLAG is 1 since the first routine is processing, and NEXT in PROC_BUFFER will be written with data.
NEXT is 3 because position is 3.

【0070】キャラクタ”1 ADD”に出会って、そ
の他バイナリ符号化ルーチン110がコールされた時
に、その他バイナリ符号化ルーチンは”1 ADD”
をPROC_BUFFERの位置3,位置4,位置5
に、90H 01H 31Hというように変換する。P
ROC_BUFFER内の3つの位置が書き込み済みと
なったので、NEXTは3だけインクリメントされて6
になる。プロシージャが始まっても終わってもいないの
で、PROC_FLAGとPOSISION_STAC
Kは図8(B)のステップCに示すように変わらない。
When the character "1 ADD" is encountered and the other binary encoding routine 110 is called, the other binary encoding routine is "1 ADD".
To PROC_BUFFER position 3, position 4, position 5
To 90H 01H 31H. P
Since 3 positions in ROC_BUFFER have been written, NEXT is incremented by 3 and becomes 6
become. Since the procedure has not started or ended, PROC_FLAG and POSITION_STAC
K does not change as shown in step C of FIG.

【0071】2番目の”{”によって図5のプロシージ
ャ開始ルーチンがコールされ、このルーチンは67H
00H 00HをPROC_BUFFERの第6、第7
及び第8の位置へプッシュしてリターンし、NEXT=
9,PROC_FLAG=2となり、図8(B)のステ
ップDに示すように、POSITION_STACKは
トップエントリーとして7を、ボトムエントリーとして
1を、それぞれ保持する。
The second "{" calls the procedure start routine of FIG. 5, which is 67H.
00H 00H is the 6th and 7th of PROC_BUFFER
And push to the 8th position and return, NEXT =
9, PROC_FLAG = 2, and as shown in step D of FIG. 8B, POSITION_STACK holds 7 as the top entry and 1 as the bottom entry.

【0072】次に、その他符号化ルーチン110を使っ
て”1 ADD”が符号化され、図8(B)のステップ
Eに示すように、このルーチンは90H 01H 31
HをPROC_BUFFERの位置9,位置10,位置
11に書き込み、そしてNEXTは12までインクリメ
ントされる。
Next, "1 ADD" is encoded using the other encoding routine 110, and this routine executes 90H 01H 31 as shown in step E of FIG. 8B.
Write H to PROC_BUFFER at position 9, position 10, position 11 and NEXT is incremented to 12.

【0073】最初の”}”は1つのルーチンの終了を示
すので、図6に示したプロシージャ終了ルーチン108
がコールされる。POSITION_STACKのトッ
プから7がポップされ、また、LENは12−7−2=
3と計算される。プロシージャ終了ルーチンは00Hと
03HをPROC_BUFFERの位置7と位置8に書
き込む。また、1つのプロシージャが終了したので、P
ROC_FLAGは2から1へデクリメントされる。P
ROC_BUFFERにはもうキャラクタが書き込まれ
ていないので、NEXTは12のままである。これらの
変数は図8(B)のステップFに示される。
Since the first "}" indicates the end of one routine, the procedure end routine 108 shown in FIG.
Is called. 7 is popped from the top of POSITION_STACK, and LEN is 12-7-2 =
Calculated as 3. The procedure termination routine writes 00H and 03H to PROC_BUFFER at positions 7 and 8. Also, because one procedure is completed, P
ROC_FLAG is decremented from 2 to 1. P
Since no character has been written to ROC_BUFFER, NEXT remains 12. These variables are shown in step F of FIG.

【0074】次の”}”が再び図6のプロシージャ終了
ルーチンをコールし、このルーチンはPOSITION
_STACKから1をポップし、00Hと09HをPR
OC_BUFFERの位置1と位置2にプッシュする。
この括弧は最初のプロシージャの終了意味したので、こ
れ以上はネストしたプロシージャはなく、PROC_F
LAGは0にデクリメントされる。これらの値は図8
(B)のステップGに示されている。次に、図8(B)
のステップGに示すように、PROC_BUFFERの
NEXTバイトがTOKESEQUENCE_BUFF
ERに追加され、処理は終了する。
The next "}" again calls the procedure termination routine of FIG. 6, which is POSITION
Pop 1 from _STACK and PR 00H and 09H
Push OC_BUFFER to position 1 and position 2.
This parenthesis meant the end of the first procedure, so there are no more nested procedures, PROC_F
LAG is decremented to 0. These values are shown in Figure 8.
This is shown in step G of (B). Next, FIG. 8 (B)
As shown in step G of step 1, the NEXT byte of PROC_BUFFER is TOKESEQUENCE_BUFF.
It is added to the ER and the process ends.

【0075】以上の説明では、符号化したバイナリルー
チンの一時記憶のために1個のバッファPROC_BU
FFERを用い、長さ情報を書き込む位置を記憶するた
めに1個のスタックPOSITION_STACKを用
い、PROC_BUFFERの次の空き位置及びネスト
されたルーチンの数をそれぞれ記憶するために変数NE
XT及びPROC_FLAGを用いた。しかしながら、
本発明は、バッファのテーブルまたはバッファの多重リ
ンクリストを用いて実施可能である。
In the above description, one buffer PROC_BU is provided for temporary storage of the encoded binary routine.
One stack POSITION_STACK is used to store the position where the length information is written, and a variable NE is used to store the next empty position of PROC_BUFFER and the number of nested routines, respectively.
XT and PROC_FLAG were used. However,
The present invention can be implemented using a table of buffers or a multi-link list of buffers.

【0076】本発明のプロセスは、オペレーティング環
境またはアプリケーションソフトウエアのプリンタドラ
イバに適用可能である。例えば、本発明プロセスを実施
するデバイスドライバは、Microsoft Win
dows(登録商標)のようなオペレーティング環境用
のプリンタドライバの一部として利用できる。本発明を
実施するデバイスドライバは、WordPerfect
(登録商標)のようなアプリケーションソフトウエアに
直接付属させることもできる。いずれの場合であって
も、ドライバがSPDLバイナリ出力を生成する必要が
ある時に、本発明はネストされたプロシージャの処理を
高速化できるとともに、ファイルの必要記憶スペースを
削減できる。さらに、ファイルをネットワーク上で印刷
する場合には、ネットワーク上でのファイルの伝送時間
が減少し、そして、印刷前にファイルをバッファに格納
しなければならないとすると、そのバッファのサイズも
減少する。
The process of the present invention is applicable to printer drivers in operating environments or application software. For example, a device driver implementing the process of the present invention is a Microsoft Win.
It can be used as part of a printer driver for an operating environment such as dows (registered trademark). A device driver that implements the present invention is a WordPerfect.
It can also be directly attached to application software such as (registered trademark). In either case, when the driver needs to generate SPDL binary output, the present invention can speed up processing of nested procedures and reduce the required storage space for files. Furthermore, when printing a file over a network, the transmission time of the file over the network is reduced, and if the file must be buffered before printing, the size of that buffer is also reduced.

【0077】ネストされたテキストプロシージャを符号
化する従来方法に比べた本発明の主たる利点は、プロシ
ージャのバイナリ表現の一時記憶のためにバッファを1
個しか用いないことである。1個のバッファを使用する
と、バッファの管理のためのオーバーヘッドが減少す
る。多数のプロシージャがネストされた時に、従来技術
ではシステムが多数の不連続の記憶バッファを管理しな
ければならないため、オーバーヘッドが大きくなること
がある。また、複数のバッファを使用すると、複数のバ
ッファのためにメモリを割り当てなければならないこと
と、メモリが細分化されることから、メモリ使用効率も
悪化する。例えば、使用されるバッファ毎に、ある容量
のメモリを確保しなければならない。非常に多数の不連
続なバッファを確保した場合、データが一杯になりそう
なバッファがなくても、バッファがオーバーフローしな
いように各バッファのために十分なメモリを割り当てな
ければならない。しかし、本発明の第2実施例及び第3
実施例は、前のバッファが一杯になるまでは次のバッフ
ァを割り当てない。したがって、本発明のどの実施例に
おいても、多数の空きバッファを持つという問題はな
い。
The main advantage of the present invention over conventional methods of encoding nested text procedures is that one buffer is reserved for temporary storage of the binary representation of the procedure.
It is to use only one. Using one buffer reduces the overhead for managing the buffer. When many procedures are nested, the prior art may require large overhead due to the system having to manage many discontinuous storage buffers. Further, when a plurality of buffers are used, the memory usage efficiency is deteriorated because the memory must be allocated for the plurality of buffers and the memory is subdivided. For example, a certain amount of memory must be secured for each buffer used. If you have a very large number of non-contiguous buffers, you must allocate enough memory for each buffer so that the buffer does not overflow even if there is no buffer that is likely to fill up with data. However, the second and third embodiments of the present invention
The embodiment does not allocate the next buffer until the previous one is full. Therefore, there is no problem with having a large number of free buffers in any of the embodiments of the present invention.

【0078】さらに、複数の不連続バッファが用いら
れ、2つのバッファの間にある1つのバッファが、その
プロシージャが変換されたために、もう必要でなくなっ
たとしても、そのバッファに割り当てられたメモリは必
ずしも利用可能ではない。このバッファ用のメモリを解
放することによりメモリは細分化され、新たに解放され
たメモリは、所要の情報を格納するには小さすぎるであ
ろうから、必ずしも直ちに利用可能とはならない。細分
化されたメモリを解放するためにガーベージ・コレクシ
ョン(garbage colelection)手順
を行なうことも可能であるが、この手順は時間がかかる
うえに、連続したスペースが得られないこともある。し
たがって、本発明は、複数のバッファの管理のためのオ
ーバーヘッドを不要にし、かつ、複数のバッファに関連
したメモリ細分化によりメモリを浪費しないことによっ
て、メモリ及びプロセッサ時間をより効率的に利用でき
る。本発明の第1実施例は、ネストされたルーチンを符
号化するための非常に効率的な方法及び装置を提供す
る。しかし、第1実施例のプロセスの欠点は、1つの大
きなバッファ(例えば64Kサイズのバッファ)を割り
当てなければないが、そのバッファ全体が一杯になるこ
とは殆どないということである。したがって、ネストさ
れたルーチンをバイナリに符号化しているコンピュータ
システムのメモリが比較的小容量である場合、64Kの
メモリをPROC_BUFFERに割り当てたくはない
であろう。
Furthermore, even if multiple discontinuous buffers are used and one buffer between the two buffers is no longer needed because the procedure was converted, the memory allocated to that buffer is Not always available. Releasing the memory for this buffer subdivides the memory so that the newly released memory will not be immediately available because it will be too small to store the required information. Although it is possible to perform a garbage collection procedure to free the fragmented memory, this procedure is time consuming and may not provide contiguous space. Therefore, the present invention makes more efficient use of memory and processor time by eliminating the overhead of managing multiple buffers and by not wasting memory due to memory fragmentation associated with multiple buffers. The first embodiment of the present invention provides a very efficient method and apparatus for encoding nested routines. However, a drawback of the process of the first embodiment is that although one large buffer (for example, a 64K size buffer) must be allocated, the entire buffer is rarely full. Therefore, if the memory of the computer system encoding the nested routines in binary is relatively small, then one would not want to allocate 64K of memory to PROC_BUFFER.

【0079】1つの大きなPROC_BUFFERを使
用する問題に対する1つの解決策は、多数の小バッファ
を、必要になった時に割り当てて使用することである。
複数の小バッファの使用は、複数の小バッファが論理的
に連続するように割り当てられるならば、1つの大きな
記憶バッファを使用することとほぼ同じことになる。複
数の小バッファを論理的に連続するように割り当てると
は、小バッファの1つが一杯になった時に、そのバッフ
ァの論理的な終端にもう一つの小バッファが付加され
る、ということになろう。複数のバッファを使用すると
いっても、各プロシージャ毎に1個のバッファを持つの
ではなく、複数のプロシージャは、符号化されて、ある
バッファに、それが一杯になるまで、格納される。その
バッファが一杯になった後に、もう1つのバッファが前
のバッファの論理的な終端に付加される。各バッファ
は、メモリロケーションが物理的に隣接している必要は
なく、前のバッファの論理的な終端に続いていると見做
せればたりる。
One solution to the problem of using one large PROC_BUFFER is to allocate and use a large number of small buffers when needed.
The use of multiple small buffers is approximately the same as using one large storage buffer if the multiple small buffers are assigned to be logically contiguous. Allocating multiple small buffers logically contiguously means that when one of the small buffers is full, another small buffer is added to the logical end of that buffer. . Although using multiple buffers, rather than having one buffer for each procedure, multiple procedures are encoded and stored in a buffer until it is full. After that buffer is full, another buffer is added to the logical end of the previous buffer. Each buffer need not be physically contiguous in memory locations, but may be considered to follow the logical end of the previous buffer.

【0080】図9は、本発明の第2実施例で用いられる
メモリ構造を示している。1つの配列B_Pointe
r_Arrayがあり、これは複数の論理的に連続した
バッファを管理するために用いられる。B_Point
er_Arrayの第1のエントリーは最初のバッファ
buffer0 を指し示す。buffer0 が一杯に
なった時に、B_Pointer_Arrayの第2の
エントリーが書き込まれ、それは第2のバッファbuf
fer1 を指し示す。このような方法で必要に応じて
バッファが割り当てられる。各バッファの長さは、例え
ば512バイトまたは1Kバイトである。
FIG. 9 shows a memory structure used in the second embodiment of the present invention. One array B_Pointe
There is r_Array, which is used to manage multiple logically contiguous buffers. B_Point
The first entry in er_Array points to the first buffer, buffer 0 . When buffer 0 is full, the second entry of B_Pointer_Array is written, which is the second buffer buf.
Indicates fer 1 . In this way, buffers are allocated as needed. The length of each buffer is, for example, 512 bytes or 1 Kbyte.

【0081】本実施例において、第1実施例と同様、バ
ッファのどこに位置情報を書き込むべきかを管理するこ
とが有用である。したがって、第1実施例で行なったよ
うにPOSITION_STACK内の1つの変数を管
理する代わりに、各プロシージャの開始に関して2つの
変数、すなわち、どのバッファに書き込むべきかを指示
する配列インデックス(ARRAY INDEX)と、
長さ情報を書き込むべき位置を指示するバッファインデ
ックス(BUFFER INDEX)とが記憶される。
このような情報は、図10に示したPOSITION_
STACKで管理される。
In the present embodiment, as in the first embodiment, it is useful to manage where in the buffer the position information should be written. Therefore, instead of managing one variable in POSITION_STACK as done in the first embodiment, two variables for the start of each procedure, namely an array index (ARRAY INDEX) that indicates which buffer to write to. ,
A buffer index (BUFFER INDEX) indicating the position where the length information should be written is stored.
Such information can be obtained by using the POSITION_
It is managed by STACK.

【0082】図11は、本発明の第2実施例のプロセス
により用いられるプロシージャ開始ルーチンを示す。1
つのプロシージャが開始した時に、図11のプロセスが
コールされ、そしてステップ400において、変数PR
OC_FLAGが0であるか調べられる。本実施例にお
けるPROC_FLAGは、第1実施例と同じ目的を持
っており、ルーチンのネスティングレベルの管理のため
に利用される。図11のプロセスは文書が最初に符号化
される時にコールされる。したがって、まだ全くプロシ
ージャは処理されていないのでPROG_FLAGは0
である。処理の流れはステップ402に進み、ここでど
のバッファを使用すべきか指示するインデックスi_b
と、そのバッファ内の位置を示すインデックスj_bは
両方とも0にセットされる。
FIG. 11 shows the procedure start routine used by the process of the second embodiment of the present invention. 1
When one procedure is started, the process of FIG. 11 is called, and in step 400 the variable PR
It is checked whether OC_FLAG is 0. PROC_FLAG in this embodiment has the same purpose as in the first embodiment and is used for managing the nesting level of the routine. The process of FIG. 11 is called when the document is first encoded. Therefore, PROG_FLAG is 0 because no procedure has been processed yet.
Is. The process flow proceeds to step 402, where an index i_b indicating which buffer should be used.
And both the index j_b indicating the position in the buffer are set to 0.

【0083】ステップ404はバッファ割り当てルーチ
ンをコールする。バッファ割り当てルーチンは、例えば
512バイト長または1Kバイト長の1つの新しいバッ
ファを割り当て、このバッファへのポインタを、B_P
ointer_Arrayのi_b位置に書き込む。ス
テップ404でバッファが割り当てられた後、ステップ
406は、使用すべきバッファが配列ポインタB_Po
inter_Array(i_b)によって指し示され
るバッファであることを指示する。
Step 404 calls the buffer allocation routine. The buffer allocation routine allocates one new buffer having a length of 512 bytes or 1 Kbyte, for example, and assigns a pointer to this buffer to B_P.
Write to the i_b position of the pointer_Array. After the buffer is allocated in step 404, step 406 determines if the buffer to be used is the array pointer B_Po.
Indicates that it is the buffer pointed to by inter_Array (i_b).

【0084】ステップ408は、バッファのj_b位置
を67Hにセットし、ルーチンの先頭であることを示
す。ステップ410はj_bをインクリメントし、ステ
ップ412は00HをBUFFER(j_b)に書き込
む。本発明の第1実施例に関して説明したように、00
Hは長さ情報の第1バイトで、そこにルーチンの長さ情
報が最終的に書き込まれる。この長さ情報用に確保され
た位置は、その後に書き込まれるので、ステップ414
でPOSITION_STACKにプッシュされるが、
記憶しておく必要はない。というのは、スキャン処理や
その他の方法を利用して、位置情報がどこに保存された
か調べることができるからである。配列ポインタとバッ
ファインデックスの両方がスタックにプッシュされる。
Step 408 sets the j_b position of the buffer to 67H, indicating the beginning of the routine. Step 410 increments j_b and step 412 writes 00H to BUFFER (j_b). As described with respect to the first embodiment of the present invention, 00
H is the first byte of the length information, and the length information of the routine is finally written therein. The position reserved for this length information is written after that, so step 414.
Will push you to POSITION_STACK,
You don't have to remember it. This is because scanning processes and other methods can be used to find out where the location information was stored. Both the array pointer and the buffer index are pushed onto the stack.

【0085】ステップ416はカウンタj_bをインク
リメントし、ステップ418でバッファのj_b位置に
00Hを書き込むことによって、ルーチンの長さ情報の
第2バイト用のスペースを確保する。そしてステップ4
20がカウンタj_bをインクリメントする。次に処理
の流れはステップ442へ進み、ここで変数PROC_
FLAGは1だけインクリメントされ、1つのプロシー
ジャが現在処理中であることを示す。
Step 416 increments the counter j_b and writes 00H to j_b position of the buffer in step 418 to reserve space for the second byte of routine length information. And step 4
20 increments the counter j_b. Next, the process flow advances to step 442, where the variable PROC_
FLAG is incremented by 1 to indicate that one procedure is currently in process.

【0086】ステップ400でPROC_FLAGが0
でないと判定された場合、現プロシージャは最初の処理
中プロシージャでないので、処理はステップ422へ進
む。ステップ422において、使用中の現バッファに追
加情報に利用可能なバイトが1バイト以上あるか調べる
ため、図12に示すルーチンAがコールされる。
In step 400, PROC_FLAG is set to 0.
If not, the current procedure is not the first in-process procedure and the process proceeds to step 422. In step 422, routine A shown in FIG. 12 is called to see if there is more than one byte available for additional information in the current buffer being used.

【0087】図12に示すメモリチェックルーチンAに
入ると、ステップ450でインデックスj_bがL以上
であるか判定する。ここでLはバッファの長さで、例え
ば512バイトまたは1Kバイトである。インデックス
j_bがL以上であれば、バッファの終わりに達したの
で、新しい1つのバッファを割り当てなければならな
い。ステップ452はバッファ割り当てルーチンをコー
ルする。このバッファ割り当てルーチンは、追加するバ
ッファのためにメモリを割り当て、このバッファへのポ
インタをB_Pointer_Arrayに書き込む。
この一例が図9に示されている。次に、ステップ454
はバッファのインデックスj_bを0にセットし、使用
するべきバッファを指示するインデックスi_bを1だ
けインクリメントする。次にステップ456は割り当て
られたメモリバッファへのポインタをB_Pointe
r_Arrayのi_b位置に格納する。最後に、ステ
ップ458は使用すべきバッファが新しく割り当てられ
たバッファであることを指示する。処理はステップ45
8からメモリチェックルーチンをコールしたステップへ
リターンする。
When the memory check routine A shown in FIG. 12 is entered, it is determined in step 450 whether the index j_b is L or more. Here, L is the length of the buffer, which is, for example, 512 bytes or 1 Kbyte. If the index j_b is greater than or equal to L, then the end of the buffer has been reached and a new buffer must be allocated. Step 452 calls the buffer allocation routine. This buffer allocation routine allocates memory for the buffer to be added and writes a pointer to this buffer in B_Pointer_Array.
An example of this is shown in FIG. Then, step 454
Sets the buffer index j_b to 0 and increments the index i_b indicating the buffer to be used by 1. Next, step 456 sets the pointer to the allocated memory buffer to B_Pointe.
Store in the i_b position of r_Array. Finally, step 458 indicates that the buffer to use is a newly allocated buffer. The process is step 45.
Return from 8 to the step where the memory check routine is called.

【0088】図11に戻って、ステップ424はバッフ
ァのj_b位置を67Hにセットする。ステップ426
はインデックスj_bを1だけインクリメントする。バ
ッファのもう1つのエントリーが書き込まれようとして
いるので、バッファの終わりに達したかチェックしなけ
ればならない。そこで、ステップ428でルーチンAつ
まりメモリチェックルーチンが再びコールされる。処理
がメモリチェックルーチンから図11の処理に戻ると、
ステップ430はアクティブなバッファのj_b位置に
00Hを書き込む。この位置は長さ情報が最終的に書き
込まれる場所であるので、インデックスj_bとi_b
の値はPOSITON_STACKにプッシュされる。
Returning to FIG. 11, step 424 sets the j_b position of the buffer to 67H. Step 426
Increments the index j_b by 1. Another entry in the buffer is about to be written, so we have to check if the end of the buffer has been reached. Then, in step 428, the routine A, that is, the memory check routine is called again. When the process returns from the memory check routine to the process of FIG. 11,
Step 430 writes 00H to the j_b position of the active buffer. Since this position is the place where the length information is finally written, indexes j_b and i_b
Value is pushed into POSITION_STACK.

【0089】次に、ステップ434はインデックスj_
bをインクリメントし、そして、バッファに追加情報の
ための十分なメモリがあることを確かめるためバッファ
がチェックされ、図12のメモリチェックルーチンAが
再びコールされる。図12から処理が戻ると、ステップ
438は00Hをバッファのj_b位置に書き込み、ル
ーチンの長さの位置情報のための第2バイトを確保す
る。続いて、ステップ440でインデックスj_bがイ
ンクリメントされる。ステップ441はメモリチェック
ルーチンAをコールする。しかし、バッファへの書き込
み前にファイルを符号化するルーチンがメモリチェック
ルーチンをコールした場合には、ステップ441でメモ
リチェックルーチンAをコールしなくともよい。ステッ
プ442で、PROC_FLAGは1だけインクリメン
トされ、ネストしたプロシージャがもう1つあることを
表示する。
Next, in step 434, the index j_
The buffer is checked to increment b, and to make sure that the buffer has enough memory for additional information, the memory check routine A of FIG. 12 is called again. When processing returns from FIG. 12, step 438 writes 00H to the j_b position of the buffer to reserve a second byte for position information of the length of the routine. Then, in step 440, the index j_b is incremented. Step 441 calls the memory check routine A. However, if the routine for encoding the file calls the memory check routine before writing to the buffer, the memory check routine A need not be called in step 441. At step 442, PROC_FLAG is incremented by 1 to indicate that there is another nested procedure.

【0090】プロシージャ開始ルーチンから処理がリタ
ーンした後、ルーチンがバイナリに符号化される。ルー
チンの格納のために使用されるバッファの1つに符号化
された各バイトが書き込まれる前に、書き込もうとする
バッファが一杯でないことを確認するため図12に示す
メモリチェックルーチンがコールされる。もしバッファ
が一杯であれば、メモリチェックルーチンは1つの追加
バッファを割り当て、このバッファに符号化されたバイ
トが書き込まれる。ルーチンの処理中に新しいプロシー
ジャの始まりに出会った場合、図11のプロシージャ開
始ルーチンがコールされる。プロシージャの終わりで出
会った時には、図13に示した本発明の第2実施例のプ
ロセスのプロシージャ終了ルーチンがコールされる。
After processing returns from the procedure start routine, the routine is encoded in binary. Before each byte encoded in one of the buffers used for storing the routine is written, the memory check routine shown in FIG. 12 is called to make sure the buffer to be written is not full. If the buffer is full, the memory check routine allocates one additional buffer and the encoded bytes are written to this buffer. If the beginning of a new procedure is encountered while processing the routine, the procedure start routine of FIG. 11 is called. When encountered at the end of the procedure, the procedure termination routine of the process of the second embodiment of the present invention shown in FIG. 13 is called.

【0091】図13において、ステップ500でPRO
C_FLAGが0より大きいか調べることによってエラ
ーチェックが行なわれる。PROC_FLAGが0より
大きくないときは、ルーチンの終わりに出会ったにもか
かわらず、対応した始まりに出会わなかったということ
である。したがって、ステップ502はエラーコード2
を返して、対応したプロシージャ開始のないプロシージ
ャ終了を表示する。
In FIG. 13, in step 500, PRO
Error checking is done by checking if C_FLAG is greater than zero. If PROC_FLAG is not greater than 0, then the end of the routine was encountered but the corresponding beginning was not encountered. Therefore, step 502 returns error code 2
To display the procedure end without the corresponding procedure start.

【0092】PROC_FLAGが0より大きい場合
は、処理の流れはステップ504に進み、ここでトップ
のエントリーが位置スタックPOSITION_STA
CKからポップされ、配列インデックスはSi_bに書
き込まれ、アレイ位置がSj_bに書き込まれる。符号
化されたルーチンの長さがステップ506で計算され
る。ステップ508は、ルーチンの長さ情報の第1バイ
トが書き込まれるべき位置を保持しているバッファをア
クティブなバッファとする。次にステップ510は、こ
のバッファのSj_b位置に長さ情報の第1バイトを書
き込む。ステップ512は、長さ情報の第2バイトをバ
ッファに書き込みできるようにバッファ位置のインデッ
クスを1だけインクリメントする。ステップ514は、
バッファの位置を調べ、バッファインデックスに1を加
えた値がバッファの実際の長さより大きくなるか判定す
る。バッファインデックスがバッファの長さを超えると
きは、処理はステップ516に進み、使用中バッファが
1だけインクリメントされ、ステップ518で次のバッ
ファ内の位置が0にセットされる。
If PROC_FLAG is greater than 0, then flow proceeds to step 504 where the top entry is the position stack POSITION_STA.
Popped from CK, array index is written to Si_b and array position is written to Sj_b. The length of the encoded routine is calculated at step 506. Step 508 makes the buffer holding the position where the first byte of the length information of the routine is to be written the active buffer. Next, step 510 writes the first byte of length information to the Sj_b position of this buffer. Step 512 increments the buffer position index by 1 so that the second byte of length information can be written to the buffer. Step 514 is
The position of the buffer is checked to determine whether the value obtained by adding 1 to the buffer index is larger than the actual length of the buffer. If the buffer index exceeds the length of the buffer, processing proceeds to step 516 where the buffer in use is incremented by 1 and at step 518 the position in the next buffer is set to 0.

【0093】ステップ520き長さ情報の第2バイトを
現バッファのSj_b位置に書き込む。次に、ステップ
522はPROC_FLAGを1だけインクリメントし
て、ネストされたプロシージャがもうないことを表示す
る。
In step 520, the second byte of the length information is written in the Sj_b position of the current buffer. Next, step 522 increments PROC_FLAG by 1 to indicate that there are no more nested procedures.

【0094】ステップ524はPROC_FLAGが0
であるか調べる。0ならば、もうネストされたプロシー
ジャがないので、ステップ526で、バッファのi_b
*L+j_bバイトをTOKENSEQUENCE_B
UFFERに付加すべきである。ステップ526はbu
ffer0 の内容をTOKENSEQUENCE_B
UFFERに付加し、また、buffer0 に続くバ
ッファが存在するならば、それらもTOKENSEQU
ENCE_BUFFERに付加する。バッファをTOK
ENSEQUENCE_BUFFERに付加する機能を
実行する擬似コードの例は次のとおりである。
In step 524, PROC_FLAG is 0.
Check if If it is 0, there are no more nested procedures, so in step 526, the buffer i_b
* L + j_b bytes to TOKENSEQUENCE_B
Should be added to UFFER. Step 526 is bu
The contents of ffer 0 are set to TOKENSEQUENCE_B
If there are buffers added to UFFER and following buffer 0 , they are also TOKENSEQU
Append to ENCE_BUFFER. TOK the buffer
The following is an example of pseudo code that performs the function of appending to ENSEQUENCE_BUFFER.

【0095】 append B_Pointer_Array
[i],i=0...(i_b−1) buffer=B_Pointer_Array[i_
b] append buffer[j],j=0...(j
_b−1) 上記擬似コードの第1行は、満杯の全バッファをTOK
ENSEQUENCE_BUFFERに付加する。第2
行は満杯でない最後のバッファを現バッファに設定す
る。第3行は満杯でない最後のバッファの内容をTOK
ENSEQUENCE_BUFFERに付加する(ただ
し、バッファの最後のバイトより後のバイトは付加しな
い)。
Append B_Pointer_Array
[I], i = 0. . . (I_b-1) buffer = B_Pointer_Array [i_
b] append buffer [j], j = 0. . . (J
_B-1) The first line of the above pseudo code is to TOK all the full buffers.
Append to ENSEQUENCE_BUFFER. Second
The line sets the last buffer that is not full as the current buffer. The third line TOKs the contents of the last buffer that is not full
Append to ENSEQUENCE_BUFFER (but not after the last byte of the buffer).

【0096】ステップ524でPROC_FLAGが0
でないと判定した場合には、最初のネストされたルーチ
ンのレベルに到達しておらず情報を引き続きバッファに
書き込まなければならない。ステップ528は、ステッ
プ508で前にプロシージャの長さ情報を書き込みでき
るようアクティブバッファを変更したように、現バッフ
ァを最終バッファに等しくセットする。続いて、プロシ
ージャ終了ルーチンは、それをコールしたメインバイナ
リ符号化ルーチンへリターンする。
In step 524, PROC_FLAG is set to 0.
Otherwise, the level of the first nested routine has not been reached and the information must continue to be written to the buffer. Step 528 sets the current buffer equal to the last buffer, as previously modified in step 508 to change the active buffer to allow writing procedure length information. The procedure termination routine then returns to the main binary encoding routine that called it.

【0097】図9から図13に示した本発明の第2実施
例は、本発明者の知る限りでは、論理的に連続した複数
のメモリバッファを利用するための最も効率的な実施例
である。しかしながら、本発明の第3の実施例があり、
これも論理的に連続したメモリバッファを使用するが、
ポインタ配列の代わりに二重リンクリストデータ構造を
用いて図9乃至図13の第2実施例で使用した論理的に
連続したメモリバッファを管理する。
The second embodiment of the present invention shown in FIGS. 9 to 13 is the most efficient embodiment for utilizing a plurality of memory buffers which are logically continuous, as far as the present inventor knows. . However, there is a third embodiment of the invention,
This also uses a logically contiguous memory buffer,
A doubly linked list data structure is used instead of the pointer array to manage the logically contiguous memory buffers used in the second embodiment of FIGS.

【0098】図14は、ネストされたルーチンの保持の
ための複数の論理的に連続なバッファを管理するために
本発明の第3実施例により使用される二重リンクリスト
データ構造を示す。この二重リンクリストデータ構造
は、その第1のエントリーとして、前の二重リンクリス
トデータ構造を指し示すポインタ(PREVIOUS)
を有する。二重リンクリストデータ構造が最初のもので
あれば、PREVIOUSポインタはヌル(NULL)
を指す。二重リンクリストデータ構造の第2のエントリ
ーは、当該データ構造のバッファと論理的に連続したバ
ッファを含む次の二重リンクリストデータ構造を指し示
すポインタ(NEXT)である。ここで、論理的に連続
した複数のバッファとは、複数のバッファが1つのバッ
ファであると見做すことが可能で、かつ、その1つの終
端にもう1つのバッファが続き、1つのバッファの終端
に入り切らない情報はもう1つのバッファの先頭に格納
される、ことを意味する。現バッファがまだ満杯になら
ない時には、後続のバッファは存在しないから、NEX
Tポインタはヌルを指す。二重リンクリストデータ構造
の”LEVEL”エントリーの役割は、リンクリストデ
ータ構造の番号を示すことである。最初のデータ構造の
レベルは0で、それ以降のデータ構造のレベルは順に1
ずつ増加する。二重リンクリストデータ構造の最後のエ
ントリーは、符号化中のプロシージャを保持するための
バッファである。このバッファはLの長さを持ち、これ
は例えば512バイトまたは1Kバイトである。指定さ
れているバッファを示すためにインデックスjが用いら
れる。
FIG. 14 shows a doubly linked list data structure used by the third embodiment of the invention to manage a plurality of logically contiguous buffers for holding nested routines. This doubly linked list data structure has as its first entry a pointer (PREVIOUS) pointing to the previous doubly linked list data structure.
Have. PREVIOUS pointer is NULL if the doubly linked list data structure is the first.
Refers to. The second entry of the doubly linked list data structure is a pointer (NEXT) that points to the next doubly linked list data structure that contains a buffer that is logically contiguous with the buffer of that data structure. Here, a plurality of logically consecutive buffers can be regarded as one buffer, and one end thereof is followed by another buffer. It means that the information that does not fit in the end is stored in the head of another buffer. When the current buffer is not yet full, there is no subsequent buffer, so NEX
The T pointer points to null. The role of the "LEVEL" entry of the doubly linked list data structure is to indicate the number of the linked list data structure. The first data structure level is 0, and the subsequent data structure levels are 1 in order.
It increases in steps. The last entry in the doubly linked list data structure is a buffer to hold the procedure being encoded. This buffer has a length of L, which is, for example, 512 bytes or 1 Kbyte. The index j is used to indicate the designated buffer.

【0099】ネストされたプロシージャに遭遇するたび
に、そのプロシージャの長さが書き込まれる位置情報を
記憶することは有用である。どこに位置情報が書き込ま
れるべきか管理するために、図15に示すPOSITI
ON_STACKが用いられる。このPOSITION
_STACKはネストされた各ルーチン毎に2つのエン
トリーを持っている。長さ情報が書き込まれるバッファ
内の位置に対応したエントリーjと、どのバッファに情
報が書き込まれるべきかを示すエントリーLEVELと
がある。
Each time a nested procedure is encountered, it is useful to store location information where the length of that procedure is written. In order to manage where the location information should be written, the POSITI shown in FIG.
ON_STACK is used. This POSITION
_STACK has two entries for each nested routine. There is an entry j corresponding to the position in the buffer where the length information is written, and an entry LEVEL which indicates in which buffer the information should be written.

【0100】図16は、符号化中のプロシージャが3個
のバッファを必要とするような場合に生成されるデータ
構造の一例を示す。1番目の二重リンクリストデータ構
造はレベルが0で、PREVIOUSポインタは前の二
重リンクリストデータ構造がないのでヌルを指し、NE
XTポインタはその下の二重リンクリストデータ構造を
指す。レベル1の二重リンクリストデータ構造は、レベ
ル0の二重リンクリストデータ構造のNEXTポインタ
によって指し示される。レベル1のリンクリストデータ
構造のPREVIOUSポインタはレベル0のデータ構
造を指し示し、NEXTポインタはレベル2のデータ構
造を指し示す。3番目のデータ構造はレベルが2であ
り、そのPREVIOUSポインタによってレベル1の
データ構造を指し示し、また、そのNEXTポインタは
次の二重リンクリストデータ構造がないのでヌルを指
す。
FIG. 16 shows an example of the data structure generated when the procedure being encoded requires three buffers. The first doubly linked list data structure has level 0, and the PREVIOUS pointer points to null because there is no previous doubly linked list data structure.
The XT pointer points to the underlying doubly linked list data structure. The level 1 doubly linked list data structure is pointed to by the NEXT pointer of the level 0 doubly linked list data structure. The PREVIOUS pointer of the level 1 linked list data structure points to the level 0 data structure, and the NEXT pointer points to the level 2 data structure. The third data structure is level 2 and points to the level 1 data structure by its PREVIOUS pointer, and its NEXT pointer points to null since there is no next doubly linked list data structure.

【0101】本発明の第3実施例のプロシージャ開始ル
ーチンは図17に示されているが、これはプロシージャ
の始まりに遭遇した時に用いられる。本発明の第3実施
例のプロシージャ開始ルーチンは、二重リンクリストデ
ータ構造とともに用いられるが、第2実施例で使用され
た複数の論理的に連続したバッファを管理する配列/イ
ンデックス法のために利用される図11に示したプロシ
ージャ開始ルーチンと類似している。
The procedure start routine of the third embodiment of the present invention is shown in FIG. 17, which is used when the beginning of the procedure is encountered. The procedure start routine of the third embodiment of the present invention is used with a doubly linked list data structure, but for the array / index method managing the plurality of logically contiguous buffers used in the second embodiment. It is similar to the procedure start routine shown in FIG. 11 utilized.

【0102】例えばメインバイナリ符号化ルーチンによ
って、このプロシージャ開始ルーチンがコールされた時
に、ステップ600はPROC_RLAGが0であるか
調べる。PROC_FLAGが0のときは、処理はステ
ップ602に進み、変数LEVEL,jが両方とも0に
セットされる。ステップ604はリンクリスト割り当て
ルーチンをコールし、これが最初の二重リンクリストデ
ータ構造を生成する。このデータ構造は、PREVIO
USポインタとNEXTポインタがともにヌルを指し、
LEVELは0であり、バッファは空でバッファ位置イ
ンデックスjは0である。ステップ606はLEVLE
Lで割り当てられたバッファを使用すべきバッファに設
定するが、1個のバッファが使用される時にはLEVE
Lは0である。ステップ608は67Hをバッファの最
初の位置に書き込む。ステップ610はバッファ位置イ
ンデックスjを1だけインクリメントする。ステップ6
12は、バッファのj位置を00Hにセットして、ルー
チンの長さ情報の最初のバイトが後に書き込まれるメモ
リを確保する。ステップ614はjとLEVELの値を
POSITION_STACKにプッシュし、これによ
って長さ情報が最終的に書き込まれる場所の位置情報が
記憶される。ステップ616はバッファインデックスj
を1だけインクリメントし、ステップ618は長さ情報
の第2バイトのためのもう1バイトをバッファ内に確保
する。ステップ620はインデックスjを1だけインク
リメントし、処理はステップ642へ進み、ここでPR
OC_FLAGが1だけインクリメントされることによ
り、次のネストされたルーチンが存在することを表示す
る。
When this procedure start routine is called, for example by the main binary encoding routine, step 600 checks if PROC--RLAG is zero. When PROC_FLAG is 0, the process proceeds to step 602, where variables LEVEL, j are both set to 0. Step 604 calls the linked list allocation routine, which creates the initial doubly linked list data structure. This data structure is PREVIO
Both the US and NEXT pointers point to null,
LEVEL is 0, the buffer is empty and the buffer position index j is 0. Step 606 is LEVLE
Set the buffer allocated in L to the buffer that should be used, but LEVE when one buffer is used
L is 0. Step 608 writes 67H to the first position in the buffer. Step 610 increments the buffer position index j by one. Step 6
12 sets the j position of the buffer to 00H to reserve memory where the first byte of the routine length information is later written. Step 614 pushes the values of j and LEVEL into POSITION_STACK, which stores the location information where the length information is finally written. Step 616 is buffer index j
Is incremented by 1 and step 618 reserves another byte in the buffer for the second byte of length information. Step 620 increments index j by 1, and the process proceeds to step 642, where PR
OC_FLAG is incremented by 1 to indicate that the next nested routine exists.

【0103】ステップ600でPROC_FLAGが0
でないと判定された場合、ステップ622は図18に示
すメモリチェックルーチンBをコールする。図18のメ
モリチェックルーチンは、アクティブなレジスタに情報
を書き込めるように、そのバッファ内にフリーのバイト
が少なくとも1バイト存在するか調べる。ステップ65
0でjがバッファの長さLより小さいと判定した場合、
バッファ内に少なくともまだ1バイトあるということで
あるので、処理の流れはステップ652に進み、そし
て、メモリチェックルーチンをコールしたプロセスへ進
む。バッファ長Lは例えば、512バイトまたは1Kバ
イトである。ステップ650で、インデックスjがL以
上であるときは、バッファの終わりに達しているので、
新しい二重リンクストデータ構造を生成する必要があ
る。ステップ654はバッファインデックスjを0にセ
ットし、バッファレベルを1だけインクリメントする。
次にステップ656はリンクリスト割り当てルーチンを
コールし、このルーチンが次の二重リンクリストデータ
構造を生成する。新しく生成されたリンクリストデータ
構造は、レベルが前の二重リンクリストデータ構造のレ
ベルより1だけ大きく、NEXTエントリーがヌルを指
し、PREVIOUSエントリーが前の二重リンクリス
トデータ構造を指す。前の二重リンクリストデータ構造
のNEXTエントリーは、ヌルを指していたが、新しく
生成された二重リンクリストデータ構造を指すように変
更される。次にステップ658は、新しく割り当てられ
たリンクリストのバッファを現バッファに設定し、つい
で処理はメモリチェックルーチンをコールしたプロシー
ジャへリターンする。
In step 600, PROC_FLAG is 0.
If not, step 622 calls the memory check routine B shown in FIG. The memory check routine of FIG. 18 checks to see if there is at least one free byte in its buffer so that information can be written to the active register. Step 65
When it is determined that j is smaller than the buffer length L at 0,
Since there is at least one byte in the buffer, processing flow proceeds to step 652 and then to the process that called the memory check routine. The buffer length L is, for example, 512 bytes or 1 Kbyte. If the index j is greater than or equal to L at step 650, then the end of the buffer has been reached, so
A new dual linked data structure needs to be created. Step 654 sets the buffer index j to 0 and increments the buffer level by 1.
Step 656 then calls the link list allocation routine, which creates the next doubly linked list data structure. The newly created linked list data structure is one level above the level of the previous doubly linked list data structure, the NEXT entry points to null, and the PREVIOUS entry points to the previous doubly linked list data structure. The NEXT entry of the previous doubly linked list data structure, which was pointing to null, is modified to point to the newly created doubly linked list data structure. Next, step 658 sets the buffer for the newly allocated linked list to the current buffer and then processing returns to the procedure that called the memory check routine.

【0104】処理が図17のフローチャートに戻ると、
ステップ624はバッファのj位置に67Hをセットす
る。ステップ626はjをインクリメントする。ステッ
プ628は再びメモリチェックルーチンをコールして、
バッファ内にフリーのバイトがあるか調べ、フリーのバ
イトがなければ、新しい二重リンクリストデータ構造を
割り当てる。次にステップ630はバッファのj位置に
00Hを書き込み、プロシージャの最初の長さバイトの
ためのメモリを確保する。次にステップ632はバッフ
ァ位置j及びLEVELを位置スタックに書き込む。こ
れによって、後に長さ情報が書き込まれる時に、その情
報を書き込むバッファ内位置が記憶される。この例では
長さ情報のために2バイトが使われるので、ステップ6
34でjが1だけインクリメントされる。そして、バッ
ファに1バイト以上残っていることを確認するため、ス
テップ634でメモリチェックルーチンが再びコールさ
れる。ステップ638は00Hを第2の長さバイトとし
てバッファに書き込み、ステップ640はバッファイン
デックスjを1だけインクリメントする。次に処理の流
れはステップ642へ進み、ここでPROC_FLAG
が1だけインクリメントされ、プロシージャがもう1つ
ネストされていることを表示する。
When the processing returns to the flowchart of FIG. 17,
Step 624 sets 67H in the j position of the buffer. Step 626 increments j. Step 628 calls the memory check routine again,
Check for free bytes in the buffer and if not, allocate a new doubly linked list data structure. Then step 630 writes 00H to the j position of the buffer to reserve memory for the first length byte of the procedure. Next, step 632 writes buffer location j and LEVEL to the location stack. Thus, when the length information is written later, the position in the buffer where the information is written is stored. In this example, 2 bytes are used for the length information, so step 6
At 34, j is incremented by 1. Then, in step 634, the memory check routine is called again to confirm that one or more bytes remain in the buffer. Step 638 writes 00H to the buffer as the second length byte and step 640 increments the buffer index j by one. Next, the process flow proceeds to step 642, where PROC_FLAG
Is incremented by 1 to show that the procedure is nested one more.

【0105】プロシージャ開始ルーチンが実行された
後、プロシージャのバイナリへの符号化中に、各バイト
のバッファへの書き込みに先立ち、バッファに1バイト
以上のフリーバイトがあることを確かめるためメモリチ
ェックルーチンBをコールしなければならない。もしバ
ッファ内に1バイト以上のフリーバイトがなければ、新
しいバッファ及び二重リンクリストデータ構造が割り当
てられる。
After the procedure start routine is executed, during encoding of the procedure into binary, the memory check routine B is checked to ensure that there is one or more free bytes in the buffer prior to writing each byte to the buffer. Have to call. If there is no more than one free byte in the buffer, a new buffer and doubly linked list data structure is allocated.

【0106】ルーチンの終わりを検出した時に、本発明
の第3実施例用の図19に示すプロシージャ終了ルーチ
ンがコールされる。ステップ700は、プロシージャの
終わりに対応する始まりが存在することを確かめるため
のエラーチェックを行なう。PROC_FLAGが0よ
り大きくなければ、プロシージャの始まりと終わりの数
が整合しないので、ステップ702はエラーコード2を
返して開始と終了が整合しないことを表示する。PRO
C_FLAGが0より大きいときは、処理の流れはステ
ップ704へ進み、ここで位置情報がバッファのどこに
書き込まれるべきかを示す情報がPOSITION_S
TACKよりポップされる。S_jはバッファ内の位置
インデックスを保持し、S_LEVELは位置情報を書
き込むべきバッファを指定する。
When the end of the routine is detected, the procedure termination routine shown in FIG. 19 for the third embodiment of the present invention is called. Step 700 performs an error check to make sure that there is a beginning that corresponds to the end of the procedure. If PROC_FLAG is not greater than 0, then the number of beginnings and endings of the procedure do not match, so step 702 returns error code 2 to indicate that the start and end do not match. PRO
When C_FLAG is greater than 0, the process flow proceeds to step 704, where the information indicating where in the buffer the position information should be written is POSITION_S.
Popped from TACK. S_j holds the position index in the buffer, and S_LEVEL specifies the buffer in which the position information should be written.

【0107】次にステップ706は、プロシージャの長
さを計算し、その長さを変数LENに書き込む。ステッ
プ708は、ステップ704でポップされたレベルのバ
ッファをアクティブバッファに設定する。ステップ71
0は長さ情報の第1バイトを書き込み、ついでステップ
712でポップされたバッファインデックスがインクリ
メントされる。ステップ714はポップされ1だけイン
クリメント後のバッファインデックスを調べ、このイン
デックスが現バッファの長さより大きいか判定する。大
きいときは、まさに次のバッファの先頭を使わなければ
ならないので、処理はステップ716に進み、バッファ
レベルがインクリメントされる。次にステップ718は
バッファのインデックスを0にセットする。ステップ7
20は長さ情報の第2バイトを書き込む。ステップ72
2はPROC_FLAGをデクリメントし、ネストされ
たもう1つのルーチンはないことを表示する。
Next, in step 706, the length of the procedure is calculated and the length is written in the variable LEN. Step 708 sets the buffer of the level popped in step 704 as the active buffer. Step 71
0 writes the first byte of length information, then the popped buffer index is incremented in step 712. Step 714 examines the buffer index after being popped and incremented by 1 to determine if this index is greater than the length of the current buffer. If so, the very beginning of the next buffer must be used, so processing proceeds to step 716 and the buffer level is incremented. Next, step 718 sets the buffer index to zero. Step 7
20 writes the second byte of length information. Step 72
2 decrements PROC_FLAG, indicating that there is no other routine nested.

【0108】ステップ724はネストされたルーチンが
残っていないか調べる。残っていなければ、ステップ7
26で、バッファの内容の(LEVEL*L+j)バイ
トがTOKENSEQUENCE_BUFFERに付加
される。本発明の第2実施例の場合と同様に、符号化さ
れたルーチンを格納しているバッファだけがTOKEN
SEQUENCE_BUFFERに付加される。TOK
ENSEQUENCE_BUFFERは、例えばランダ
ムアクセスメモリまたはディスクファイルでよい。この
ような付加操作は、第2実施例におけると同様の方法で
行なわれる。ステップ724でPROC_FLAGが0
より大きく、したがって、ネストされたルーチンがまだ
ある場合、ステップ728はバッファを、プロシージャ
終了ルーチンで出会う以前のレベルに戻す。そして、処
理はプロシージャ終了ルーチンをコールしたメイン符号
化ルーチンに戻る。
Step 724 checks if any nested routines remain. If not, step 7
At 26, the (LEVEL * L + j) bytes of the contents of the buffer are added to TOKENSEQUENCE_BUFFER. As in the second embodiment of the invention, only the buffer containing the encoded routine is TOKEN.
It is added to SEQUENCE_BUFFER. TOK
ENSEQUENCE_BUFFER may be, for example, random access memory or a disk file. Such an adding operation is performed by the same method as in the second embodiment. In step 724, PROC_FLAG is 0.
If it is larger, and thus there are still nested routines, step 728 returns the buffer to the level it was in before the procedure exit routine encountered. Then, the process returns to the main encoding routine that called the procedure termination routine.

【0109】なお、本発明は以上に説明した実施例その
ものに限定されるものではなく、様様に変形もしくは修
正して実施することができるものである。
The present invention is not limited to the above-described embodiment itself, but can be modified or modified in various ways.

【0110】[0110]

【発明の効果】以上の詳細な説明から理解されるよう
に、請求項1乃至40の各項に定義された本発明によれ
ば、クリアテキストSPDLファイルのようなネストさ
れたプロシージャのテキスト表現をバイナリフォーマッ
トへ変換するための効率的な方法及び装置を提供するこ
とができ、クリアテキストSPDLファイル等の記憶ス
ペース、通信回線を介してプリンタまたはネットワーク
へ伝送するのに必要な時間、印刷に必要な時間を大幅に
削減することができる。
As will be understood from the above detailed description, according to the present invention defined in each of claims 1 to 40, a text representation of a nested procedure such as a clear text SPDL file can be obtained. An efficient method and apparatus for converting to a binary format can be provided, and a storage space such as a clear text SPDL file, a time required for transmission to a printer or a network via a communication line, and a time required for printing. It can save a lot of time.

【0111】本発明によれば、符号化後のプロシージャ
の一時記憶のために、単一のメモリバッファ、または実
質的に一つの論理的に連続したメモリバッファとみなせ
る複数のメモリバッファを用いることにより、多数のプ
ロシージャがネストされている場合にも効率的な符号化
が可能である。
According to the present invention, by using a single memory buffer, or a plurality of memory buffers that can be regarded as substantially one logically contiguous memory buffer, for temporary storage of the procedure after encoding. , Efficient coding is possible even when many procedures are nested.

【0112】請求項3に定義されるように、文字どおり
単一のメモリバッファをバイナリ符号化後プロシージャ
の一時記憶バッファとして用いる発明によれば、従来の
複数のバッファを用いる方式に比べ、メモリ管理のため
のオーバーヘッドを大幅に減少させ、符号化の効率を大
きく向上させることができるとともに、メモリの細分化
と、それによるメモリ使用効率の低下の問題を解消でき
る。
According to the invention that literally uses a single memory buffer as a temporary storage buffer for a procedure after binary encoding, as defined in claim 3, compared with the conventional method using a plurality of buffers, the memory management Therefore, it is possible to significantly reduce the overhead for the above, greatly improve the efficiency of encoding, and solve the problem of the subdivision of the memory and the deterioration of the memory use efficiency due to the subdivision.

【0113】また、例えば請求項4、請求項6、請求項
11、請求項13等に定義される発明によれば、ポイン
タ配列または二重リンクリストデータ構造を用いて複数
のバッファを管理することにより、バイナリ符号化後の
プロシージャの一時記憶用バッファとして、複数のバッ
ファが論理的に連続するように割り当てられる。論理的
に連続するとは、各バッファが前のバッファの論理的な
終端に続いているということであり、メモリロケーショ
ンが物理的に隣合っている必要はない。このような論理
的に連続した複数のバッファは、全体として単一のバッ
ファとみなすことができる。そして、複数のバッファを
使用するといっても、従来のようにプロシージャ毎に小
バッファを1個ずつ持つのではなく、あるバッファが一
杯になった時に、このバッファの論理的な終端に次のバ
ッファを付加する。各バッファのオーバーフローを考え
る必要がないため、各バッファのサイズを従来より十分
に小さくすることができる。したがって、多数のプロシ
ージャがネストされた場合でも、従来のように比較的サ
イズの大きな空きバッファが多数、無用にメモリを占有
するということがなく、メモリ使用効率を大幅に改善で
きる。
According to the invention defined in claim 4, claim 6, claim 11, claim 13 or the like, a plurality of buffers are managed using a pointer array or a doubly linked list data structure. As a result, a plurality of buffers are allocated so as to be logically continuous as a temporary storage buffer for the procedure after binary encoding. Logically contiguous means that each buffer follows the logical end of the previous buffer and that memory locations do not have to be physically adjacent. A plurality of such logically consecutive buffers can be regarded as a single buffer as a whole. And, even if multiple buffers are used, instead of having one small buffer for each procedure as in the past, when a certain buffer becomes full, the logical end of this buffer becomes the next buffer. Is added. Since it is not necessary to consider the overflow of each buffer, the size of each buffer can be made sufficiently smaller than before. Therefore, even when a large number of procedures are nested, it is possible to significantly improve the memory usage efficiency without having to occupy the memory unnecessarily with a large number of relatively large free buffers as in the conventional case.

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

【図1】クリアテキストSPDLファイルをバイナリS
PDLファイルへ符号化する処理の概略フローチャート
である。
Figure 1: Clear text SPDL file in binary S
7 is a schematic flowchart of a process of encoding a PDL file.

【図2】本発明を実施するシステムのブロック図であ
る。
FIG. 2 is a block diagram of a system implementing the present invention.

【図3】図2のシステムの詳細ブロック図である。3 is a detailed block diagram of the system of FIG.

【図4】本発明に用いられるバイナリ符号化ルーチンの
ブロック図である。
FIG. 4 is a block diagram of a binary encoding routine used in the present invention.

【図5】本発明の第1実施例で用いられるプロシージャ
開始ルーチンの処理を説明するフローチャートである。
FIG. 5 is a flow chart illustrating processing of a procedure start routine used in the first embodiment of the present invention.

【図6】本発明の第1実施例で用いられるプロシージャ
終了ルーチンの処理を説明するフローチャートである。
FIG. 6 is a flowchart illustrating a procedure of a procedure end routine used in the first embodiment of the present invention.

【図7】クリアテキストフォーマットの簡単なトークン
シーケンスの一例である。
FIG. 7 is an example of a simple token sequence in clear text format.

【図8】(A)及び(B)は、本発明の第1実施例によ
り図7に示したクリアテキスト表現をバイナリフォーマ
ットに符号化するために用いられる変数を示す。
8A and 8B show variables used to encode the clear text representation shown in FIG. 7 into a binary format according to the first embodiment of the present invention.

【図9】本発明の第2実施例で用いられる複数のバッフ
ァ及び配列インデックスを示す。
FIG. 9 shows a plurality of buffers and array indexes used in the second embodiment of the present invention.

【図10】本発明の第2実施例のバッファ中に確保され
た長さ情報位置を管理するためのスタック構造を示す。
FIG. 10 shows a stack structure for managing a length information position secured in a buffer according to a second embodiment of the present invention.

【図11】本発明の第2実施例で用いられるプロシージ
ャ終了ルーチンを説明するフローチャートである。
FIG. 11 is a flowchart illustrating a procedure end routine used in the second embodiment of the present invention.

【図12】本発明の第2実施例のプロシージャ開始ルー
チンによりコールされるメモリチェックルーチンの説明
図である。
FIG. 12 is an explanatory diagram of a memory check routine called by a procedure start routine according to the second embodiment of this invention.

【図13】本発明の第2実施例で用いられるプロシージ
ャ終了ルーチンを説明するフローチャートである。
FIG. 13 is a flowchart illustrating a procedure end routine used in the second embodiment of the present invention.

【図14】本発明の第3実施例で用いられる二重リンク
リストデータ構造の説明図である。
FIG. 14 is an explanatory diagram of a doubly linked list data structure used in the third embodiment of the present invention.

【図15】本発明の第3実施例において確保された位置
を管理するために用いられるスタックの説明図である。
FIG. 15 is an explanatory diagram of a stack used for managing a secured position in the third embodiment of the present invention.

【図16】本発明の第3実施例で用いられる複数の二重
リンクリストデータ構造の説明図である。
FIG. 16 is an explanatory diagram of a plurality of doubly linked list data structures used in the third embodiment of the present invention.

【図17】本発明の第3実施例で用いられるプロシージ
ャ開始ルーチンを説明するフローチャートである。
FIG. 17 is a flowchart illustrating a procedure start routine used in the third embodiment of the present invention.

【図18】本発明の第3実施例のプロシージャ開始ルー
チンによって使用されるメモリチェックルーチンであ
る。
FIG. 18 is a memory check routine used by the procedure start routine of the third embodiment of the present invention.

【図19】本発明の第3実施例で用いられるプロシージ
ャ終了ルーチンを説明するフローチャートである。
FIG. 19 is a flowchart illustrating a procedure end routine used in the third embodiment of the present invention.

【符号の説明】[Explanation of symbols]

2 クリアテキストSPDLファイル 4 文法解析ステップ 6 バイナリ符号化ステップ 8 バイナリSPDLファイル 10 処理システム 12 CPU 14 文法解析ルーチン 16 バイナリ符号化ルーチン 18 記憶装置 20 プリンタ 22 ネットワーク 26 ディスクコントローラ 28 フロッピードライブ 30 キーボード 32 マウス 34 入力コントローラ 36 システムバス 38 ROM 40 RAM 42 ディスプレイコントローラ 44 CRT 46 I/Oコントローラ 48 ハードディスク 100 メインバイナリ符号化ルーチン 102 コンテントバイナリ符号化ルーチン 104 メインコンテントバイナリ符号化ルーチン 106 プロシージャ開始ルーチン 108 プロシージャ終了ルーチン 110 その他符号化ルーチン 112 構造バイナリ符号化ルーチン 2 clear text SPDL file 4 grammar analysis step 6 binary encoding step 8 binary SPDL file 10 processing system 12 CPU 14 grammar analysis routine 16 binary encoding routine 18 storage device 20 printer 22 network 26 disk controller 28 floppy drive 30 keyboard 32 mouse 34 Input Controller 36 System Bus 38 ROM 40 RAM 42 Display Controller 44 CRT 46 I / O Controller 48 Hard Disk 100 Main Binary Encoding Routine 102 Content Binary Encoding Routine 104 Main Content Binary Encoding Routine 106 Procedure Start Routine 108 Procedure End Routine 110 Other Encoding routine 112 structure Binary encoding routine

Claims (40)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも1つのネストされたプロシー
ジャを持つメインプロシージャを生成するための生成手
段、 生成されたプロシージャをバイナリフォーマットへ符号
化するための、該生成手段と結合した手段、 該プロシージャをバイナリフォーマットへ変換するため
の手段と結合した、1つの論理的に連続したメモリバッ
ファ、 該メインプロシージャ及び該少なくとも1つのネストさ
れたプロシージャのバイナリ表現の長さを、該論理的に
連続したメモリバッファへ書き込むための、該論理的に
連続したメモリバッファと結合した手段、及び該メイン
プロシージャ及び該少なくとも1つのネストされたプロ
シージャのバイナリ表現の長さを格納するためのメモリ
ロケーションを該論理的に連続したメモリバッファ内に
確保するための、該論理的に連続したメモリバッファと
結合した手段を具備し、ネストされたプロシージャをバ
イナリ表現へ符号化する符号化装置。
1. Generating means for generating a main procedure having at least one nested procedure, means for coupling the generated procedure to a binary format, and means coupled to the generating means, the procedure being binary. One logically contiguous memory buffer, coupled with means for converting to a format, the length of the binary representation of the main procedure and the at least one nested procedure into the logically contiguous memory buffer Means for combining with the logically contiguous memory buffer, and memory locations for storing the length of the binary representation of the main procedure and the at least one nested procedure in the logically contiguous manner. To secure in the memory buffer, An encoder for encoding a nested procedure into a binary representation, comprising means associated with the logically contiguous memory buffer.
【請求項2】 該確保されたメモリロケーションの位置
を記憶するための、該メモリロケーションを確保するた
めの手段と結合した第1のメモリ手段、及び該論理的に
連続したメモリバッファ内の次の空き位置に関する位置
情報を記憶するための、該論理的に連続したメモリバッ
ファと結合した第2のメモリ手段、をさらに具備するこ
とを特徴とする請求項1記載の符号化装置。
2. A first memory means for storing the location of the reserved memory location, coupled to the means for securing the memory location, and a next memory means in the logically contiguous memory buffer. 2. An encoding device according to claim 1, further comprising: a second memory means coupled with the logically contiguous memory buffer for storing position information regarding empty positions.
【請求項3】 該論理的に連続したメモリバッファは単
一のメモリバッファからなることを特徴とする請求項1
記載の符号化装置。
3. The logically contiguous memory buffer comprises a single memory buffer.
Encoding device described.
【請求項4】 該論理的に連続したメモリバッファは、
それぞれが1つの配列インデックスを持つ複数のメモリ
バッファからなり、かつ確保されたメモリロケーション
の位置を記憶するための該第1メモリ手段は、確保され
たロケーション毎に1つの配列インデックス及び1つの
バッファ位置インデックスを記憶する、ことを特徴とす
る請求項2記載の符号化装置。
4. The logically contiguous memory buffer is
The first memory means comprises a plurality of memory buffers each having one array index, and the first memory means for storing the position of the reserved memory location includes one array index and one buffer position for each reserved location. The encoding device according to claim 2, wherein the index is stored.
【請求項5】 該論理的に連続したメモリバッファは、
リンクリストデータ構造によって複数のメモリバッファ
をリンクしてなり、かつ、確保されたメモリロケーショ
ンの位置を記憶するための該第1メモリ手段は、該確保
されたメモリロケーションのバッファレベル及び該バッ
ファ内の位置を記憶する、ことを特徴とする請求項2記
載の符号化装置。
5. The logically contiguous memory buffer is
The first memory means for linking a plurality of memory buffers by a linked list data structure and for storing the location of the reserved memory location includes a buffer level of the reserved memory location and a buffer in the buffer. The encoding device according to claim 2, wherein the position is stored.
【請求項6】 該リンクリストデータ構造は前のデータ
構造へのポインタと次のデータ構造へのポインタとを持
つ二重リンクリストデータ構造からなる、ことを特徴と
する請求項5記載の符号化装置。
6. The encoding of claim 5, wherein the linked list data structure comprises a dual linked list data structure having a pointer to a previous data structure and a pointer to a next data structure. apparatus.
【請求項7】 該生成手段は少なくとも1つのネストさ
れたプロシージャを持つ該メインプロシージャをクリア
テキストフォーマットで生成し、かつ該生成されたクリ
アテキストのプロシージャを、それがバイナリフォーマ
ットへ符号化されるまで記憶する記憶手段をさらに具備
する、ことを特徴とする請求項2記載の符号化装置。
7. The generating means generates the main procedure with at least one nested procedure in a clear text format and the generated clear text procedure until it is encoded into a binary format. The encoding apparatus according to claim 2, further comprising a storage unit that stores the information.
【請求項8】 少なくとも1つのネストされたプロシー
ジャを持つメインプロシージャを生成するための生成手
段、 生成されたプロシージャをバイナリフォーマットへ符号
化するための、該生成手段と結合した手段、 該プロシージャをバイナリフォーマットへ符号化するた
めの手段と結合した、1つの論理的に連続したメモリバ
ッファ、 該メインプロシージャ及び該少なくとも1つのネストさ
れたプロシージャのバイナリ表現の長さを該論理的に連
続したメモリバッファに書き込むための、該メモリバッ
ファと結合した手段、 該メインプロシージャ及び該少なくとも1つのネストさ
れたプロシージャのバイナリ表現の長さを格納するため
のメモリロケーションを該論理的に連続したメモリバッ
ファ内に確保するための、該論理的に連続したメモリバ
ッファと結合した手段、 該論理的に連続したメモリバッファよりバイナリ符号化
後のプロシージャを該プリンタ手段へ伝送するための手
段を具備し、 該プリンタ手段は該論理的に連続したメモリバッファと
結合し、該伝送されたバイナリ符号化後のプロシージャ
を受け取り、受け取ったバイナリ符号化後のプロシージ
ャによって制御される、ネストされたプロシージャをバ
イナリ表現へ符号化するとともにプリンタを制御する符
号化装置。
8. Generating means for generating a main procedure having at least one nested procedure, means for coupling the generated procedure to a binary format, and means coupled to the generating means, the procedure being binary. One logically contiguous memory buffer, coupled to the means for encoding into a format, the length of the binary representation of the main procedure and the at least one nested procedure into the logically contiguous memory buffer Means in the logically contiguous memory buffer for writing, a means associated with the memory buffer, a memory location for storing a length of a binary representation of the main procedure and the at least one nested procedure. For the logically continuous A memory buffer and means for transmitting the binary encoded procedure from the logically contiguous memory buffer to the printer means, the printer means being coupled to the logically contiguous memory buffer. An encoding device for receiving the transmitted binary encoded procedure, encoding the nested procedure into a binary representation and controlling the printer, which is controlled by the received binary encoded procedure.
【請求項9】 確保されたメモリロケーションの位置を
記憶するための、該論理的に連続したメモリバッファと
結合した第1のメモリ手段、及び該論理的に連続したメ
モリバッファ内の次の空き位置を決定するための位置情
報を記憶するための、該論理的に連続したメモリバッフ
ァと結合した第2のメモリ手段、をさらに具備すること
を特徴とする請求項8記載の符号化装。
9. A first memory means associated with the logically contiguous memory buffer for storing a reserved memory location location, and a next free location in the logically contiguous memory buffer. 9. Coding apparatus according to claim 8, further comprising second memory means associated with the logically contiguous memory buffer for storing position information for determining.
【請求項10】 該論理的に連続したメモリバッファの
内容を、それが該伝送のための手段によって該プリンタ
手段へ伝送されるまで記憶するための、該論理的に連続
したメモリバッファと結合した第3のメモリ手段、をさ
らに具備することを特徴とする請求項9記載の符号化装
置。
10. A logically contiguous memory buffer for storing the contents of said logically contiguous memory buffer until it is transmitted by said means for said transmission to said printer means. The encoding apparatus according to claim 9, further comprising third memory means.
【請求項11】 該論理的に連続したメモリバッファ
は、それぞれが1つの配列インデックスを持つ複数のメ
モリバッファからなり、かつ確保されたメモリロケーシ
ョンの位置を記憶するための該第1メモリ手段は、予約
された各ロケーション毎に1つの配列インデックスと1
つのバッファ位置インデックスとを記憶する、ことを特
徴とする請求項9記載の符号化装置。
11. The logically contiguous memory buffer comprises a plurality of memory buffers, each having one array index, and the first memory means for storing a reserved memory location location comprises: 1 array index and 1 for each reserved location
Coding device according to claim 9, characterized in that it stores one buffer position index.
【請求項12】 該論理的に連続したメモリバッファ
は、少なくとも1つのリンクリストデータ構造によって
複数のメモリバッファをリンクしてなり、かつ、確保さ
れたメモリロケーションの位置を記憶するための該第1
メモリ手段は、該確保されたメモリロケーションのバッ
ファレベル及び該バッファ内の位置を記憶する、ことを
特徴とする請求項9記載の符号化装置。
12. The logically contiguous memory buffer comprises a plurality of memory buffers linked by at least one linked list data structure, and the first for storing locations of reserved memory locations.
Coding device according to claim 9, characterized in that the memory means stores a buffer level of the reserved memory location and a position in the buffer.
【請求項13】 該少なくとも1つのリンクリストデー
タ構造は、前のデータ構造へのポインタと次のデータ構
造へのポインタとを持つ少なくとも1つの二重リンクリ
ストデータ構造からなる、ことを特徴とする請求項12
記載の符号化装置。
13. The at least one linked list data structure comprises at least one doubly linked list data structure having a pointer to a previous data structure and a pointer to a next data structure. Claim 12
Encoding device described.
【請求項14】 該生成手段は少なくとも1つのネスト
されたプロシージャを持つ該メインプロシージャをクリ
アテキストフォーマットで生成し、かつ該クリアテキス
トの生成されたプロシージャを、それがバイナリフォー
マットへ符号化されるまで記憶する記憶手段をさらに具
備する、ことを特徴とする請求項9記載の符号化装置。
14. The generating means generates the main procedure with at least one nested procedure in a clear text format and the generated clear text procedure until it is encoded into a binary format. The encoding device according to claim 9, further comprising a storage unit that stores the data.
【請求項15】 少なくとも1つのネストされたプロシ
ージャを持つメインプロシージャを生成するための生成
手段、 生成されたプロシージャをバイナリフォーマットへ符号
化するための、該生成手段と結合した手段、 該プロシージャのバイナリフォーマットへの符号化のた
めの手段と結合した、少なくとも1つのメモリバッフ
ァ、 該少なくとも1つのメモリバッファのそれぞれのための
バッファインデックス、 該少なくとも1つのメモリバッファが一杯になった時に
追加のメモリバッファを割り当て、割り当てた追加のメ
モリバッファのためのバッファインデックスを生成する
ための手段、及び該メインプロシージャ及び該少なくと
も1つのネストされたプロシージャのバイナリ表現の長
さを記憶するためのメモリロケーションを、該メモリバ
ッファ内に確保するための手段を具備する、ネストされ
たプロシージャをバイナリ表現へ符号化する符号化装
置。
15. Generating means for generating a main procedure having at least one nested procedure, means for coupling the generated procedure to a binary format, coupled with the generating means, binary of the procedure. At least one memory buffer in combination with means for encoding into a format, a buffer index for each of said at least one memory buffer, an additional memory buffer when said at least one memory buffer is full Means for allocating, means for generating a buffer index for the allocated additional memory buffer, and memory locations for storing the lengths of the binary representations of the main procedure and the at least one nested procedure, Comprising means for securing to the rebuffered, coding apparatus for coding nested procedures to binary representation.
【請求項16】 確保された各メモリロケーションのた
めの配列インデックス及びバッファ位置インデックスを
記憶することによって、該確保されたメモリロケーショ
ンの位置を記憶するための、該メモリロケーションの確
保のための手段と結合した第1のメモリ手段、及び該メ
モリバッファ内の次の空き位置に関する位置情報を記憶
するための第2のメモリ手段をさらに具備することを特
徴とする請求項15記載の符号化装置。
16. A means for reserving the memory location for storing the location of the reserved memory location by storing an array index and a buffer position index for each reserved memory location. 16. The encoding device according to claim 15, further comprising a first memory means coupled to the first memory means and a second memory means for storing position information regarding a next vacant position in the memory buffer.
【請求項17】 該第1メモリ手段は確保された各メモ
リロケーション毎に配列インデックス及びバッファ位置
インデックスを記憶するためのスタックからなる、こと
を特徴とする請求項16記載の符号化装置。
17. The encoding device according to claim 16, wherein said first memory means comprises a stack for storing an array index and a buffer position index for each reserved memory location.
【請求項18】 少なくとも1つのネストされたプロシ
ージャを持つメインプロシージャを生成するための生成
手段、 生成されたプロシージャをバイナリフォーマットへ符号
化するための、該生成手段と結合した手段、 該プロシージャのバイナリフォーマットへの符号化のた
めの手段と結合した、少なくとも1つのメモリバッフ
ァ、 該少なくとも1つのメモリバッファが一杯になった時に
追加のメモリバッファを割り当て、割り当てた各追加の
メモリバッファ毎にリンクリストを生成するための手
段、及び該メインプロシージャ及び該少なくとも1つの
ネストされたプロシージャのバイナリ表現の長さを記憶
するためのメモリロケーションを、該少なくとも1つの
メモリバッファ内に確保するための手段を具備する、ネ
ストされたプロシージャをバイナリ表現へ符号化する符
号化装置。
18. Generating means for generating a main procedure having at least one nested procedure, means for coupling the generated procedure to a binary format, coupled with the generating means, binary of the procedure. At least one memory buffer, coupled with means for encoding into a format, allocating an additional memory buffer when the at least one memory buffer is full, and a linked list for each additional memory buffer allocated Means for generating, and means for reserving a memory location in the at least one memory buffer for storing a length of a binary representation of the main procedure and the at least one nested procedure. , Nested procedure An encoding device that encodes a coder into a binary representation.
【請求項19】 確保されたメモリロケーションの位置
を記憶するための、該メモリロケーションの確保のため
の手段と結合した第1のメモリ手段、及び該少なくとも
1つのメモリバッファ内の次の空き位置に関する位置情
報を記憶するための第2のメモリ手段をさらに具備する
こと特徴とする請求項18記載の符号化装置。
19. A first memory means for storing the location of a reserved memory location, coupled with a means for reserving the memory location, and a next free location in the at least one memory buffer. The encoding device according to claim 18, further comprising a second memory means for storing the position information.
【請求項20】 該リンクリストデータ構造は、前のメ
モリバッファのリンクリストデータ構造への第1のポイ
ンタと、次のメモリバッファのリンクリストデータ構造
を指す次ポインタとを持つ二重リンクリストデータ構造
よりなる、ことを特徴とする請求項19記載の符号化装
置。
20. Double linked list data having a first pointer to a linked list data structure of a previous memory buffer and a next pointer to a linked list data structure of a next memory buffer. The encoding device according to claim 19, wherein the encoding device comprises a structure.
【請求項21】 少なくとも1つのネストされたプロシ
ージャを持つメインプロシージャをバイナリフォーマッ
トへ符号化するステップ、 バイナリ符号化後のメインプロシージャの長さ情報のた
めのメモリロケーションを記憶バッファ内に確保するス
テップ、 バイナリ符号化後のメインプロシージャを該記憶バッフ
ァに書き込むステップ、 該メインプロシージャの該少なくとも1つのネストされ
たプロシージャをバイナリフォーマットへ符号化するス
テップ、 バイナリ符号化後のネストされたプロシージャの長さ情
報のためのメモリロケーションを該記憶バッファ内に確
保するステップ、 バイナリ符号化後のネストされたプロシージャを該記憶
バッファに書き込むステップ、 バイナリ符号化後のネストされたプロシージャの長さ
を、当該プロシージャの長さ情報のために確保されたメ
モリロケーションへ書き込むステップ、及びバイナリ符
号化後のメインプロシージャの長さを、当該メインプロ
シージャの長さ情報のために確保されたメモリロケーシ
ョンに書き込むステップを有する、少なくとも一つのネ
ストされたプロシージャを持つメインプロシージャをバ
イナリ表現へ符号化する符号化方法。
21. Encoding a main procedure with at least one nested procedure into a binary format, allocating a memory location in a storage buffer for the length information of the main procedure after binary encoding, Writing the main procedure after binary encoding into the storage buffer, encoding the at least one nested procedure of the main procedure into a binary format, length information of the nested procedure after binary encoding A memory location in the storage buffer for storing the binary-coded nested procedure in the storage buffer; Writing to a memory location reserved for the length information of the lossier, and writing the length of the main procedure after binary encoding to a memory location reserved for the length information of the main procedure. , An encoding method for encoding a main procedure with at least one nested procedure into a binary representation.
【請求項22】 バイナリ符号化後のメインプロシージ
ャの長さ情報のためのメモリロケーションを確保するス
テップの後に、バイナリ符号化後のメインプロシージャ
の長さ情報のために確保されたメモリロケーションの位
置を記憶するステップ、及びバイナリ符号化後のネスト
されたプロシージャの長さ情報のためのメモリロケーシ
ョンを確保するステップの後に、バイナリ符号化後のネ
ストされたプロシージャの長さ情報のために確保された
メモリロケーションの位置を記憶するステップをさらに
有し、ネストされたプロシージャのテキスト表現をバイ
ナリ表現へ符号化することを特徴とする請求項21記載
の符号化方法。
22. After the step of reserving the memory location for the length information of the main procedure after binary encoding, the position of the memory location reserved for the length information of the main procedure after binary encoding is determined. Memory reserved for the length information of the nested procedure after binary encoding after the steps of storing and reserving memory locations for the length information of the nested procedure after binary encoding 22. The encoding method of claim 21, further comprising the step of storing the location of the location, encoding the textual representation of the nested procedure into a binary representation.
【請求項23】 バイナリ符号化後のネストされたプロ
シージャの位置情報を記憶するステップ及びネストされ
たプロシージャの位置情報を記憶するステップは、各位
置情報を1つのスタックに記憶することを特徴とする請
求項22記載の符号化方法。
23. The step of storing the position information of the nested procedure after the binary encoding and the step of storing the position information of the nested procedure are characterized in that each position information is stored in one stack. The encoding method according to claim 22.
【請求項24】 該記憶バッファ内にメモリロケーショ
ンが確保された時に該記憶バッファの次に利用可能な位
置に関する位置情報を記憶するステップ、及び バイナ
リ符号化後のメインプロシージャ及びネストされたプロ
シージャの少なくとも1つが該記憶バッファに書き込ま
れる時に該記憶バッファの次に利用可能な位置に関する
位置情報を記憶するステップをさらに有することを特徴
とする請求項22記載の符号化方法。
24. Storing location information regarding the next available location of the storage buffer when a memory location is reserved in the storage buffer, and at least the main procedure and the nested procedure after binary encoding. 23. The encoding method of claim 22, further comprising the step of storing position information regarding a next available position of the storage buffer when one is written to the storage buffer.
【請求項25】 該記憶バッファの各書き込み及び各確
保の前に記憶バッファが満杯であるかチェックし、該バ
ッファが満杯と判定されたときに追加のメモリバッファ
を割り当てるステップをさらに有することを特徴とする
請求項21記載の符号化方法。
25. The method further comprising the step of checking whether the storage buffer is full before each write and each allocation of the storage buffer and allocating an additional memory buffer when the buffer is determined to be full. 22. The encoding method according to claim 21.
【請求項26】 割り当てられた各追加メモリバッファ
毎に1つの配列インデックスを生成するステップをさら
に有することを特徴とする請求項25記載の符号化方
法。
26. The encoding method according to claim 25, further comprising the step of generating one array index for each additional memory buffer allocated.
【請求項27】 割り当てられた各メモリバッファ毎に
1つのリンクリストデータ構造を生成するステップをさ
らに有することを特徴とする請求項25記載の符号化方
法。
27. The encoding method of claim 25, further comprising the step of generating one linked list data structure for each allocated memory buffer.
【請求項28】 リンクリストデータ構造を生成するス
テップ中に、前のリンクリストデータ構造へのポインタ
と次のリンクリストデータ構造へのポインタとを持つ二
重リンクリストデータ構造を生成することを特徴とする
請求項27記載の符号化方法。
28. Creating a doubly linked list data structure having a pointer to a previous linked list data structure and a pointer to a next linked list data structure during the step of generating a linked list data structure. The encoding method according to claim 27.
【請求項29】 初めに該メインプロシージャ及び該少
なくとも1つのネストされたプロシージャをクリアテキ
ストフォーマットで表現するステップ、及び該クリアテ
キストフォーマットを該プロシージャがバイナリに符号
化されるまで記憶するステップをさらに有することを特
徴とする請求項21記載の符号化方法。
29. The method further comprises first expressing the main procedure and the at least one nested procedure in a clear text format, and storing the clear text format until the procedure is binary encoded. 22. The encoding method according to claim 21, wherein:
【請求項30】 メインプロシージャの長さ情報のため
のメモリロケーションをメモリバッファ内に確保するス
テップ、 該メインプロシージャの確保されたメモリロケーション
の位置情報を記憶するステップ、 該メインプロシージャのテキスト表現をバイナリ表現へ
符号化し、該バイナリ表現を該メモリバッファに書き込
むステップ、 該メインプロシージャ内のネストされたプロシージャの
長さ情報のためのメモリロケーションを該メモリバッフ
ァ内に確保するステップ、 該ネストされたプロシージャの確保されたメモリロケー
ションの位置情報を記憶するステップ、 該ネストされたプロシージャのテキスト表現をバイナリ
表現へ変換し、該ネストされたプロシージャのバイナリ
表現を該メモリバッファに書き込むステップ、 該ネストされたプロシージャの長さを、該ネストされた
プロシージャの記憶された位置情報に対応した該メモリ
バッファ内の位置に書き込むステップ、及び該メインプ
ロシージャの長さを、該メインプロシージャの記憶され
た位置情報に対応した該メモリバッファ内の位置に書き
込むステップを有する、ネストされたプロシージャのテ
キスト表現をバイナリ表現へ符号化する符号化方法。
30. Reserving a memory location in a memory buffer for length information of a main procedure, storing location information of the reserved memory location of the main procedure, binary text representation of the main procedure. Encoding into a representation and writing the binary representation into the memory buffer; reserving a memory location in the memory buffer for length information of a nested procedure in the main procedure; Storing the location information of the reserved memory location, converting the textual representation of the nested procedure to a binary representation and writing the binary representation of the nested procedure to the memory buffer; Writing the length of the procedure to a location in the memory buffer corresponding to the stored location information of the nested procedure, and the length of the main procedure to the stored location information of the main procedure. An encoding method for encoding a textual representation of a nested procedure into a binary representation, comprising the step of writing to a corresponding location in the memory buffer.
【請求項31】 該メモリバッファ内にメモリロケーシ
ョンが確保される時に該メモリバッファの次に利用可能
な位置を記憶するステップ、及びバイナリ符号化後のメ
インプロシージャ及びネストされたプロシージャの少な
くとも1つが該メモリバッファに書き込まれる時に、該
メモリバッファの次に利用可能な位置を記憶するステッ
プをさらに有することを特徴とする請求項30記載の符
号化方法。
31. At least one of a main procedure and a nested procedure after binary encoding, storing the next available location of the memory buffer when a memory location is reserved in the memory buffer. 31. The encoding method of claim 30, further comprising storing the next available location of the memory buffer when written to the memory buffer.
【請求項32】 該メインプロシージャ内に複数のネス
トされたプロシージャがある場合に、該メインプロシー
ジャ内のネストされた各プロシージャに対して、メモリ
ロケーションを確保するステップ、プロシージャのテキ
スト表現をバイナリ表現へ変換して記憶するステップを
繰り返し、 該メインプロシージャ内に複数のネストされたプロシー
ジャがある場合に、各ネストされたプロシージャに対し
て、ネストされたプロシージャの長さを書き込むステッ
プを繰り返すことを特徴とする請求項30記載の符号化
方法。
32. When there are a plurality of nested procedures in the main procedure, a step of allocating a memory location for each of the nested procedures in the main procedure, and a text representation of the procedure to a binary representation. Repeating the steps of converting and storing, and for each nested procedure, repeating the step of writing the length of the nested procedure if there are multiple nested procedures in the main procedure. 31. The encoding method according to claim 30.
【請求項33】 該メインプロシージャをバイナリフォ
ーマットへ符号化するステップ、 該バイナリ符号化後のメインプロシージャの長さ情報の
ためのメモリロケーションを記憶バッファ内に確保する
ステップ、 該バイナリ符号化後のメインプロシージャのために利用
可能なメモリロケーションが該記憶バッファ内に存在す
ることを確認した後に該バイナリ符号化後のメインプロ
シージャを該記憶バッファに書き込み、また、該バイナ
リ符号化後のメインプロシージャのために利用可能なメ
モリロケーションが該記憶バッファ内に存在しない場合
に、1つのインデックスを持つ追加のメモリバッファを
生成して、そこに該記憶バッファに入り切らない該バイ
ナリ符号化後のメインプロシージャの部分を書き込むス
テップ、 該メインプロシージャの該少なくとも1つのネストされ
たプロシージャをバイナリフォーマットに符号化するス
テップ、 該記憶バッファ内に利用可能なメモリロケーションが存
在するときに、該バイナリ符号化後のネストされたプロ
シージャの長さ情報のためのメモリロケーションを該記
憶バッファ内に確保し、また、該記憶バッファ内に利用
可能なメモリロケーションが存在しないときに、1つの
インデックスを持つ追加の記憶バッファを割り当てるス
テップ、 該記憶バッファ内に該バイナリ符号化後のネストされた
プロシージャのために利用可能なメモリロケーションが
存在するときに、該バイナリ符号化後のネストされたプ
ロシージャを該記憶バッファに書き込み、また、該記憶
バッファ内に該バイナリ符号化後のネストされたプロシ
ージャのために利用可能なメモリロケーションが存在し
ないときに、1つのインデックスを持つ追加の記憶バッ
ファを割り当てて、それに該バイナリ符号化後のネスト
されたプロシージャの一部を書き込むステップ、 該バイナリ符号化後のネストされたプロシージャの長さ
情報のためために確保されたメモリロケーションに、該
バイナリ符号化後のネストされたプロシージャの長さを
書き込むステップ、及び該バイナリ符号化後のメインプ
ロシージャの長さ情報のために確保されたメモリロケー
ションに、該バイナリ符号化後のメインプロシージャの
長さを書き込むステップを有する、少なくとも1つのネ
ストされたプロシージャを持つメインプロシージャをバ
イナリ表現へ符号化する符号化方法。
33. Encoding the main procedure into a binary format, securing a memory location in a storage buffer for the length information of the main procedure after the binary encoding, the main after the binary encoding Writing the main procedure after the binary encoding to the storage buffer after confirming that a memory location available for the procedure exists in the storage buffer, and for the main procedure after the binary encoding. If an available memory location does not exist in the storage buffer, then create an additional memory buffer with an index in which the part of the main procedure after the binary encoding that does not fit into the storage buffer is filled. Writing step, the main procedure Encoding the at least one nested procedure of a binary coder into a binary format, the length information of the nested procedure after the binary encoding when there is an available memory location in the storage buffer. Allocating a memory location for the storage buffer in the storage buffer and allocating an additional storage buffer with an index when there is no available memory location in the storage buffer. Write the binary-coded nested procedure to the storage buffer and to store the binary code in the storage buffer when available memory locations exist for the binary-coded nested procedure. For nested procedures after conversion Allocating an additional storage buffer with an index and writing to it part of the binary-coded nested procedure when no possible memory locations exist, the binary-coded nested Writing the length of the nested procedure after the binary encoding to a memory location reserved for the length information of the procedure, and reserving for the length information of the main procedure after the binary encoding A coding method for coding a main procedure having at least one nested procedure into a binary representation, the method having the step of writing the length of the main procedure after the binary coding in a stored memory location.
【請求項34】 少なくとも1つのネストされたプロシ
ージャを持つメインプロシージャを生成するための生成
手段、 生成されたプロシージャをバイナリSPDLフォーマッ
トへ符号化するための、該生成手段と結合した手段、 該プロシージャのバイナリフォーマットへの変換のため
の手段と結合した、1つの論理的に連続したメモリバッ
ファ、 該メインプロシージャ及び該少なくとも1つのネストさ
れたプロシージャのバイナリ表現の長さを該論理的に連
続したメモリバッファに書き込むための、該論理的に連
続したメモリバッファと結合した手段、及び該メインプ
ロシージャ及び該少なくとも1つのネストされたプロシ
ージャのバイナリ表現の長さを記憶するためのメモリロ
ケーションを該論理的に連続したメモリバッファ内に確
保するための、該論理的に連続したメモリバッファと結
合した手段を具備する、ネストされたプロシージャをバ
イナリ表現へ符号化する符号化装置。
34. Generating means for generating a main procedure having at least one nested procedure; Means coupled with the generating means for encoding the generated procedure into a binary SPDL format; A logically contiguous memory buffer, combined with means for conversion to a binary format, the length of a binary representation of the main procedure and the at least one nested procedure, the logically contiguous memory buffer Means for writing to the logically contiguous memory buffer and memory locations for storing the length of the binary representation of the main procedure and the at least one nested procedure. Secured in the specified memory buffer For encoding a nested procedure into a binary representation, comprising means associated with the logically contiguous memory buffer for.
【請求項35】 該メモリロケーション確保のための手
段と結合した、該確保されたメモリロケーションの位置
を記憶するための第1のメモリ手段、及び該論理的に連
続したメモリバッファ内の次の空き位置に関する位置情
報を記憶するための、該論理的に連続したメモリバッフ
ァと結合した第2のメモリ手段をさらに具備することを
特徴とする請求項34記載の符号化装置。
35. First memory means for storing the location of the reserved memory location, coupled with the means for reserving the memory location, and the next free space in the logically contiguous memory buffer. 35. The encoding device of claim 34, further comprising second memory means associated with the logically contiguous memory buffer for storing position information regarding a position.
【請求項36】 メインプロシージャをSPDLバイナ
リフォーマットトークンシーケンスへ符号化するステッ
プ、 該バイナリ符号化後のメインプロシージャの長さ情報の
ためのメモリロケーションを記憶バッファ内に確保する
ステップ、 該バイナリ符号化後のメインプロシージャを該記憶バッ
ファに書き込むステップ、 該メインプロシージャの少なくとも1つのネストされた
プロシージャをバイナリフォーマットに符号化するステ
ップ、 該バイナリ符号化後のネストされたプロシージャの長さ
情報のためのメモリロケーションを該記憶バッファ内に
確保するステップ、 バイナリ符号化後のネストされたプロシージャを該記憶
バッファに書き込むステップ、 該バイナリ符号化後のネストされたプロシージャの長さ
情報のために確保されたメモリロケーションに、該バイ
ナリ符号化後のネストされたプロシージャの長さを書き
込むステップ、及び該バイナリ符号化後のメインプロシ
ージャの長さ情報のために確保されたメモリロケーショ
ンに、該バイナリ符号化後のメインプロシージャの長さ
を書き込むステップを有する、少なくとも1つのネスト
されたプロシージャを持つメインプロシージャをバイナ
リ表現へ符号化する符号化方法。
36. Encoding the main procedure into an SPDL binary format token sequence, allocating a memory location in a storage buffer for the length information of the main procedure after the binary encoding, after the binary encoding A main procedure of the main procedure into the storage buffer, encoding at least one nested procedure of the main procedure into a binary format, and a memory location for length information of the nested procedure after the binary encoding. In the storage buffer, writing the nested procedure after the binary encoding into the storage buffer, and a method reserved for the length information of the nested procedure after the binary encoding. Writing the length of the nested procedure after the binary encoding to a memory location, and the memory location reserved for the length information of the main procedure after the binary encoding, to the memory location after the binary encoding. Encoding method for encoding a main procedure with at least one nested procedure into a binary representation, comprising the step of writing the length of the main procedure.
【請求項37】 該バイナリ符号化後のメインプロシー
ジャの長さ情報のためのメモリロケーションを確保する
ステップの後で、該バイナリ符号化後のメインプロシー
ジャの長さ情報のために確保されたメモリロケーション
の位置を記憶するステップ、及び該バイナリ符号化後の
ネストされたプロシージャの長さ情報のためのメモリロ
ケーションを確保するステップの後で、該バイナリ符号
化後のネストされたプロシージャの長さ情報のために確
保されたメモリロケーションの位置を記憶するステップ
をさらに有し、ネストされたプロシージャのテスト表現
をバイナリ表現へ符号化することを特徴とする請求項3
6記載の符号化方法。
37. A memory location reserved for the length information of the main procedure after the binary encoding after the step of reserving a memory location for the length information of the main procedure after the binary encoding. Of the length information of the nested procedure after the binary encoding, and the step of reserving a memory location for the length information of the nested procedure after the binary encoding. 4. The method further comprising storing the location of a reserved memory location for encoding the test representation of the nested procedure into a binary representation.
6. The encoding method according to item 6.
【請求項38】 0個以上のネストされたプロシージャ
を持つメインプロシージャを生成するための生成手段、 生成されたプロシージャをバイナリフォーマットに符号
化するための、該生成手段と結合した手段、 該プロシージャのバイナリフォーマットへの符号化のた
めの手段と結合した、1つの論理的に連続したメモリバ
ッファ、 該プロシージャのバイナリ表現の長さを該論理的に連続
したメモリバッファに書き込むための、該論理的に連続
したメモリバッファと結合した手段、及び該プロシージ
ャのバイナリ表現の長さを記憶するためのメモリロケー
ションを該論理的に連続したメモリバッファ内に確保す
るための、該論理的に連続したメモリバッファと結合し
た手段を具備する、プロシージャをバイナリ表現へ符号
化する符号化装置。
38. Generating means for generating a main procedure having zero or more nested procedures, means for coupling the generated procedure to a binary format, and means for coupling with the generating means, the procedure comprising: One logically contiguous memory buffer, coupled to the means for encoding into a binary format, the logically contiguous memory buffer for writing the length of the binary representation of the procedure into the logically contiguous memory buffer Means for associating with a contiguous memory buffer, and said logically contiguous memory buffer for reserving a memory location in the logically contiguous memory buffer for storing the length of the binary representation of the procedure; An encoding device for encoding a procedure into a binary representation, comprising means for combining.
【請求項39】 該確保されたメモリロケーションの位
置を記憶するための、該メモリロケーションの確保のた
めの手段と結合した第1のメモリ手段、及び該論理的に
連続したメモリバッファ内の次の空き位置に関する位置
情報を記憶するための、該論理的に連続したメモリバッ
ファと結合した第2のメモリ手段をさらに具備すること
を特徴とする請求項38記載の符号化装置。
39. First memory means for storing the location of the reserved memory location, coupled to the means for reserving the memory location, and a next memory means in the logically contiguous memory buffer. 39. The encoding apparatus of claim 38, further comprising second memory means coupled to the logically contiguous memory buffer for storing position information regarding empty positions.
【請求項40】 プロシージャをバイナリフォーマット
に符号化するステップ、 該符号化後のプロシージャの長さ情報のためのメモリロ
ケーションを記憶バッファ内に確保するステップ、 該符号化後のプロシージャを該記憶バッファに書き込む
ステップ、及び該長さ情報のために確保されたメモリロ
ケーションに該バイナリ符号化後のプロシージャの長さ
を書き込むステップを有する、プロシージャをバイナリ
表現に符号化する符号化方法。
40. Encoding the procedure into a binary format, allocating a memory location in a storage buffer for length information of the encoded procedure, storing the encoded procedure in the storage buffer An encoding method for encoding a procedure into a binary representation, comprising the steps of writing and writing the length of the procedure after the binary encoding to a memory location reserved for the length information.
JP28848893A 1993-01-08 1993-11-17 Encoding device and encoding method Expired - Fee Related JP3499589B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US08/002,283 US5375204A (en) 1992-04-30 1993-01-08 System and method for efficient binary encoding of procedures in a document processing language
US08/002283 1993-01-08

Publications (2)

Publication Number Publication Date
JPH06236250A true JPH06236250A (en) 1994-08-23
JP3499589B2 JP3499589B2 (en) 2004-02-23

Family

ID=21700062

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28848893A Expired - Fee Related JP3499589B2 (en) 1993-01-08 1993-11-17 Encoding device and encoding method

Country Status (1)

Country Link
JP (1) JP3499589B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8416433B2 (en) 2006-02-06 2013-04-09 Seiko Epson Corporation Method, computer, and system for an operating system independent device driver

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8416433B2 (en) 2006-02-06 2013-04-09 Seiko Epson Corporation Method, computer, and system for an operating system independent device driver
US9244893B2 (en) 2006-02-06 2016-01-26 Seiko Epson Corporation Method, computer, and system for an operating system independent device driver
US9690526B2 (en) 2006-02-06 2017-06-27 Seiko Epson Corporation Method, computer and printer system for converting binary data indicates printer status information into mark-up language data

Also Published As

Publication number Publication date
JP3499589B2 (en) 2004-02-23

Similar Documents

Publication Publication Date Title
US5375204A (en) System and method for efficient binary encoding of procedures in a document processing language
JP3299912B2 (en) Method and apparatus for compressing and decompressing fonts
US6621493B1 (en) Metafile compression
US5884014A (en) Fontless structured document image representations for efficient rendering
US6121901A (en) Data compression and decompression system with immediate dictionary updating interleaved with string search
US5229768A (en) Adaptive data compression system
US5951623A (en) Lempel- Ziv data compression technique utilizing a dictionary pre-filled with frequent letter combinations, words and/or phrases
US6269190B1 (en) Computer system for processing images using a virtual frame buffer
KR100252444B1 (en) Information processing apparatus
JPH0368219A (en) Data compressor and method of compressing data
JPH07104971A (en) Compression method using small-sized dictionary applied to network packet
KR100353171B1 (en) Method and apparatus for performing adaptive data compression
JPH0888568A (en) Reversible code encoding method for data
JPH0876969A (en) Data compression and expansion method for storing of compressed data into discontinuous memory
US5617517A (en) Two-dimensional method and system for compressing bi-level images
EP0672982A1 (en) Printer system with compressed font procedure that enables memory conservation
US5841953A (en) Method for compressing and decompressing data files
US5680601A (en) Compression system for reducing the occurrence of a literal prefix
US6785424B1 (en) Encoding method and apparatus for compressing a data structure having two or more dimensions, decoding method, and storage medium
JP2968112B2 (en) Code conversion method
JP3499589B2 (en) Encoding device and encoding method
JP3004963B2 (en) Information terminal device and screen data processing method
WO1998013787A1 (en) Adaptive block image compression
US5548687A (en) Method and apparatus for controlling a printer using the N/2r format
US6816280B1 (en) ALDC with zero clear after read

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071205

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081205

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081205

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091205

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101205

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees