JPH04186433A - Rapid pattern searching mechanism based on keyword register system - Google Patents

Rapid pattern searching mechanism based on keyword register system

Info

Publication number
JPH04186433A
JPH04186433A JP2316917A JP31691790A JPH04186433A JP H04186433 A JPH04186433 A JP H04186433A JP 2316917 A JP2316917 A JP 2316917A JP 31691790 A JP31691790 A JP 31691790A JP H04186433 A JPH04186433 A JP H04186433A
Authority
JP
Japan
Prior art keywords
keyword
pattern
search
real memory
management table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2316917A
Other languages
Japanese (ja)
Inventor
Hiroichi Uchiyama
博一 内山
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2316917A priority Critical patent/JPH04186433A/en
Publication of JPH04186433A publication Critical patent/JPH04186433A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To attain rapid pattern search by omitting processing for comparing and retrieving source programs stored in a real memory successively from its head at the time of searching a pattern. CONSTITUTION:This rapid pattern searching mechanism is constituted of a keyword detecting mechanism 1, a keyword table forming mechanism 2, a real memory storing position table forming mechanism 3, a search pattern keyword extracting mechanism 4, a control table retrieving mechanism 5, and so on. In the case of inputting an LISP source program 15, the storing position of the real memory 10 is registered and managed in a keyword included in a pattern to be searched in the future and the real memory position of a search pattern is found out from the keyword managed and registered at the time of searching the pattern. Thereby a processing time required for successively searching source files in the real memory 10 from its head can be omitted. Thus rapid pattern search can be attained.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は言語処理に関し、特にLISP言語処理系のパ
ターンサーチ処理を高速化する技術に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to language processing, and particularly to a technique for speeding up pattern search processing in a LISP language processing system.

[従来の技術] 従来、この種のLI SP言語処理系のパターンサーチ
処理は実メモリに格納されたンースプログラムをパター
ンサーチ時に先頭から順次、サーチパターンと比較する
ことにより検索されていた。
[Prior Art] Conventionally, pattern search processing in this type of LISP language processing system has been carried out by sequentially comparing a search pattern with a search pattern from the beginning of a search program stored in a real memory.

第5図は従来のソースファイル入力処理、及びパターン
サーチ処理を示す概略図である。   ′ソースプログ
ラムの入力はLI Srプログラム入力機構11により
、LISPソースプログラムファイル15から入力され
、実メモリ領域格納機$12により実メモリ領域10に
格納される。
FIG. 5 is a schematic diagram showing conventional source file input processing and pattern search processing. 'The source program input is input from the LISP source program file 15 by the LI Sr program input mechanism 11, and is stored in the real memory area 10 by the real memory area storage device $12.

パターンサーチ処理の実行はサーチパターン入力機構1
3により、サーチするパターンが入力され(第5図では
CCCDDD  YYY)、サーチパターン検出機構1
4により、実メモリ領域10のソースファイルの先頭か
ら順次サーチパターンと比較していくことにより検索さ
れる。
The pattern search process is executed using the search pattern input mechanism 1.
3, the pattern to be searched is input (CCCDDD YYY in FIG. 5), and the search pattern detection mechanism 1
4, the source file in the real memory area 10 is searched by sequentially comparing it with the search pattern from the beginning.

[発明が解決しようとする課題] 上述した従来の方式では、実メモリ領域のソースプログ
ラムをサーチ処理のたびに、先頭からサーチパターンと
比較検索しなければならない。そのため、ソースプログ
ラムの容量が大きくなればなるほど、また、特に、LI
SP言語のように括弧の多重のネストで表現されるパタ
ーンをサーチするような場合、括弧が多くなればなるほ
ど、パーターンサーチにかかる時間は大きくなるという
欠′ 点があった。
[Problems to be Solved by the Invention] In the conventional method described above, the source program in the real memory area must be compared and searched from the beginning with the search pattern every time a search process is performed. Therefore, the larger the capacity of the source program, the more
When searching for a pattern expressed by multiple nests of parentheses, such as in the SP language, there is a drawback that the more parentheses there are, the longer the pattern search takes.

L発明の目的J そこで、本発明の目的は、LISPソースプログラムを
入力する際に、将来サーチ対象となるパターンの含むキ
ーワードの実メモリ上の格納位置を登録管理しておき、
パターンサーチ時に管理登録されているキーワードから
サーチパターンの実メモリ上の位置を割り出し、従来の
方式にある、実メモリ上のソースファイルの先頭から順
次サーチしてい〈処理時間を省くことにより高速パター
ンサーチを実現することにある。
LObject of the Invention J Therefore, an object of the present invention is to register and manage the storage location in real memory of a keyword included in a pattern to be searched in the future when inputting a LISP source program.
During a pattern search, the location of the search pattern in real memory is determined from the keywords that are managed and registered, and the search pattern is searched sequentially from the beginning of the source file in real memory, as in the conventional method. The aim is to realize this.

(課題を解決するための手段コ 前述した課題を解決する手段として本発明は、言語処理
装置のパターンサーチ処理において、検索対象とするパ
ターンの−・部または全部をキーワードとして、ソース
プログラムを入力する前に登録しておく、キーワード登
録機構と、前記ソースプログラム入力時に前記キーワー
ド登録機構により登録されたキーワードが入力されたか
どうかをチェックするキーワード検出機構と、 キーワードが検出された場合に該キーワードをキーワー
ド管理テーブルへ登録するキーワードテーブル作成機構
と、 検出されたキーワードが実メモリ領域のどの位置に格納
されたかを管理するための実メモリ上格納位置テーブル
作成機構と、 パターンサーチ実行時にサーチ対象のパターンに含まれ
るキーワードを検出するサーチパターンキーワード抽出
機構と、 検出されたキーワードを元に、前記キーワード管理テー
ブルと、前記実メモリ上格納位置テーブルを参照して、
実メモリ領域上のサーチ対象とするパターンの位置を検
索する管理テーブル検索機構と、 を具備したことを特徴とするキーワード登録方式による
高速パターンサーチ機構を提供するものである。
(Means for Solving the Problems) As a means for solving the above-mentioned problems, the present invention, in pattern search processing of a language processing device, inputs a source program using part or all of the pattern to be searched as a keyword. a keyword registration mechanism that is registered in advance; a keyword detection mechanism that checks whether a keyword registered by the keyword registration mechanism is input when inputting the source program; A keyword table creation mechanism that registers keywords in the management table, a real memory storage location table creation mechanism that manages where detected keywords are stored in the real memory area, and a keyword table creation mechanism that registers detected keywords in the real memory area. a search pattern keyword extraction mechanism that detects included keywords, and based on the detected keywords, refers to the keyword management table and the real memory storage location table,
The present invention provides a high-speed pattern search mechanism using a keyword registration method, characterized by comprising: a management table search mechanism for searching the position of a pattern to be searched in a real memory area;

[実施例] (1)本発明の構成について、図面を参照しながら説明
する。
[Example] (1) The configuration of the present invention will be explained with reference to the drawings.

第1図は本発明の構成及び処理の流れを示す一実施例で
ある。
FIG. 1 is an embodiment showing the configuration and processing flow of the present invention.

構成及び処理は大きく3つに分れ、それぞれ、キーワー
ド登録処理、ソースプログラム入力処理、パターンサー
チ処理として流れを成している。
The configuration and processing are broadly divided into three parts, each of which has a flow: keyword registration processing, source program input processing, and pattern search processing.

本発明のキーワード登録方式による高速パターンサーチ
機構では、第5図の従来例の構成に加えて、パターンサ
ーチの対象とするキーワードを検索実施以前にキーワー
ド登録ファイル7へ登録しておくキーワード登録機構6
と、LISPソースプログラム入力の際にキーワード登
録ファイル7に登録されているキーワードを検出するキ
ーワード検出機構1.検出したキーワードをキーワード
管理テーブル8に登録するキーワードテーブル作成機構
2、LISPソースプログラムを実メモリ領域10に格
納した位置を実メモリ上格納位置管理テーブル9に出力
する実メモリ上格納位置テーブル作成機構3、そして、
パターンサーチの実施時にサーチ対象のパターンにおけ
るキーワードを抽出するサーチパターンキーワード抽出
機構4、このサーチ対象のキーワードが実メモリ領域上
のどの位置にあるかをキーワード管理テーブル8から実
メモリ上格納位置管理テーブル9をたどって検索する管
理テーブル検索機構5から構成されている。
In the high-speed pattern search mechanism using the keyword registration method of the present invention, in addition to the configuration of the conventional example shown in FIG.
and a keyword detection mechanism 1 for detecting keywords registered in the keyword registration file 7 when inputting a LISP source program. A keyword table creation mechanism 2 that registers detected keywords in a keyword management table 8; a real memory storage location table creation mechanism 3 that outputs the location where a LISP source program is stored in a real memory area 10 to a real memory storage location management table 9; ,and,
A search pattern keyword extraction mechanism 4 extracts keywords in a search target pattern when performing a pattern search, and a real memory storage location management table determines where the search target keyword is located in the real memory area from the keyword management table 8. The management table search mechanism 5 includes a management table search mechanism 5 that searches by tracing 9.

(2)次に本発明の動作について図面を参照して説明す
る。
(2) Next, the operation of the present invention will be explained with reference to the drawings.

第2図はキーワード登録処理の流れを使用するファイル
及びテーブルの内容の一実施例を示して記述したもので
ある。
FIG. 2 shows and describes an example of the contents of files and tables that use the flow of keyword registration processing.

まず、キーワード登録ファイル7への登録処理は第1図
に示したキーワード登録機構6によりLISPソースプ
ログラムの入力を行う前に予め行う。ここで、キーワー
ド登録ファイル7にキーワードとして登録する内容は、
LI SP言語における基本関数名および標準関数名と
利用者の必要に応じての任意の名称である。本実施例で
は、AAA、CCCといった任意のキーワードを登録し
ている。
First, the registration process in the keyword registration file 7 is performed in advance before inputting the LISP source program by the keyword registration mechanism 6 shown in FIG. Here, the content to be registered as a keyword in the keyword registration file 7 is as follows.
These are basic function names and standard function names in the LISP language, and arbitrary names according to the needs of the user. In this embodiment, arbitrary keywords such as AAA and CCC are registered.

次に第3図はソースプログラムの入力処理の本発明にお
ける一実施例である。
Next, FIG. 3 shows an embodiment of source program input processing according to the present invention.

まず、ソースプログラムはL I S P7’e+グラ
ム入力機構11により、LISPソースプログラムファ
イル15から、格納する実メモリ領域lOのレコード長
に従って読み込まれる(ステップ21)。
First, the source program is read from the LISP source program file 15 by the LISP7'e+gram input mechanism 11 according to the record length of the real memory area IO to be stored (step 21).

この際、キーワード検出機構1により、予めキーワード
登録ファイル7に登録されているキーワードが入力単位
(ここではルーコード内)に存在するかどうかをチェッ
クする(ステップ22)。 このチェックにより、入力
単位内に存在することが明らかとなったキーワードはキ
ーワードテーブル作成機構2により、キーワード管理テ
ーブル8に登録される(ステップ23)。
At this time, the keyword detection mechanism 1 checks whether a keyword registered in advance in the keyword registration file 7 exists in the input unit (here, in the roux code) (step 22). As a result of this check, keywords that are found to exist within the input unit are registered in the keyword management table 8 by the keyword table creation mechanism 2 (step 23).

キーワード管理テーブル8には検出されたキーワードと
、そのキーワードが格納される実メモリ上の位置を管理
するための実メモリ上格納位置管理テーブル9のアドレ
スが対になって管理されている。
The keyword management table 8 manages pairs of detected keywords and addresses of a real memory storage location management table 9 for managing the location on the real memory where the keywords are stored.

例えば、第3図では、「キーワードAAAの実メモリ上
の格納位置管理テーブル9はアドレスx’o10010
0’を先頭としている。」というように表されている。
For example, in FIG. 3, "The storage location management table 9 of the keyword AAA on the real memory is at the address
It starts with 0'. ” is expressed as follows.

登録の終ったキーワードは実メモリ領域格納機構12に
より実メモリ領域10に格納される(ステップ24)。
The registered keyword is stored in the real memory area 10 by the real memory area storage mechanism 12 (step 24).

この時、実メモリ上格納位置テーブル作成機構3により
、各キーワード毎に実メモリ上格納位置管理テーブル9
が作成され、実メモリ上の各々のキーワードの位置が管
理される(ステップ25)。
At this time, the real memory storage location table creation mechanism 3 creates a real memory storage location management table 9 for each keyword.
is created, and the position of each keyword on real memory is managed (step 25).

例えば、第3図では、「キーワードAAAの最初の実メ
モリへの格納位置はx’0201000゛である。1と
いうように表している。また、同一キーワードは、実メ
モリへ格納されるごとに順次管理テーブル9に登録され
ていく。
For example, in FIG. 3, "The first storage position of the keyword AAA in the real memory is It is registered in the management table 9.

以上の処理が全ソースプログラムについて最後の入力ま
で繰返されて、入力処理は終了となる(ステップ26)
The above process is repeated for all source programs until the last input, and the input process ends (step 26).
.

第4図はパターンサーチ処理の一実施例を、使用するテ
ーブルの内容と合せて記述したものである。
FIG. 4 describes an example of pattern search processing together with the contents of the table used.

まず、サーチパターン入力機構13により、サーチする
パターン、ここでは、一実施例として、(CCCDDD
  YYY)とサーチ指令が入力される(ステップ31
)。
First, the search pattern input mechanism 13 selects a search pattern (CCCDDD) as an example.
YYY) and a search command are input (step 31
).

入力されたサーチパターンはすでに登録されているキー
ワードが含まれているかどうかサーチパターンキーワー
ド抽出機構4により判定される(ステップ32)。
The search pattern keyword extraction mechanism 4 determines whether the input search pattern includes a keyword that has already been registered (step 32).

この結果、登録キーワード(この例ではcCC)が含ま
れていることが判明した場合、管理テーブル検索機構5
によりキーワード管理テーブル8から実メモリ管理テー
ブル9の位置x’0100110’を求め、該テーブル
9から実メモリ上のキーワードCCC(7)位置x’0
201014′を求める(ステップ33)。
As a result, if it is found that the registered keyword (cCC in this example) is included, the management table search mechanism 5
The position x'0100110' of the real memory management table 9 is obtained from the keyword management table 8, and the position x'0 of the keyword CCC(7) on the real memory is obtained from the table 9.
201014' is determined (step 33).

次に実メモリ上のキーワードの位置からサーチパターン
を抽出し、サーチパターン検出機構14により対象とす
るサーチパターンと比較する(ステップ35)。
Next, a search pattern is extracted from the position of the keyword on the real memory, and is compared with the target search pattern by the search pattern detection mechanism 14 (step 35).

ここで、実メモリ上のパターンがサーチしているパター
ンに合致した場合は、その実メモリ位置を登録する(ス
テップ36)。
Here, if the pattern on the real memory matches the searched pattern, the real memory location is registered (step 36).

また、合致しなかった場合には再びキーワードCCCの
実メモリ上格納位置管理テーブル9を検索し、該テーブ
ルの管理情報が無くなる才で、上記の処理が繰返される
(ステップ37.38)。
If there is no match, the real memory storage location management table 9 for the keyword CCC is searched again, and the above process is repeated until the management information in the table disappears (steps 37 and 38).

[発明の効果] 以上説明した様に本発明によれば、パターンサーチ時に
、実メモリ上のソースプログラムの先頭から順次、比較
検索する処理を省くことができる。 そのため、ソース
プログラムの容量が大きくなっても、また 特にLIS
P言語において、サーチするパターンに多重の括弧か含
まれていても、パターンサーチ時間の短縮を図ることが
でき、その結果、高速パターンサーチを可能としている
[Effects of the Invention] As described above, according to the present invention, when searching for a pattern, it is possible to omit the process of sequentially comparing and searching from the beginning of the source program on the real memory. Therefore, even if the source program size increases, especially LIS
In the P language, even if the pattern to be searched includes multiple parentheses, the pattern search time can be shortened, and as a result, high-speed pattern search is possible.

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

第1図は、本発明の一実施例の構成及び処理の概略を示
す流れ図。 第2図は1本発明のキーワード登録処理の一実施例を示
す流れ図。 第3図は、本発明のソースプログラム入力処理の一実施
例を示す流れ図。 第4図は、本発明のパターンサーチ処理の一実施例を示
す流れ図。 第5図は、従来のソースプログラム入力処理及びパター
ンサーチ処理の流れ図。 l・・・キーワード検出機構。 2・・・キーワードテーブル作成機構、3・・・実メモ
リ上格納位置テーブル作成機構、4・・・サーチパター
ンキーワード抽出機構。 5・φや管理テーブル検索機構。 6・・・キーワード登録機構、 7・・・キーワード登録機構、 811会−キーワード管理テーブル。 9・−・実メモリ上格納位置管理テーブル、10・争・
実メモリ領域、 11・・・LISPプログラム入力機構、12−−−実
メモリ領域格納機構、 13φ中・サーチパターン入力機構、 14−−・サーチパターン検出機構、
FIG. 1 is a flow chart showing an outline of the configuration and processing of an embodiment of the present invention. FIG. 2 is a flowchart showing an embodiment of the keyword registration process of the present invention. FIG. 3 is a flowchart showing an embodiment of the source program input process of the present invention. FIG. 4 is a flowchart showing an embodiment of the pattern search process of the present invention. FIG. 5 is a flowchart of conventional source program input processing and pattern search processing. l...Keyword detection mechanism. 2... Keyword table creation mechanism, 3... Real memory storage position table creation mechanism, 4... Search pattern keyword extraction mechanism. 5.φ and management table search mechanism. 6...Keyword registration mechanism, 7...Keyword registration mechanism, 811 meeting-keyword management table. 9.--Real memory storage location management table, 10.Conflict-
Real memory area, 11...LISP program input mechanism, 12--Real memory area storage mechanism, 13φ search pattern input mechanism, 14--Search pattern detection mechanism,

Claims (1)

【特許請求の範囲】 言語処理装置のパターンサーチ処理において、検索対象
とするパターンの一部または全部をキーワードとして、
ソースプログラムを入力する前に登録しておく、キーワ
ード登録機構と、 前記ソースプログラム入力時に前記キーワード登録機構
により登録されたキーワードが入力されたかどうかをチ
ェックするキーワード検出機構と、 キーワードが検出された場合に該キーワードをキーワー
ド管理テーブルへ登録するキーワードテーブル作成機構
と、 検出されたキーワードが実メモリ領域のどの位置に格納
されたかを管理するための実メモリ上格納位置テーブル
作成機構と、 パターンサーチ実行時にサーチ対象のパターンに含まれ
るキーワードを検出するサーチパターンキーワード抽出
機構と、 検出されたキーワードを元に、前記キーワード管理テー
ブルと、前記実メモリ上格納位置テーブルを参照して、
実メモリ領域上のサーチ対象とするパターンの位置を検
索する管理テーブル検索機構と、 を具備したことを特徴とするキーワード登録方式による
高速パターンサーチ機構。
[Claims] In the pattern search process of the language processing device, part or all of the pattern to be searched is used as a keyword,
A keyword registration mechanism that registers a source program before inputting it; a keyword detection mechanism that checks whether a keyword registered by the keyword registration mechanism is input when inputting the source program; and when a keyword is detected. a keyword table creation mechanism that registers the keyword in a keyword management table; a real memory storage location table creation mechanism that manages where the detected keyword is stored in the real memory area; a search pattern keyword extraction mechanism that detects keywords included in the search target pattern; and based on the detected keywords, refer to the keyword management table and the real memory storage location table;
A high-speed pattern search mechanism using a keyword registration method, comprising: a management table search mechanism for searching the position of a pattern to be searched in a real memory area;
JP2316917A 1990-11-21 1990-11-21 Rapid pattern searching mechanism based on keyword register system Pending JPH04186433A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2316917A JPH04186433A (en) 1990-11-21 1990-11-21 Rapid pattern searching mechanism based on keyword register system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2316917A JPH04186433A (en) 1990-11-21 1990-11-21 Rapid pattern searching mechanism based on keyword register system

Publications (1)

Publication Number Publication Date
JPH04186433A true JPH04186433A (en) 1992-07-03

Family

ID=18082356

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2316917A Pending JPH04186433A (en) 1990-11-21 1990-11-21 Rapid pattern searching mechanism based on keyword register system

Country Status (1)

Country Link
JP (1) JPH04186433A (en)

Similar Documents

Publication Publication Date Title
JPH04227550A (en) Data processing apparatus
JP2000357115A (en) Device and method for file retrieval
JP2001147837A (en) Program trace device and storage medium
JPH0652221A (en) Automatic extracting system for proper noun
JPH07146880A (en) Document retrieval device and method therefor
JPH04186433A (en) Rapid pattern searching mechanism based on keyword register system
JP2001060164A5 (en)
JPS62106574A (en) Registration retrieving system for document picture file
JPH0561758A (en) Information link device
JPH0511987A (en) Application program starting method
JP2720770B2 (en) Automatic post-processing method
JP3019104B2 (en) File processing device
JP2839515B2 (en) Character reading system
JPH04353943A (en) Specifying system for object being object of data base inquiry
JPH05210562A (en) Network file system
JPH06325088A (en) Information retrieving system
JPH038070A (en) Keyword extracting system
JPH0816382A (en) Erroneously corrected line retrieving device
JPH07244601A (en) Method and device for accessing relational data base
JPH05313834A (en) Cd-rom file access method
JPS63220321A (en) Data retrieving system
JPH06119331A (en) Document parts controller for structured document
JPS63170742A (en) Retrieval processing system for common character string
JPH04256041A (en) Data base retrieving device
JPH05100919A (en) Dump data file managing system