JPH0764801A - User word retrieval system - Google Patents

User word retrieval system

Info

Publication number
JPH0764801A
JPH0764801A JP5214701A JP21470193A JPH0764801A JP H0764801 A JPH0764801 A JP H0764801A JP 5214701 A JP5214701 A JP 5214701A JP 21470193 A JP21470193 A JP 21470193A JP H0764801 A JPH0764801 A JP H0764801A
Authority
JP
Japan
Prior art keywords
name
user word
chain
entry
hash value
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.)
Withdrawn
Application number
JP5214701A
Other languages
Japanese (ja)
Inventor
Isao Taguchi
功 田口
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP5214701A priority Critical patent/JPH0764801A/en
Publication of JPH0764801A publication Critical patent/JPH0764801A/en
Withdrawn legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To quickly retrieve a user word in a compiler without repeating the same retrieval procedures at the time of continuous retrieval of the user word retrieved just before by changing the order from the head of chain addresses so that the user word detected as the result of retrieval is placed in the head of a hash chain. CONSTITUTION:A name table head acquiring means 21 acquires the head of name entries 26 connected to a hash table 25 in a name table 24. A name entry next retrieval means 22 traces chain addresses 261 of name entries 26 to retrieve a name entry having the same hash value. When the name entry 26 having a user word 262 coinciding with a user word 102 in name information 10 is detected by the name table head acquiring means 21 and the name table next retrieval means 22, a name table reorganizing means 23 reorganizes the chain so that the detected name entry is connected to the head of the chain connected to the hash table 25.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は利用者語検索方式、特に
コンパイラにおいて、ハッシュ計算にもとづいて構築さ
れた名前テーブル内の利用者語を検索するための利用者
語検索方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a user word search method, and more particularly to a user word search method for searching a user word in a name table constructed on the basis of hash calculation in a compiler.

【0002】[0002]

【従来の技術】従来、この種の利用者語検索方式は、一
度、名前テーブルを検索して検出した利用者語に対応す
る名前エントリに対して、同一ハッシュ値をもつ名前エ
ントリをつないだチェーンの再編成を行なわず、チェー
ンの接続順序を固定したままにしておくようにしてい
る。
2. Description of the Related Art Conventionally, this type of user word search method is a chain in which name entries having the same hash value are connected to the name entry corresponding to the user word once detected by searching the name table. It does not reorganize, but keeps the chain connection order fixed.

【0003】[0003]

【発明が解決しようとする課題】上述した従来の利用者
語検索方式では、名前テーブルを検索して検出した利用
者語に対応する名前エトリに対して、同一ハッシュ値を
もつ名前エントリをつないだチェーンの再編成を行わ
ず、チェーンの接続順序を固定にしているため、同一の
利用者語を繰返し検索する場合に、同一ハッシュ値をも
つ名前エントリをつないだチェーンを繰返して検索する
ことになり、同一の利用者語の検索処理に無駄な時間が
かかるという問題点がある。
In the above-described conventional user word search method, the name entry having the same hash value is connected to the name entry corresponding to the user word detected by searching the name table. Since the chain connection order is fixed without reorganizing the chain, when repeatedly searching for the same user word, the chain in which name entries with the same hash value are connected is searched repeatedly. However, there is a problem in that a search process for the same user word takes an unnecessary time.

【0004】[0004]

【課題を解決するための手段】本発明の利用者語検索方
式は、コンパイラにおける利用者語の検索を行なうため
の利用者語検索方式において、利用者語を利用者語から
ハッシュ計算によって得られるハッシュ値をもとに同一
ハッシュ値をもつ利用者語を名前エントリとしてつなぐ
チェーンアドレスにより管理するハッシュテーブルと,
利用者語とそのハッシュ値と同一のハッシュ値を持つ利
用者語のチェーンアドレスとを持つ名前エントリとから
なる名前テーブルと、この名前テーブルから利用者語の
ハッシュ値と同一ハッシュ値を持つ名前エントリの先頭
を検索する名前テーブル先頭取得手段と、この名前テー
ブル先頭取得手段で取得した名前エントリの次の名前エ
ントリをチェーンアドレスをたどって順次取得する名前
テーブル次検索手段と、前記名前テーブル先頭取得手段
と名前テーブル次検索手段とによって検出した利用者語
に対応する名前エントリを、ハッシュ値をもとにしたチ
ェーンの先頭の名前エントリとして位置付けてチェーン
を再編成する名前エントリ再編成手段とからなる名前検
索部をもつことにより構成される。
According to the user word search method of the present invention, a user word is obtained from a user word by hash calculation in a user word search method for searching a user word in a compiler. A hash table that manages by a chain address that connects user words that have the same hash value as a name entry based on the hash value,
A name table consisting of a user word and a name entry having a chain address of the user word having the same hash value as that hash value, and a name entry having the same hash value as the hash value of the user word from this name table Name table top obtaining means, a name table next retrieval means for sequentially obtaining name entries next to the name entry obtained by the name table top obtaining means by tracing a chain address, and the name table top obtaining means. A name entry reorganizing means for reorganizing the chain by positioning the name entry corresponding to the user word detected by the name table next search means as the first name entry of the chain based on the hash value. It is composed by having a search part.

【0005】[0005]

【実施例】次に、本発明について図面を参照して説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0006】図1は本発明の一実施例を含むコンパイラ
システムの構成図である。図1のコンパイラシステムは
原始プログラム1と、コンパイラ2と、目的プログラム
3とを含んで構成されていて、コンパイラ2は字句解析
処理部4と、構文解析処理部5と、意味解析処理部6
と、コード生成処理部7と、目的プログラム出力処理部
8とを含んで構成されている。
FIG. 1 is a block diagram of a compiler system including an embodiment of the present invention. The compiler system shown in FIG. 1 includes a source program 1, a compiler 2, and an object program 3, and the compiler 2 includes a lexical analysis processing unit 4, a syntax analysis processing unit 5, and a semantic analysis processing unit 6.
And a code generation processing section 7 and an object program output processing section 8.

【0007】意味解析処理部6は名前情報10と、名前
検索部20と、名前検索部20で検出される検出名前エ
ントリ30とを含んで構成されている。名前情報10は
利用者語102と、利用者語102からハッシュ計算に
よって得られるハッシュ値101とを含んで構成されて
いる。名前検索部20は名前テーブル24と、名前情報
10のハッシュ値101に対応する名前テーブル24内
のハッシュテーブル25につながる名前エントリ26の
先頭を取得する名前テーブル先頭取得手段21と、名前
エントリ26のチェーンアドレス261をたどって同一
のハッシュ値をもつ次の名前エントリを検索する名前エ
ントリ次検索手段22と、名前テーブル先頭取得手段2
1と名前テーブル次検索手段22とによって名前情報1
0内の利用者語102と一致する利用者語262をもつ
名前エントリ26を検出した場合に、検出した名前エン
トリをハッシュテーブル25からつながるチェーンの先
頭につながるようにチェーンを再編成する名前テーブル
再編成手段23とを含んで構成されている。名前テーブ
ル24はハッシュ値ごとに名前エントリを管理するハッ
シュテーブル25と、同一ハッシュ値をもつ利用者語2
62と利用者語262をハッシュテーブル25からつな
ぐチェーンアドレス261とを含んで構成されている名
前エントリ26と、を含んで構成されている。
The semantic analysis processing unit 6 includes name information 10, a name search unit 20, and a detected name entry 30 detected by the name search unit 20. The name information 10 includes a user word 102 and a hash value 101 obtained by hash calculation from the user word 102. The name search unit 20 includes a name table 24, a name table head acquisition unit 21 for acquiring the head of the name entry 26 connected to the hash table 25 in the name table 24 corresponding to the hash value 101 of the name information 10, and the name entry 26. Name entry next search means 22 for searching the next name entry having the same hash value by tracing the chain address 261, and name table top acquisition means 2
1 and the name table next retrieval means 22 for name information 1
When a name entry 26 having a user word 262 that matches the user word 102 in 0 is detected, the chain is reorganized so that the detected name entry is connected to the head of the chain connected from the hash table 25. And knitting means 23. The name table 24 is a hash table 25 that manages name entries for each hash value, and a user word 2 that has the same hash value.
62 and a name entry 26 including a chain address 261 connecting the user word 262 from the hash table 25.

【0008】図2は名前テーブル24の詳細な構成を示
す図で、ハッシュテーブル25はハッシュ値ごとにチェ
ーンでつながった名前エントリへのチェーンアドレス3
01の並びからなる。
FIG. 2 is a diagram showing a detailed structure of the name table 24. The hash table 25 shows a chain address 3 for a name entry connected by a chain for each hash value.
It consists of a sequence of 01.

【0009】図3は名前検索部20の処理を示す流れ
図、図4は名前テーブル再編成手段23の処理を示す流
れ図である。
FIG. 3 is a flow chart showing the processing of the name search unit 20, and FIG. 4 is a flow chart showing the processing of the name table reorganizing means 23.

【0010】次に、図3および図4を参照して図1の実
施例の動作について説明する。コンパイラ2は原始プロ
グラム1を入力し、字句解析処理部4、構文解析処理部
5において原始プログラム1が構文的に正しいことをチ
ュックし、その後に意味解析処理部6を起動する。意味
解析処理部6は、原始プログラム1内の利用者語に対し
て、二重定義チェック、未定義チェックを行うために名
前検索部20を起動する。名前検索部20は名前情報1
0を受取り、名前情報10のハッシュ値101を名前テ
ーブル先頭取得手段21へ渡す(ステップ401)。名
前テーブル先頭取得手段21はハッシュ値101に対応
する名前エントリ26へのチェーンアドレス301をハ
ッシュテーブル25から取得し、名前検索部20へ返
す。名前検索部20は名前テーブル先頭取得手段21か
ら受取ったチェーンアドレス301をもとに、先頭の名
前エントリ26が存在するか検査し(ステップ40
2)、名前エントリ26が存在しない場合は名前情報1
0に対応する名前エントリ26が存在しない(ステップ
408)として終了する。先頭の名前エントリ26が存
在する場合は、名前エトリ26内の利用者語262が名
前情報10内の利用者語102と一致するか検査し(ス
テップ403)、一致する場合は名前テーブル再編成手
段23によってチェーンの再編成を行い(ステップ40
7)、一致しない場合は名前テーブル次検索手段22を
呼出す。名前テーブル次検索手段22は次の名前エント
リ26を示す名前エントリ26のチェーンアドレス26
1を返す。名前検索部20は名前テーブル次検索手段2
2から受取ったチェーンアドレス261をもとに、次の
名前エントリ26が存在するか検査し(ステップ40
5)、名前エントリ26が存在しない場合は名前情報1
0に対応する名前エントリ26が存在しない(ステップ
408)として終了する。次の名前エントリ26が存在
する場合は、名前エントリ26内の利用者語262が名
前情報10内の利用者語102と一致するか検査し(ス
テップ406)、一致する場合は名前テーブル再編成手
段23によってチェーンの再編成を行い(ステップ40
7)、一致しない場合はさらに続けて名前テーブル次検
索手段22を呼出して検索を続ける(ステップ40
4)。名前検索部20は名前情報10の利用者語102
に一致する利用者語262をもつ名前エントリ26を検
出した場合には、名前テーブル再編成手段23を呼出す
(ステップ407)。名前テーブル再編成手段23は検
出した名前エントリ26がハッシュテーブル25がつな
がる先頭の名前エントリ26か判定し(ステップ50
1)、先頭の名前エントリ26の場合はなにもしない。
先頭の名前エントリ26でない場合は直前の名前エント
リ26のチェーンアドレス261に検出した名前エント
リ26のチェーンアドレス261の値を入れ(ステップ
502)、検出した名前エントリ26のチェーンアドレ
ス261にハッシュテーブル25内のハッシュ値に対応
する名前エントリへのチェーンアドレス301の値を入
れ(ステップ503)、ハッシュテーブル25内のハッ
シュ値に対応する名前エントリへのチェーンアドレス3
01として検出した名前エントリ26を指すアドレスの
値を入れて(ステップ504)、名前テーブル再編成手
段23を終了する。
Next, the operation of the embodiment shown in FIG. 1 will be described with reference to FIGS. The compiler 2 inputs the source program 1, checks whether the source program 1 is syntactically correct in the lexical analysis processing unit 4 and the syntax analysis processing unit 5, and then activates the semantic analysis processing unit 6. The semantic analysis processing unit 6 activates the name search unit 20 to perform a double definition check and a non-definition check for the user words in the source program 1. The name search unit 20 uses the name information 1
0 is received, and the hash value 101 of the name information 10 is passed to the name table head acquisition means 21 (step 401). The name table head acquisition unit 21 acquires the chain address 301 to the name entry 26 corresponding to the hash value 101 from the hash table 25 and returns it to the name search unit 20. Based on the chain address 301 received from the name table head acquisition means 21, the name search unit 20 checks whether the head name entry 26 exists (step 40).
2), if the name entry 26 does not exist, name information 1
The name entry 26 corresponding to 0 does not exist (step 408) and the process ends. If the first name entry 26 exists, it is checked whether the user word 262 in the name entry 26 matches the user word 102 in the name information 10 (step 403). If they match, the name table reorganization means. 23 to reorganize the chain (step 40
7) If they do not match, the name table next search means 22 is called. The name table next search means 22 indicates the next name entry 26, and the chain address 26 of the name entry 26.
Returns 1. The name search unit 20 uses the name table next search means 2
It is checked whether the next name entry 26 exists based on the chain address 261 received from step 2 (step 40
5), if the name entry 26 does not exist, name information 1
The name entry 26 corresponding to 0 does not exist (step 408) and the process ends. If the next name entry 26 exists, it is checked whether the user word 262 in the name entry 26 matches the user word 102 in the name information 10 (step 406), and if they match, the name table reorganization means. 23 to reorganize the chain (step 40
7) If they do not match, the name table next search means 22 is further called to continue the search (step 40).
4). The name search unit 20 uses the user word 102 of the name information 10.
When the name entry 26 having the user word 262 matching with is detected, the name table reorganizing means 23 is called (step 407). The name table reorganization means 23 determines whether the detected name entry 26 is the first name entry 26 connected to the hash table 25 (step 50).
1), in the case of the name entry 26 at the head, nothing is done.
If it is not the first name entry 26, the value of the chain address 261 of the detected name entry 26 is put in the chain address 261 of the immediately preceding name entry 26 (step 502), and the chain address 261 of the detected name entry 26 is set in the hash table 25. The value of the chain address 301 to the name entry corresponding to the hash value of is entered (step 503), and the chain address 3 to the name entry corresponding to the hash value in the hash table 25 is entered.
The value of the address indicating the name entry 26 detected as 01 is entered (step 504), and the name table reorganization means 23 is terminated.

【0011】名前検索部20は名前テーブル再編成手段
23の終了後、検出名前エントリ30を意味解析処理部
6へ返却する。
After the name table reorganization means 23 is finished, the name search unit 20 returns the detected name entry 30 to the semantic analysis processing unit 6.

【0012】コンパイラ2は意味解析処理部6の終了
後、コード生成処理部7、目的プログラム出力処理部8
を起動し、目的プログラム出力処理部8は目的プログラ
ム3を出力する。
After the completion of the semantic analysis processing unit 6, the compiler 2 produces a code generation processing unit 7 and an object program output processing unit 8.
The target program output processing unit 8 outputs the target program 3.

【0013】[0013]

【発明の効果】以上説明したように本発明は、同一ハッ
シュ値をもつ名前エントリをつなぐチェーンの順序を、
利用者語に対応する名前エントリを検索した場合に、検
出した名前エントリをチェーンの先頭に位置付けるよう
に再編集するようにしているので、同一利用者語を繰返
して検索する場合に早く検出できるという効果を有す
る。
As described above, according to the present invention, the order of the chains connecting the name entries having the same hash value is
When a name entry corresponding to a user word is searched, the detected name entry is re-edited so that it is positioned at the beginning of the chain, so it can be quickly detected when repeatedly searching the same user word. Have an effect.

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

【図1】本発明の一実施例を含むコンパイラシステムの
構成図である。
FIG. 1 is a configuration diagram of a compiler system including an embodiment of the present invention.

【図2】図1の実施例中の名前テーブルの詳細構成図で
ある。
FIG. 2 is a detailed configuration diagram of a name table in the embodiment of FIG.

【図3】図1の実施例中の名前検索部の処理の流れ図で
ある。
FIG. 3 is a flow chart of processing of a name search unit in the embodiment of FIG.

【図4】図1の実施例中の名前テーブル再編成手段の処
理の流れ図である。
FIG. 4 is a flow chart of processing of a name table reorganization unit in the embodiment of FIG.

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

1 原始プログラム 2 コンパイラ 3 目的プログラム 4 字句解析処理部 5 構文解析処理部 6 意味解析処理部 7 コード生成処理部 8 目的プログラム出力処理部 10 名前情報 20 名前検索部 21 名前テーブル先頭取得手段 22 名前テーブル次検索手段 23 名前テーブル再編成手段 24 名前テーブル 25 ハッシュテーブル 26 名前エントリ 30 検出名前エントリ 101 ハッシュ値 102 利用者語 261 チェーンアドレス 262 利用者語 DESCRIPTION OF SYMBOLS 1 source program 2 compiler 3 target program 4 lexical analysis processing unit 5 syntactic analysis processing unit 6 semantic analysis processing unit 7 code generation processing unit 8 target program output processing unit 10 name information 20 name search unit 21 name table top acquisition unit 22 name table Next search means 23 Name table reorganization means 24 Name table 25 Hash table 26 Name entry 30 Detected name entry 101 Hash value 102 User word 261 Chain address 262 User word

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 コンパイラにおける利用者語の検索を行
なうための利用者語検索方式において、利用者語を利用
者語からハッシュ計算によって得られるハッシュ値をも
とに同一ハッシュ値をもつ利用者語を名前エントリとし
てつなぐチェーンアドレスにより管理するハッシュテー
ブルと,利用者語とそのハッシュ値と同一のハッシュ値
を持つ利用者語のチェーンアドレスとを持つ名前エント
リとからなる名前テーブルと、この名前テーブルから利
用者語のハッシュ値と同一ハッシュ値を持つ名前エント
リの先頭を検索する名前テーブル先頭取得手段と、この
名前テーブル先頭取得手段で取得した名前エントリの次
の名前エントリをチェーンアドレスをたどって順次取得
する名前テーブル次検索手段と、前記名前テーブル先頭
取得手段と名前テーブル次検索手段とによって検出した
利用者語に対応する名前エントリを、ハッシュ値をもと
にしたチェーンの先頭の名前エントリとして位置付けて
チェーンを再編成する名前エントリ再編成手段とからな
る名前検索部をもつことを特徴とする利用者語検索方
式。
1. In a user word search method for searching a user word in a compiler, a user word having a same hash value based on a hash value obtained by hash calculation of the user word from the user word. From the name table, which consists of a hash table that manages with chain addresses that connect to each other as a name entry, and a name entry that has a user word and a chain address of a user word that has the same hash value as that hash value. The name table head acquisition means for searching the head of the name entry having the same hash value as the user's word hash value, and the name entry next to the name entry acquired by this name table head acquisition means are sequentially acquired by tracing the chain address. Name table next retrieval means, name table top acquisition means and name table A name entry reorganization means for reorganizing the chain by locating the name entry corresponding to the user word detected by the bull next retrieval means as the first name entry of the chain based on the hash value. A user word search method characterized by having.
JP5214701A 1993-08-31 1993-08-31 User word retrieval system Withdrawn JPH0764801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5214701A JPH0764801A (en) 1993-08-31 1993-08-31 User word retrieval system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5214701A JPH0764801A (en) 1993-08-31 1993-08-31 User word retrieval system

Publications (1)

Publication Number Publication Date
JPH0764801A true JPH0764801A (en) 1995-03-10

Family

ID=16660176

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5214701A Withdrawn JPH0764801A (en) 1993-08-31 1993-08-31 User word retrieval system

Country Status (1)

Country Link
JP (1) JPH0764801A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079473A (en) * 2013-10-18 2015-04-23 ウィンウェイ システムズ, インコーポレイテッドWinway Systems, Inc. Data management method, and system supporting the same
KR101582050B1 (en) * 2014-10-24 2015-12-31 이화여자대학교 산학협력단 Apparatus and method for searching name using bloom filter pre-searching
WO2018135275A1 (en) * 2017-01-19 2018-07-26 富士通株式会社 Information processing apparatus, information processing method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015079473A (en) * 2013-10-18 2015-04-23 ウィンウェイ システムズ, インコーポレイテッドWinway Systems, Inc. Data management method, and system supporting the same
KR101582050B1 (en) * 2014-10-24 2015-12-31 이화여자대학교 산학협력단 Apparatus and method for searching name using bloom filter pre-searching
WO2018135275A1 (en) * 2017-01-19 2018-07-26 富士通株式会社 Information processing apparatus, information processing method, and program
US11144236B2 (en) 2017-01-19 2021-10-12 Fujitsu Limited Information processing apparatus, information processing method, and non-transitory computer-readable storage medium for storing program

Similar Documents

Publication Publication Date Title
US6973429B2 (en) Grammar generation for voice-based searches
US7111025B2 (en) Information retrieval system and method using index ANDing for improving performance
JP3152868B2 (en) Search device and dictionary / text search method
WO2003017143A3 (en) Method and system for enhanced data searching
WO2004114163A3 (en) Method and system for enhanced data searching
WO1998039714A1 (en) Information retrieval utilizing semantic representation of text
JPH06266780A (en) Character string retrieving method by semantic pattern recognition and device therefor
CN111221852A (en) Mixed query processing method and device based on big data
AU685657B2 (en) Method for performing joins in a database system
JPH0764801A (en) User word retrieval system
CN112527794B (en) Data processing method and system for realizing aggregate data types in database
JP2003108595A (en) Information retrieving device, information retrieving method and information retrieving program
JP2922025B2 (en) Name search method
JP3506058B2 (en) Semantic analysis method and apparatus, and recording medium storing semantic analysis program
JPH03268064A (en) Data base retrieving system
JPH03116376A (en) Keyword matching device
JPS63238622A (en) Relation retrieval system
CN111090671A (en) Method and device for eliminating difference between hollow character string and invalid character string in database
JPH05108719A (en) Information retrieving device
JPH07160492A (en) Check device for resource access program
JPH07129446A (en) Data base access method
JPH0540783A (en) Natural language analysis device
JPH0752391B2 (en) Translation method of source program including multiple database descriptions
JPH07244601A (en) Method and device for accessing relational data base
JPH06290054A (en) Symbol table in compiler and reserved word table retrieving system

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20001031