home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
tlist11.lbr
/
SETUPHSH.PQS
/
setuphsh.pas
Wrap
Pascal/Delphi Source File
|
1985-11-08
|
2KB
|
50 lines
PROCEDURE Set_up_hash_tables;
{
This procedure sets up the hash tables for each symbol found in the "reserved
words", "standard identifiers", and "dedicated identifiers" symbol tables.
The symbols are read from and written to the same symbol tables so that the
hash routines may be lifted "en masse" and used elsewhere where the
tables (including the symbol tables) must be built one word at a time.
}
BEGIN
Count := 0;
FOR I := 1 TO Res_Word_Hsh_size DO Reserved_Word_HT[I] := 0;
FOR I := 1 TO No_Reserved_Words DO Reserved_Word_CT[I] := 0;
FOR I := 1 TO No_Reserved_Words DO
BEGIN
Symbol := Reserved_Word_ST[I];
Store_Symbol(Symbol, Reserved_Word_HT, Reserved_Word_CT, Reserved_Word_ST,
Res_Word_Hsh_size, FALSE, Count);
END;
Count := 0;
FOR I := 1 TO Stan_Ident_Hsh_size DO Standard_Identifier_HT[I] := 0;
FOR I := 1 TO No_Standard_Identifiers DO Standard_Identifier_CT[I] := 0;
FOR I := 1 TO No_Standard_Identifiers DO
BEGIN
Symbol := Standard_Identifier_ST[I];
Find_Symbol(Symbol, Reserved_Word_HT, Reserved_Word_CT, Reserved_Word_ST,
Res_Word_Hsh_size, Found, Dummy);
IF NOT Found THEN
Store_Symbol(Symbol, Standard_Identifier_HT, Standard_Identifier_CT,
Standard_Identifier_ST, Stan_Ident_Hsh_size, FALSE, Count);
END;
Count := 0;
FOR I := 1 TO Ded_Ident_Hsh_size DO Dedicated_Identifier_HT[I] := 0;
FOR I := 1 TO No_Dedicated_Identifiers DO Dedicated_Identifier_HT[I] :=0;
FOR I := 1 TO No_Dedicated_Identifiers DO
BEGIN
Symbol := Dedicated_Identifier_ST[I];
Find_Symbol(Symbol, Reserved_Word_HT, Reserved_Word_CT, Reserved_Word_ST,
Res_Word_Hsh_size, Found, Dummy);
IF NOT Found THEN
BEGIN
Find_Symbol(Symbol, Standard_Identifier_HT, Standard_Identifier_CT,
Standard_Identifier_ST, Stan_Ident_Hsh_size, Found, Dummy);
IF NOT Found THEN
Store_Symbol(Symbol, Dedicated_Identifier_HT, Dedicated_Identifier_CT,
Dedicated_Identifier_ST, Ded_Ident_Hsh_size, FALSE, Count);
END;
END;
END;