1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Completely new asso_values search algorithm.

This commit is contained in:
Bruno Haible
2003-03-18 10:22:37 +00:00
parent 40f37680ac
commit 6d268d095b
20 changed files with 1918 additions and 2117 deletions

View File

@@ -1,3 +1,48 @@
2002-12-08 Bruno Haible <bruno@clisp.org>
Completely new asso_values search algorithm.
* src/search.h (Search::compute_occurrence, Search::clear_determined,
Search::set_determined, Search::already_determined, Search::reorder):
Remove functions.
(Search::init_asso_values, Search::sort_by_occurrence,
Search::compute_occurrence, Search::sort_by_occurrence,
Search::has_collisions, Search::collision_prior_to): Remove functions.
(Search::compute_partition, Search::count_possible_collisions,
Search::unchanged_partition): New method declarations.
(Search::_determined): Remove field.
* src/search.cc (Search::prepare): Don't initialize _determined.
(Search::compute_occurrence, greater_by_occurrence,
Search::clear_determined, Search::set_determined,
Search::already_determined, Search::reorder): Remove functions.
(Search::init_asso_values, compute_disjoint_union,
Search::sort_by_occurrence, Search::compute_occurrence,
Search::sort_by_occurrence, Search::has_collisions,
Search::collision_prior_to): Remove functions.
(StackEntry): Remove class.
(EquivalenceClass, Step): New classes.
(equals, Search::compute_partition, delete_partition,
Search::count_possible_collisions, Search::unchanged_partition): New
functions.
(Search::find_asso_values): Completely rewritten.
(Search::find_good_asso_values): Don't call reorder().
(Search::~Search): Don't free _determined.
* src/keyword.h (KeywordExt::_occurrence): Remove field.
* src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values.
(Options::_iterations): Remove field.
* src/options.icc (Options::get_iterations): Remove method.
* src/options.cc (Options::long_usage): Remove mention of -f and -o.
(Options::Options): Don't initialize _iterations.
(Options::~Options): Update.
(Options::parse_options): Do nothing for options -f, -o, -O.
* doc/gperf.texi: (Contributors): Update.
(Algorithmic Details): Remove options -f and -o. Update description
of option -s.
* tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp,
tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp,
tests/test-4.exp): Regenerated, smaller than before.
* tests/test-6.exp: Update.
* NEWS: Update.
2002-12-08 Bruno Haible <bruno@clisp.org>
* src/search.h (Search::_alpha_size): Change type to 'unsigned int'.

13
NEWS
View File

@@ -1,7 +1,5 @@
New in 2.8:
New in 2.96:
* Added option -m/--multiple-iterations that reduces the size of the
generated table.
* Added option --output that allows to specify the output file name.
* Some options have been renamed:
--hash-fn-name=NAME --> --hash-function-name=NAME
@@ -34,9 +32,14 @@ New in 2.8:
* Some keyword sets containing permutations, like { "xy", "yx", "xz", "zx" }
or { "abc", "acb", "bca", "cab" }, are now handled by gperf without
requiring the option -D.
* The generated table is usually much smaller than it was with earlier
versions of gperf.
* Added option -m/--multiple-iterations that allows to further reduce the
size of the generated table.
* When the search for a good hash function is not immediately successful,
backtracking is now used to continue the search. Earlier versions of gperf
bailed out with an "Internal error, duplicate hash code value".
the table's size will grow as needed. Earlier versions of gperf bailed
out with an "Internal error, duplicate hash code value".
* The options -f/--fast and -o/--occurrence-sort have no effect any more.
* Bug fixes.
New in 2.7.2:

View File

@@ -7,7 +7,7 @@
@c some day we should @include version.texi instead of defining
@c these values at hand.
@set UPDATED 20 November 2002
@set UPDATED 8 December 2002
@set EDITION 2.7.2
@set VERSION 2.7.2
@c ---------------------
@@ -169,8 +169,9 @@ In addition, Adam de Boor and Nels Olson provided many tips and insights
that greatly helped improve the quality and functionality of @code{gperf}.
@item
A testsuite was added by Bruno Haible. He also rewrote the input routines
and the output routines for better reliability.
Bruno Haible enhanced and optimized the search algorithm. He also rewrote
the input routines and the output routines for better reliability, and
added a testsuite.
@end itemize
@node Motivation, Search Structures, Contributors, Top
@@ -1005,15 +1006,6 @@ Using this option usually means that the generated hash function is no
longer perfect. On the other hand, it permits @code{gperf} to work on
keyword sets that it otherwise could not handle.
@item -f @var{iteration-amount}
@itemx --fast=@var{iteration-amount}
Generate the perfect hash function ``fast''. This decreases
@code{gperf}'s running time at the cost of minimizing generated
table-size. The iteration amount represents the number of times to
iterate when resolving a collision. `0' means iterate by the number of
keywords. This option is probably most useful when used in conjunction
with option @samp{-o} for @emph{large} keyword sets.
@item -m @var{iterations}
@itemx --multiple-iterations=@var{iterations}
Perform multiple choices of the @samp{-i} and @samp{-j} values, and
@@ -1043,24 +1035,6 @@ Instructs the generator not to include the length of a keyword when
computing its hash value. This may save a few assembly instructions in
the generated lookup table.
@item -o
@itemx --occurrence-sort
Reorders the keywords by sorting the keywords so that keywords containing
frequently occuring byte values appear first. A second reordering
pass follows so that keywords with ``already determined values'' are placed
towards the front of the keyword list. This may decrease the time required
to generate a perfect hash function for many keyword sets, and also
produce more minimal perfect hash functions. The reason for this is
that the reordering helps prune the search time by handling inevitable
collisions early in the search process. On the other hand, in practice,
a decreased search time also means a less minimal hash function, and a
higher frequency of backtracking. Furthermore, if the
number of keywords is @emph{very} large using @samp{-o} may
@emph{increase} @code{gperf}'s execution time, since collisions will
begin earlier and continue throughout the remainder of keyword
processing. See Cichelli's paper from the January 1980 Communications
of the ACM for details.
@item -r
@itemx --random
Utilizes randomness to initialize the associated values table. This
@@ -1092,10 +1066,7 @@ The default value is 1, thus the default maximum associated value about
the same size as the number of keywords (for efficiency, the maximum
associated value is always rounded up to a power of 2). The actual
table size may vary somewhat, since this technique is essentially a
heuristic. In particular, setting this value too high slows down
@code{gperf}'s runtime, since it must search through a much larger range
of values. Judicious use of the @samp{-f} option helps alleviate this
overhead, however.
heuristic.
@end table
@node Verbosity, , Algorithmic Details, Options
@@ -1188,19 +1159,19 @@ C and C++ routines.
[1] Chang, C.C.: @i{A Scheme for Constructing Ordered Minimal Perfect
Hashing Functions} Information Sciences 39(1986), 187-195.
[2] Cichelli, Richard J. @i{Author's Response to ``On Cichelli's Minimal Perfect Hash
Functions Method''} Communications of the ACM, 23, 12(December 1980), 729.
[3] Cichelli, Richard J. @i{Minimal Perfect Hash Functions Made Simple}
Communications of the ACM, 23, 1(January 1980), 17-19.
[4] Cook, C. R. and Oldehoeft, R.R. @i{A Letter Oriented Minimal
Perfect Hashing Function} SIGPLAN Notices, 17, 9(September 1982), 18-27.
[5] Cormack, G. V. and Horspool, R. N. S. and Kaiserwerth, M.
@i{Practical Perfect Hashing} Computer Journal, 28, 1(January 1985), 54-58.
[6] Jaeschke, G. @i{Reciprocal Hashing: A Method for Generating Minimal
Perfect Hashing Functions} Communications of the ACM, 24, 12(December
1981), 829-833.

View File

@@ -35,7 +35,7 @@ Keyword_List::Keyword_List (Keyword *car)
/* ------------------------- KeywordExt_List class ------------------------- */
/* Unused constructor. */
/* Constructor. */
KeywordExt_List::KeywordExt_List (KeywordExt *car)
: Keyword_List (car)
{

View File

@@ -48,7 +48,7 @@ protected:
class KeywordExt_List : public Keyword_List
{
public:
/* Unused constructor. */
/* Constructor. */
KeywordExt_List (KeywordExt *car);
/* Access to first element of list. */

View File

@@ -75,7 +75,6 @@ struct KeywordExt : public Keyword
void delete_selchars ();
/* Data members used by the algorithm. */
int _occurrence; /* Frequency of key set occurrences. */
int _hash_value; /* Hash value for the keyword. */
/* Data members used by the output routines. */

View File

@@ -195,13 +195,6 @@ Options::long_usage (FILE * stream) const
fprintf (stream,
" -D, --duplicates Handle keywords that hash to duplicate values. This\n"
" is useful for certain highly redundant keyword sets.\n");
fprintf (stream,
" -f, --fast=ITERATIONS Generate the gen-perf.hash function \"fast\". This\n"
" decreases gperf's running time at the cost of\n"
" minimizing generated table size. The numeric\n"
" argument represents the number of times to iterate\n"
" when resolving a collision. '0' means \"iterate by\n"
" the number of keywords\".\n");
fprintf (stream,
" -m, --multiple-iterations=ITERATIONS\n"
" Perform multiple choices of the -i and -j values,\n"
@@ -220,10 +213,6 @@ Options::long_usage (FILE * stream) const
fprintf (stream,
" -n, --no-strlen Do not include the length of the keyword when\n"
" computing the hash function.\n");
fprintf (stream,
" -o, --occurrence-sort Reorders input keys by frequency of occurrence of\n"
" the key sets. This should decrease the search time\n"
" dramatically.\n");
fprintf (stream,
" -r, --random Utilizes randomness to initialize the associated\n"
" values table.\n");
@@ -429,7 +418,6 @@ Options::Options ()
_input_file_name (NULL),
_output_file_name (NULL),
_language (NULL),
_iterations (0),
_jump (DEFAULT_JUMP_VALUE),
_initial_asso_value (0),
_asso_iterations (0),
@@ -454,14 +442,12 @@ Options::~Options ()
{
fprintf (stderr, "\ndumping Options:"
"\nDEBUG is.......: %s"
"\nORDER is.......: %s"
"\nTYPE is........: %s"
"\nRANDOM is......: %s"
"\nSWITCH is......: %s"
"\nNOLENGTH is....: %s"
"\nLENTABLE is....: %s"
"\nDUP is.........: %s"
"\nFAST is........: %s"
"\nCOMP is........: %s"
"\nNOTYPE is......: %s"
"\nGLOBAL is......: %s"
@@ -473,8 +459,6 @@ Options::~Options ()
"\nENUM is........: %s"
"\nINCLUDE is.....: %s"
"\nSEVENBIT is....: %s"
"\nOPT_CHOICE is..: %s"
"\niterations = %d"
"\nlookup function name = %s"
"\nhash function name = %s"
"\nword list name = %s"
@@ -487,14 +471,12 @@ Options::~Options ()
"\ndelimiters = %s"
"\nnumber of switch statements = %d\n",
_option_word & DEBUG ? "enabled" : "disabled",
_option_word & ORDER ? "enabled" : "disabled",
_option_word & TYPE ? "enabled" : "disabled",
_option_word & RANDOM ? "enabled" : "disabled",
_option_word & SWITCH ? "enabled" : "disabled",
_option_word & NOLENGTH ? "enabled" : "disabled",
_option_word & LENTABLE ? "enabled" : "disabled",
_option_word & DUP ? "enabled" : "disabled",
_option_word & FAST ? "enabled" : "disabled",
_option_word & COMP ? "enabled" : "disabled",
_option_word & NOTYPE ? "enabled" : "disabled",
_option_word & GLOBAL ? "enabled" : "disabled",
@@ -506,8 +488,6 @@ Options::~Options ()
_option_word & ENUM ? "enabled" : "disabled",
_option_word & INCLUDE ? "enabled" : "disabled",
_option_word & SEVENBIT ? "enabled" : "disabled",
_option_word & OPT_CHOICE ? "enabled" : "disabled",
_iterations,
_function_name, _hash_name, _wordlist_name, _slot_name,
_initializer_suffix, _asso_iterations, _jump, _size_multiple,
_initial_asso_value, _delimiters, _total_switches);
@@ -711,15 +691,7 @@ Options::parse_options (int argc, char *argv[])
break;
}
case 'f': /* Generate the hash table "fast". */
{
_option_word |= FAST;
if ((_iterations = atoi (/*getopt*/optarg)) < 0)
{
fprintf (stderr, "iterations value must not be negative, assuming 0\n");
_iterations = 0;
}
break;
}
break; /* Not needed any more. */
case 'F':
{
_initializer_suffix = /*getopt*/optarg;
@@ -861,15 +833,9 @@ Options::parse_options (int argc, char *argv[])
break;
}
case 'o': /* Order input by frequency of key set occurrence. */
{
_option_word |= ORDER;
break;
}
break; /* Not needed any more. */
case 'O': /* Optimized choice during collision resolution. */
{
_option_word |= OPT_CHOICE;
break;
}
break; /* Not needed any more. */
case 'p': /* Generated lookup function a pointer instead of int. */
break; /* This is now the default. */
case 'r': /* Utilize randomness to initialize the associated values table. */

View File

@@ -39,72 +39,63 @@ enum Option_Type
/* Enable debugging (prints diagnostics to stderr). */
DEBUG = 1 << 0,
/* Apply ordering heuristic to speed-up search time. */
ORDER = 1 << 1,
/* Use the given key positions. */
POSITIONS = 1 << 2,
POSITIONS = 1 << 1,
/* Use all characters in hash function. */
ALLCHARS = 1 << 3,
ALLCHARS = 1 << 2,
/* Handle user-defined type structured keyword input. */
TYPE = 1 << 4,
TYPE = 1 << 3,
/* Randomly initialize the associated values table. */
RANDOM = 1 << 5,
RANDOM = 1 << 4,
/* Generate switch output to save space. */
SWITCH = 1 << 6,
SWITCH = 1 << 5,
/* Don't include keyword length in hash computations. */
NOLENGTH = 1 << 7,
NOLENGTH = 1 << 6,
/* Generate a length table for string comparison. */
LENTABLE = 1 << 8,
LENTABLE = 1 << 7,
/* Handle duplicate hash values for keywords. */
DUP = 1 << 9,
/* Generate the hash function "fast". */
FAST = 1 << 10,
DUP = 1 << 8,
/* Don't include user-defined type definition in output -- it's already
defined elsewhere. */
NOTYPE = 1 << 11,
NOTYPE = 1 << 9,
/* Generate strncmp rather than strcmp. */
COMP = 1 << 12,
COMP = 1 << 10,
/* Make the keyword table a global variable. */
GLOBAL = 1 << 13,
GLOBAL = 1 << 11,
/* Make the generated tables readonly (const). */
CONST = 1 << 14,
CONST = 1 << 12,
/* Generate K&R C code: no prototypes, no const. */
KRC = 1 << 15,
KRC = 1 << 13,
/* Generate C code: no prototypes, but const (user can #define it away). */
C = 1 << 16,
C = 1 << 14,
/* Generate ISO/ANSI C code: prototypes and const, but no class. */
ANSIC = 1 << 17,
ANSIC = 1 << 15,
/* Generate C++ code: prototypes, const, class, inline, enum. */
CPLUSPLUS = 1 << 18,
CPLUSPLUS = 1 << 16,
/* Use enum for constants. */
ENUM = 1 << 19,
ENUM = 1 << 17,
/* Generate #include statements. */
INCLUDE = 1 << 20,
INCLUDE = 1 << 18,
/* Assume 7-bit, not 8-bit, characters. */
SEVENBIT = 1 << 21,
/* Apply optimized collision resolution to speed-up search time. */
OPT_CHOICE = 1 << 22
SEVENBIT = 1 << 19
};
/* Class manager for gperf program Options. */
@@ -140,9 +131,6 @@ public:
/* Sets the output language, if not already set. */
void set_language (const char *language);
/* Returns the iterations value. */
int get_iterations () const;
/* Returns the jump value. */
int get_jump () const;
@@ -222,9 +210,6 @@ private:
/* The output language. */
const char * _language;
/* Amount to iterate when a collision occurs. */
int _iterations;
/* Jump length when trying alternative values. */
int _jump;

View File

@@ -51,13 +51,6 @@ Options::get_output_file_name () const
return _output_file_name;
}
/* Returns the iterations value. */
INLINE int
Options::get_iterations () const
{
return _iterations;
}
/* Returns the jump value. */
INLINE int
Options::get_jump () const

File diff suppressed because it is too large Load Diff

View File

@@ -30,6 +30,8 @@
#include "positions.h"
#include "bool-array.h"
struct EquivalenceClass;
class Search
{
public:
@@ -62,16 +64,6 @@ private:
void prepare ();
/* Computes the sum of occurrences of the _selchars of a keyword. */
int compute_occurrence (KeywordExt *ptr) const;
/* Auxiliary functions used by Search::reorder(). */
void clear_determined ();
void set_determined (KeywordExt *keyword);
bool already_determined (KeywordExt *keyword) const;
/* Reorders the keyword list so as to minimize search times. */
void reorder ();
/* Returns the length of keyword list. */
int keyword_list_length () const;
@@ -83,30 +75,20 @@ private:
/* Initializes the asso_values[] related parameters. */
void prepare_asso_values ();
/* Puts a first guess into asso_values[]. */
void init_asso_values ();
EquivalenceClass * compute_partition (bool *undetermined) const;
unsigned int count_possible_collisions (EquivalenceClass *partition, unsigned int c) const;
bool unchanged_partition (EquivalenceClass *partition, unsigned int c) const;
/* Finds some _asso_values[] that fit. */
void find_asso_values ();
/* Computes a keyword's hash value, relative to the current _asso_values[],
and stores it in keyword->_hash_value. */
int compute_hash (KeywordExt *keyword) const;
/* Computes the frequency of occurrence of a character among the keywords
up to the given keyword. */
unsigned int compute_occurrence (unsigned int c, KeywordExt *curr) const;
/* Sorts the given set in increasing frequency of _occurrences[]. */
void sort_by_occurrence (unsigned int *set, unsigned int len) const;
/* Sorts the given set in increasing frequency of occurrences among the
keywords up to the given keyword. */
void sort_by_occurrence (unsigned int *set, unsigned int len, KeywordExt *curr) const;
bool has_collisions (KeywordExt *curr);
KeywordExt * collision_prior_to (KeywordExt *curr);
/* Finds some _asso_values[] that fit. */
void find_asso_values ();
/* Finds good _asso_values[]. */
void find_good_asso_values ();
@@ -152,9 +134,6 @@ private:
/* Length of _head list. Number of keywords, not counting duplicates. */
int _list_len;
/* Vector used during Search::reorder(). */
bool * _determined;
/* Exclusive upper bound for every _asso_values[c]. A power of 2. */
unsigned int _asso_value_max;

View File

@@ -7,9 +7,9 @@ struct resword { const char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 83
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 20
#define MIN_HASH_VALUE 8
#define MAX_HASH_VALUE 141
/* maximum key range = 134, duplicates = 0 */
#define MIN_HASH_VALUE 12
#define MAX_HASH_VALUE 125
/* maximum key range = 114, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -25,32 +25,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 35, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 1, 142, 90, 1, 28,
40, 6, 1, 24, 3, 13, 142, 36, 60, 14,
49, 3, 6, 142, 19, 8, 1, 50, 33, 11,
2, 23, 4, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
142, 142, 142, 142, 142, 142
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 19, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 1, 126, 12, 50, 17,
22, 18, 51, 37, 5, 10, 126, 15, 35, 49,
27, 40, 28, 126, 2, 20, 1, 33, 64, 7,
11, 4, 7, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126
};
register int hval = len;
@@ -71,112 +71,102 @@ static struct resword wordlist[] =
{
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"out", TYPE_QUAL, RID_OUT},
{"", 0, 0},
{"float", TYPESPEC, RID_FLOAT},
{"__typeof", TYPEOF, NORID},
{"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"__real__", REALPART, NORID},
{"__typeof__", TYPEOF, NORID},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"if", IF, NORID},
{"short", TYPESPEC, RID_SHORT},
{"__restrict", TYPE_QUAL, RID_RESTRICT},
{"int", TYPESPEC, RID_INT},
{"sizeof", SIZEOF, NORID},
{"__restrict__", TYPE_QUAL, RID_RESTRICT},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"__imag__", IMAGPART, NORID},
{"__asm__", ASM_KEYWORD, NORID},
{"__inline__", SCSPEC, RID_INLINE},
{"__iterator", SCSPEC, RID_ITERATOR},
{"__iterator__", SCSPEC, RID_ITERATOR},
{"__alignof__", ALIGNOF, NORID},
{"__const", TYPE_QUAL, RID_CONST},
{"__attribute__", ATTRIBUTE, NORID},
{"__const__", TYPE_QUAL, RID_CONST},
{"struct", STRUCT, NORID},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"restrict", TYPE_QUAL, RID_RESTRICT},
{"__signed__", TYPESPEC, RID_SIGNED},
{"__extension__", EXTENSION, NORID},
{"inout", TYPE_QUAL, RID_INOUT},
{"__imag__", IMAGPART, NORID},
{"else", ELSE, NORID},
{"__inline__", SCSPEC, RID_INLINE},
{"byref", TYPE_QUAL, RID_BYREF},
{"__iterator__", SCSPEC, RID_ITERATOR},
{"__inline", SCSPEC, RID_INLINE},
{"__real__", REALPART, NORID},
{"switch", SWITCH, NORID},
{"__restrict", TYPE_QUAL, RID_RESTRICT},
{"goto", GOTO, NORID},
{"__restrict__", TYPE_QUAL, RID_RESTRICT},
{"struct", STRUCT, NORID},
{"while", WHILE, NORID},
{"restrict", TYPE_QUAL, RID_RESTRICT},
{"__const", TYPE_QUAL, RID_CONST},
{"oneway", TYPE_QUAL, RID_ONEWAY},
{"__const__", TYPE_QUAL, RID_CONST},
{"__complex", TYPESPEC, RID_COMPLEX},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"for", FOR, NORID},
{"__iterator", SCSPEC, RID_ITERATOR},
{"__imag", IMAGPART, NORID},
{"do", DO, NORID},
{"case", CASE, NORID},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"break", BREAK, NORID},
{"default", DEFAULT, NORID},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"@defs", DEFS, NORID},
{"id", OBJECTNAME, RID_ID},
{"", 0, 0},
{"__signed", TYPESPEC, RID_SIGNED},
{"bycopy", TYPE_QUAL, RID_BYCOPY},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"extern", SCSPEC, RID_EXTERN},
{"", 0, 0},
{"char", TYPESPEC, RID_CHAR},
{"return", RETURN, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"__complex", TYPESPEC, RID_COMPLEX},
{"in", TYPE_QUAL, RID_IN},
{"while", WHILE, NORID},
{"switch", SWITCH, NORID},
{"__attribute", ATTRIBUTE, NORID},
{"", 0, 0},
{"@compatibility_alias", ALIAS, NORID},
{"", 0, 0},
{"__real", REALPART, NORID},
{"out", TYPE_QUAL, RID_OUT},
{"__label__", LABEL, NORID},
{"@private", PRIVATE, NORID},
{"@selector", SELECTOR, NORID},
{"register", SCSPEC, RID_REGISTER},
{"__label__", LABEL, NORID},
{"", 0, 0}, {"", 0, 0},
{"enum", ENUM, NORID},
{"return", RETURN, NORID},
{"", 0, 0}, {"", 0, 0},
{"signed", TYPESPEC, RID_SIGNED},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"const", TYPE_QUAL, RID_CONST},
{"", 0, 0},
{"inline", SCSPEC, RID_INLINE},
{"__real", REALPART, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"void", TYPESPEC, RID_VOID},
{"continue", CONTINUE, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0},
{"@encode", ENCODE, NORID},
{"auto", SCSPEC, RID_AUTO},
{"__asm__", ASM_KEYWORD, NORID},
{"@interface", INTERFACE, NORID},
{"__alignof", ALIGNOF, NORID},
{"double", TYPESPEC, RID_DOUBLE},
{"__alignof__", ALIGNOF, NORID},
{"__signed", TYPESPEC, RID_SIGNED},
{"extern", SCSPEC, RID_EXTERN},
{"@protected", PROTECTED, NORID},
{"__attribute__", ATTRIBUTE, NORID},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{"__attribute", ATTRIBUTE, NORID},
{"@class", CLASS, NORID},
{"__asm", ASM_KEYWORD, NORID},
{"", 0, 0}, {"", 0, 0},
{"@implementation", IMPLEMENTATION, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"union", UNION, NORID},
{"", 0, 0}, {"", 0, 0},
{"@public", PUBLIC, NORID},
{"asm", ASM_KEYWORD, NORID},
{"", 0, 0},
{"@protocol", PROTOCOL, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"@end", END, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"__imag", IMAGPART, NORID},
{"static", SCSPEC, RID_STATIC},
{"inout", TYPE_QUAL, RID_INOUT},
{"auto", SCSPEC, RID_AUTO},
{"for", FOR, NORID},
{"case", CASE, NORID},
{"else", ELSE, NORID},
{"__typeof", TYPEOF, NORID},
{"@defs", DEFS, NORID},
{"if", IF, NORID},
{"do", DO, NORID},
{"@protocol", PROTOCOL, NORID},
{"short", TYPESPEC, RID_SHORT},
{"__asm", ASM_KEYWORD, NORID},
{"oneway", TYPE_QUAL, RID_ONEWAY},
{"inline", SCSPEC, RID_INLINE},
{"continue", CONTINUE, NORID},
{"@encode", ENCODE, NORID},
{"@end", END, NORID},
{"__alignof", ALIGNOF, NORID},
{"@interface", INTERFACE, NORID},
{"union", UNION, NORID},
{"@public", PUBLIC, NORID},
{"bycopy", TYPE_QUAL, RID_BYCOPY},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"double", TYPESPEC, RID_DOUBLE},
{"@class", CLASS, NORID},
{"default", DEFAULT, NORID},
{"goto", GOTO, NORID},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{"sizeof", SIZEOF, NORID},
{"signed", TYPESPEC, RID_SIGNED},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"break", BREAK, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"long", TYPESPEC, RID_LONG},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"char", TYPESPEC, RID_CHAR}
{"float", TYPESPEC, RID_FLOAT},
{"", 0, 0},
{"@compatibility_alias", ALIAS, NORID},
{"void", TYPESPEC, RID_VOID},
{"", 0, 0}, {"", 0, 0},
{"long", TYPESPEC, RID_LONG},
{"enum", ENUM, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"byref", TYPE_QUAL, RID_BYREF},
{"", 0, 0},
{"@implementation", IMPLEMENTATION, NORID},
{"", 0, 0}, {"", 0, 0},
{"asm", ASM_KEYWORD, NORID},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"volatile", TYPE_QUAL, RID_VOLATILE}
};
#ifdef __GNUC__

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@ struct resword { const char *name; short token; enum rid rid;};
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 16
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 250
/* maximum key range = 247, duplicates = 0 */
#define MAX_HASH_VALUE 163
/* maximum key range = 160, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -25,32 +25,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 0, 251, 64, 93, 3,
0, 0, 74, 35, 0, 26, 251, 2, 31, 65,
23, 76, 7, 19, 45, 37, 6, 64, 12, 38,
14, 4, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251, 251, 251, 251, 251,
251, 251, 251, 251, 251, 251
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 0, 164, 44, 58, 15,
55, 0, 24, 23, 25, 2, 164, 4, 26, 75,
36, 11, 40, 74, 14, 23, 1, 45, 45, 90,
50, 50, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164
};
register int hval = len;
@@ -84,162 +84,141 @@ is_reserved_word (str, len)
{
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"else", ELSE, NORID,},
{"true", CXX_TRUE, NORID,},
{"int", TYPESPEC, RID_INT,},
{"", 0, 0},
{"delete", DELETE, NORID,},
{"case", CASE, NORID,},
{"__real__", REALPART, NORID},
{"", 0, 0},
{"true", CXX_TRUE, NORID,},
{"catch", CATCH, NORID,},
{"typeid", TYPEID, NORID,},
{"try", TRY, NORID,},
{"", 0, 0}, {"", 0, 0},
{"void", TYPESPEC, RID_VOID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"inline", SCSPEC, RID_INLINE,},
{"", 0, 0},
{"private", VISSPEC, RID_PRIVATE,},
{"template", TEMPLATE, RID_TEMPLATE,},
{"protected", VISSPEC, RID_PROTECTED,},
{"extern", SCSPEC, RID_EXTERN,},
{"", 0, 0}, {"", 0, 0},
{"not", '!', NORID,},
{"", 0, 0},
{"__signed", TYPESPEC, RID_SIGNED},
{"int", TYPESPEC, RID_INT,},
{"__signed__", TYPESPEC, RID_SIGNED},
{"__real", REALPART, NORID},
{"", 0, 0},
{"xor_eq", ASSIGN, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"__attribute", ATTRIBUTE, NORID},
{"__asm__", ASM_KEYWORD, NORID},
{"", 0, 0},
{"__attribute__", ATTRIBUTE, NORID},
{"compl", '~', NORID,},
{"public", VISSPEC, RID_PUBLIC,},
{"not_eq", EQCOMPARE, NORID,},
{"switch", SWITCH, NORID,},
{"__extension__", EXTENSION, NORID},
{"", 0, 0},
{"export", SCSPEC, RID_EXPORT,},
{"case", CASE, NORID,},
{"__const", CV_QUALIFIER, RID_CONST},
{"__const__", CV_QUALIFIER, RID_CONST},
{"__volatile", CV_QUALIFIER, RID_VOLATILE},
{"", 0, 0},
{"__volatile__", CV_QUALIFIER, RID_VOLATILE},
{"__restrict", CV_QUALIFIER, RID_RESTRICT},
{"__restrict__", CV_QUALIFIER, RID_RESTRICT},
{"or", OROR, NORID,},
{"if", IF, NORID,},
{"", 0, 0},
{"__asm__", ASM_KEYWORD, NORID},
{"typeof", TYPEOF, NORID,},
{"__real", REALPART, NORID},
{"", 0, 0}, {"", 0, 0},
{"__sigof__", SIGOF, NORID /* Extension */,},
{"static_cast", STATIC_CAST, NORID,},
{"explicit", SCSPEC, RID_EXPLICIT,},
{"register", SCSPEC, RID_REGISTER,},
{"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
{"not", '!', NORID,},
{"for", FOR, NORID,},
{"extern", SCSPEC, RID_EXTERN,},
{"short", TYPESPEC, RID_SHORT,},
{"const", CV_QUALIFIER, RID_CONST,},
{"static", SCSPEC, RID_STATIC,},
{"", 0, 0},
{"__inline", SCSPEC, RID_INLINE},
{"", 0, 0},
{"__inline__", SCSPEC, RID_INLINE},
{"__restrict__", CV_QUALIFIER, RID_RESTRICT},
{"inline", SCSPEC, RID_INLINE,},
{"const_cast", CONST_CAST, NORID,},
{"static_cast", STATIC_CAST, NORID,},
{"__restrict", CV_QUALIFIER, RID_RESTRICT},
{"xor", '^', NORID,},
{"__wchar_t", TYPESPEC, RID_WCHAR /* Unique to ANSI C++ */,},
{"new", NEW, NORID,},
{"__alignof__", ALIGNOF, NORID},
{"signed", TYPESPEC, RID_SIGNED,},
{"and", ANDAND, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"explicit", SCSPEC, RID_EXPLICIT,},
{"", 0, 0},
{"__imag__", IMAGPART, NORID},
{"while", WHILE, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"do", DO, NORID,},
{"typename", TYPENAME_KEYWORD, NORID,},
{"friend", SCSPEC, RID_FRIEND,},
{"continue", CONTINUE, NORID,},
{"class", AGGR, RID_CLASS,},
{"default", DEFAULT, NORID,},
{"this", THIS, NORID,},
{"dynamic_cast", DYNAMIC_CAST, NORID,},
{"typeof", TYPEOF, NORID,},
{"virtual", SCSPEC, RID_VIRTUAL,},
{"export", SCSPEC, RID_EXPORT,},
{"and_eq", ASSIGN, NORID,},
{"__typeof__", TYPEOF, NORID},
{"__const__", CV_QUALIFIER, RID_CONST},
{"__volatile", CV_QUALIFIER, RID_VOLATILE},
{"short", TYPESPEC, RID_SHORT,},
{"__volatile__", CV_QUALIFIER, RID_VOLATILE},
{"__const", CV_QUALIFIER, RID_CONST},
{"namespace", NAMESPACE, NORID,},
{"char", TYPESPEC, RID_CHAR,},
{"unsigned", TYPESPEC, RID_UNSIGNED,},
{"double", TYPESPEC, RID_DOUBLE,},
{"or_eq", ASSIGN, NORID,},
{"__null", CONSTANT, RID_NULL},
{"if", IF, NORID,},
{"__signature__", AGGR, RID_SIGNATURE /* Extension */,},
{"__label__", LABEL, NORID},
{"long", TYPESPEC, RID_LONG,},
{"__imag", IMAGPART, NORID},
{"__asm", ASM_KEYWORD, NORID},
{"", 0, 0},
{"__sigof__", SIGOF, NORID /* Extension */,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"struct", AGGR, RID_RECORD,},
{"", 0, 0},
{"volatile", CV_QUALIFIER, RID_VOLATILE,},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"goto", GOTO, NORID,},
{"template", TEMPLATE, RID_TEMPLATE,},
{"this", THIS, NORID,},
{"false", CXX_FALSE, NORID,},
{"sizeof", SIZEOF, NORID,},
{"__complex__", TYPESPEC, RID_COMPLEX},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"for", FOR, NORID,},
{"or", OROR, NORID,},
{"register", SCSPEC, RID_REGISTER,},
{"throw", THROW, NORID,},
{"try", TRY, NORID,},
{"switch", SWITCH, NORID,},
{"typedef", SCSPEC, RID_TYPEDEF,},
{"", 0, 0},
{"using", USING, NORID,},
{"", 0, 0}, {"", 0, 0},
{"__complex", TYPESPEC, RID_COMPLEX},
{"operator", OPERATOR, NORID,},
{"__signature__", AGGR, RID_SIGNATURE /* Extension */,},
{"catch", CATCH, NORID,},
{"delete", DELETE, NORID,},
{"typeid", TYPEID, NORID,},
{"sigof", SIGOF, NORID /* Extension */,},
{"const_cast", CONST_CAST, NORID,},
{"__signed", TYPESPEC, RID_SIGNED},
{"class", AGGR, RID_CLASS,},
{"xor", '^', NORID,},
{"do", DO, NORID,},
{"continue", CONTINUE, NORID,},
{"auto", SCSPEC, RID_AUTO,},
{"__typeof__", TYPEOF, NORID},
{"", 0, 0},
{"asm", ASM_KEYWORD, NORID,},
{"signature", AGGR, RID_SIGNATURE /* Extension */,},
{"enum", ENUM, NORID,},
{"reinterpret_cast", REINTERPRET_CAST, NORID,},
{"mutable", SCSPEC, RID_MUTABLE,},
{"__alignof", ALIGNOF, NORID},
{"return", RETURN_KEYWORD, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0},
{"__alignof__", ALIGNOF, NORID},
{"float", TYPESPEC, RID_FLOAT,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"struct", AGGR, RID_RECORD,},
{"long", TYPESPEC, RID_LONG,},
{"__null", CONSTANT, RID_NULL},
{"", 0, 0},
{"__label__", LABEL, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"reinterpret_cast", REINTERPRET_CAST, NORID,},
{"__inline__", SCSPEC, RID_INLINE},
{"__imag__", IMAGPART, NORID},
{"typename", TYPENAME_KEYWORD, NORID,},
{"friend", SCSPEC, RID_FRIEND,},
{"compl", '~', NORID,},
{"public", VISSPEC, RID_PUBLIC,},
{"bitor", '|', NORID,},
{"namespace", NAMESPACE, NORID,},
{"or_eq", ASSIGN, NORID,},
{"", 0, 0},
{"private", VISSPEC, RID_PRIVATE,},
{"__typeof", TYPEOF, NORID},
{"", 0, 0},
{"__alignof", ALIGNOF, NORID},
{"__complex", TYPESPEC, RID_COMPLEX},
{"union", AGGR, RID_UNION,},
{"", 0, 0},
{"__extension__", EXTENSION, NORID},
{"", 0, 0},
{"return", RETURN_KEYWORD, NORID,},
{"and", ANDAND, NORID,},
{"__asm", ASM_KEYWORD, NORID},
{"__imag", IMAGPART, NORID},
{"virtual", SCSPEC, RID_VIRTUAL,},
{"protected", VISSPEC, RID_PROTECTED,},
{"throw", THROW, NORID,},
{"default", DEFAULT, NORID,},
{"using", USING, NORID,},
{"unsigned", TYPESPEC, RID_UNSIGNED,},
{"break", BREAK, NORID,},
{"", 0, 0},
{"signature", AGGR, RID_SIGNATURE /* Extension */,},
{"bool", TYPESPEC, RID_BOOL,},
{"", 0, 0},
{"typedef", SCSPEC, RID_TYPEDEF,},
{"__typeof", TYPEOF, NORID},
{"bitand", '&', NORID,},
{"break", BREAK, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"union", AGGR, RID_UNION,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"not_eq", EQCOMPARE, NORID,},
{"", 0, 0}, {"", 0, 0},
{"goto", GOTO, NORID,},
{"sigof", SIGOF, NORID /* Extension */,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0},
{"bitor", '|', NORID,},
{"auto", SCSPEC, RID_AUTO,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"double", TYPESPEC, RID_DOUBLE,},
{"signed", TYPESPEC, RID_SIGNED,},
{"while", WHILE, NORID,},
{"asm", ASM_KEYWORD, NORID,},
{"volatile", CV_QUALIFIER, RID_VOLATILE,},
{"and_eq", ASSIGN, NORID,},
{"", 0, 0},
{"operator", OPERATOR, NORID,}
{"mutable", SCSPEC, RID_MUTABLE,},
{"dynamic_cast", DYNAMIC_CAST, NORID,},
{"", 0, 0},
{"new", NEW, NORID,},
{"xor_eq", ASSIGN, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"enum", ENUM, NORID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"void", TYPESPEC, RID_VOID,},
{"", 0, 0}, {"", 0, 0}, {"", 0, 0},
{"bitand", '&', NORID,}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -17,8 +17,8 @@ struct resword { char *name; short token; short iclass;};
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 9
#define MIN_HASH_VALUE 2
#define MAX_HASH_VALUE 43
/* maximum key range = 42, duplicates = 0 */
#define MAX_HASH_VALUE 37
/* maximum key range = 36, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -34,32 +34,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 18, 29, 14, 6, 7,
10, 20, 44, 28, 44, 44, 28, 19, 22, 15,
0, 44, 9, 23, 0, 23, 26, 2, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
0, 0, 13, 44, 30, 44, 44, 44, 0, 25,
1, 0, 44, 44, 0, 44, 1, 44, 25, 44,
44, 0, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 14, 32, 16, 13, 9,
1, 32, 38, 9, 38, 38, 22, 26, 16, 3,
2, 38, 7, 23, 0, 19, 25, 23, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
5, 1, 5, 38, 3, 38, 38, 38, 8, 16,
0, 0, 38, 38, 3, 38, 7, 38, 8, 38,
38, 4, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
38, 38, 38, 38, 38, 38
};
return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
}
@@ -77,41 +77,40 @@ is_reserved_word (str, len)
{""}, {""},
{"To", TO, PASCAL_ISO},
{""},
{"Type", TYPE, PASCAL_ISO},
{"Then", THEN, PASCAL_ISO},
{"Packed", PACKED, PASCAL_ISO},
{"While", WHILE, PASCAL_ISO},
{"Do", DO, PASCAL_ISO},
{"Procedure", PROCEDURE, PASCAL_ISO},
{"End", END, PASCAL_ISO},
{"Else", ELSE, PASCAL_ISO},
{"Downto", DOWNTO, PASCAL_ISO},
{"For", FOR, PASCAL_ISO},
{"Type", TYPE, PASCAL_ISO},
{"File", FILE_, PASCAL_ISO},
{"Record", RECORD, PASCAL_ISO},
{"Repeat", REPEAT, PASCAL_ISO},
{"For", FOR, PASCAL_ISO},
{"Or", OR, PASCAL_ISO},
{"Case", CASE, PASCAL_ISO},
{"Function", FUNCTION, PASCAL_ISO},
{"Const", CONST, PASCAL_ISO},
{"And", AND, PASCAL_ISO},
{"Mod", MOD, PASCAL_ISO},
{"Array", ARRAY, PASCAL_ISO},
{"Goto", GOTO, PASCAL_ISO},
{"Nil", NIL, PASCAL_ISO},
{"Not", NOT, PASCAL_ISO},
{"Set", SET, PASCAL_ISO},
{"Until", UNTIL, PASCAL_ISO},
{"Var", VAR, PASCAL_ISO},
{"Of", OF, PASCAL_ISO},
{"In", IN, PASCAL_ISO},
{"Program",PROGRAM,PASCAL_ISO},
{"Label", LABEL, PASCAL_ISO},
{"Procedure", PROCEDURE, PASCAL_ISO},
{"Packed", PACKED, PASCAL_ISO},
{"Else", ELSE, PASCAL_ISO},
{"Do", DO, PASCAL_ISO},
{"If", IF, PASCAL_ISO},
{"End", END, PASCAL_ISO},
{"Record", RECORD, PASCAL_ISO},
{"Downto", DOWNTO, PASCAL_ISO},
{"Repeat", REPEAT, PASCAL_ISO},
{"Case", CASE, PASCAL_ISO},
{"And", AND, PASCAL_ISO},
{"Array", ARRAY, PASCAL_ISO},
{"Div", DIV, PASCAL_ISO},
{"Begin", BEGIN_, PASCAL_ISO},
{"Program",PROGRAM,PASCAL_ISO},
{"Not", NOT, PASCAL_ISO},
{"Nil", NIL, PASCAL_ISO},
{"Const", CONST, PASCAL_ISO},
{"While", WHILE, PASCAL_ISO},
{"With", WITH, PASCAL_ISO},
{""}, {""}, {""}, {""}, {""}, {""},
{"If", IF, PASCAL_ISO}
{"Var", VAR, PASCAL_ISO},
{"Until", UNTIL, PASCAL_ISO},
{"Set", SET, PASCAL_ISO},
{"Mod", MOD, PASCAL_ISO},
{"Label", LABEL, PASCAL_ISO},
{"Goto", GOTO, PASCAL_ISO},
{"Begin", BEGIN_, PASCAL_ISO}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -31,9 +31,9 @@ struct java_keyword { const char *name; int token; };
#define TOTAL_KEYWORDS 50
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 12
#define MIN_HASH_VALUE 6
#define MAX_HASH_VALUE 86
/* maximum key range = 81, duplicates = 0 */
#define MIN_HASH_VALUE 7
#define MAX_HASH_VALUE 76
/* maximum key range = 70, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -49,32 +49,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 18, 37, 38,
27, 1, 30, 3, 12, 8, 87, 2, 11, 87,
8, 1, 5, 87, 24, 1, 1, 30, 2, 36,
87, 1, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
87, 87, 87, 87, 87, 87
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 7, 30, 7,
12, 1, 14, 28, 41, 3, 77, 16, 11, 77,
16, 23, 1, 77, 15, 1, 1, 34, 30, 18,
77, 11, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77
};
register int hval = len;
@@ -102,70 +102,63 @@ java_keyword (str, len)
static struct java_keyword wordlist[] =
{
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"try", TRY_TK},
{"", 0},
{"else", ELSE_TK},
{"short", SHORT_TK},
{"goto", GOTO_TK},
{"extends", EXTENDS_TK},
{"", 0}, {"", 0},
{"int", INT_TK},
{"this", THIS_TK},
{"", 0},
{"native", NATIVE_TK},
{"", 0}, {"", 0},
{"interface", INTERFACE_TK},
{"extends", EXTENDS_TK},
{"import", IMPORT_TK},
{"private", PRIVATE_TK},
{"volatile", VOLATILE_TK},
{"", 0},
{"case", CASE_TK},
{"interface", INTERFACE_TK},
{"implements", IMPLEMENTS_TK},
{"", 0},
{"long", LONG_TK},
{"switch", SWITCH_TK},
{"package", PACKAGE_TK},
{"abstract", ABSTRACT_TK},
{"transient", TRANSIENT_TK},
{"do", DO_TK},
{"", 0},
{"throws", THROWS_TK},
{"", 0},
{"null", NULL_TK},
{"super", SUPER_TK},
{"true", TRUE_TK},
{"float", FLOAT_TK},
{"", 0},
{"return", RETURN_TK},
{"if", IF_TK},
{"void", VOID_TK},
{"protected", PROTECTED_TK},
{"byte", BYTE_TK},
{"case", CASE_TK},
{"break", BREAK_TK},
{"finally", FINALLY_TK},
{"false", FALSE_TK},
{"synchronized", SYNCHRONIZED_TK},
{"instanceof", INSTANCEOF_TK},
{"while", WHILE_TK},
{"package", PACKAGE_TK},
{"const", CONST_TK},
{"boolean", BOOLEAN_TK},
{"final", FINAL_TK},
{"continue", CONTINUE_TK},
{"catch", CATCH_TK},
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"class", CLASS_TK},
{"static", STATIC_TK},
{"double", DOUBLE_TK},
{"default", DEFAULT_TK},
{"throw", THROW_TK},
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"", 0}, {"", 0},
{"for", FOR_TK},
{"super", SUPER_TK},
{"throws", THROWS_TK},
{"native", NATIVE_TK},
{"", 0},
{"new", NEW_TK},
{"try", TRY_TK},
{"while", WHILE_TK},
{"instanceof", INSTANCEOF_TK},
{"const", CONST_TK},
{"short", SHORT_TK},
{"false", FALSE_TK},
{"continue", CONTINUE_TK},
{"char", CHAR_TK},
{"default", DEFAULT_TK},
{"", 0},
{"public", PUBLIC_TK}
{"byte", BYTE_TK},
{"do", DO_TK},
{"return", RETURN_TK},
{"throw", THROW_TK},
{"true", TRUE_TK},
{"synchronized", SYNCHRONIZED_TK},
{"null", NULL_TK},
{"float", FLOAT_TK},
{"public", PUBLIC_TK},
{"protected", PROTECTED_TK},
{"final", FINAL_TK},
{"for", FOR_TK},
{"finally", FINALLY_TK},
{"void", VOID_TK},
{"volatile", VOLATILE_TK},
{"switch", SWITCH_TK},
{"break", BREAK_TK},
{"double", DOUBLE_TK},
{"catch", CATCH_TK},
{"new", NEW_TK},
{"goto", GOTO_TK},
{"", 0}, {"", 0},
{"long", LONG_TK},
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"", 0}, {"", 0}, {"", 0}, {"", 0},
{"boolean", BOOLEAN_TK}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -5,8 +5,8 @@
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 14
#define MIN_HASH_VALUE 1
#define MAX_HASH_VALUE 256
/* maximum key range = 256, duplicates = 0 */
#define MAX_HASH_VALUE 155
/* maximum key range = 155, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -20,34 +20,34 @@ hash (str, len)
register const char *str;
register unsigned int len;
{
static unsigned short asso_values[] =
static unsigned char asso_values[] =
{
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 25, 30, 35, 21, 0,
30, 15, 30, 45, 257, 257, 0, 5, 45, 0,
10, 0, 1, 20, 25, 15, 30, 40, 15, 5,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257, 257, 257, 257, 257,
257, 257, 257, 257, 257, 257
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 1, 10, 30, 25, 0,
10, 55, 6, 0, 156, 156, 15, 15, 35, 15,
30, 0, 5, 1, 0, 45, 21, 45, 6, 1,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156, 156, 156, 156, 156,
156, 156, 156, 156, 156, 156
};
register int hval = 0;
@@ -85,108 +85,90 @@ in_word_set (str, len)
{
static unsigned char lengthtable[] =
{
0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 0, 2, 3, 0,
0, 0, 2, 3, 0, 0, 0, 2, 4, 0, 0, 0, 4, 6,
0, 0, 0, 3, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
3, 5, 6, 0, 0, 6, 0, 0, 0, 0, 3, 0, 0, 0,
3, 0, 0, 0, 0, 2, 0, 0, 0, 0, 4, 0, 0, 9,
0, 4, 6, 6, 0, 0, 2, 3, 0, 0, 0, 5, 3, 0,
0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,
7, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 0,
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 2, 2, 0, 5,
0, 2, 4, 0, 0, 0, 2, 0, 0, 0, 0, 2, 5, 3,
0, 0, 3, 4, 4, 0, 0, 2, 6, 0, 0, 0, 2, 4,
0, 0, 0, 4, 3, 0, 0, 0, 3, 4, 0, 0, 0, 3,
6, 0, 0, 0, 3, 3, 0, 0, 0, 6, 5, 0, 0, 0,
10, 9, 0, 0, 0, 4, 0, 0, 0, 0, 6, 5, 0, 0,
0, 7, 0, 0, 0, 0, 6, 0, 0, 0, 0, 5, 0, 0,
0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0,
0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 10
0, 9
};
static const char * wordlist[] =
{
"",
"OR",
"", "", "", "", "", "", "", "",
"LOOP",
"", "", "", "", "", "", "", "", "",
"ELSE",
"DO",
"", "", "",
"TO",
"MOD",
"", "", "",
"OF",
"FOR",
"", "", "",
"BY",
"FROM",
"", "", "",
"TYPE",
"MODULE",
"", "", "",
"SET",
"", "", "", "", "",
"EXPORT",
"", "", "", "",
"VAR",
"ARRAY",
"RECORD",
"", "",
"REPEAT",
"", "", "", "",
"END",
"EXIT",
"", "", "",
"NOT",
"", "", "", "",
"IF",
"BY",
"",
"ARRAY",
"",
"TO",
"ELSE",
"", "", "",
"OR",
"", "", "", "",
"OF",
"ELSIF",
"VAR",
"", "",
"FOR",
"TYPE",
"CASE",
"", "",
"PROCEDURE",
"",
"EXIT",
"IMPORT",
"RETURN",
"", "",
"IN",
"AND",
"REPEAT",
"", "", "",
"ELSIF",
"DO",
"THEN",
"", "", "",
"FROM",
"DIV",
"", "", "",
"THEN",
"", "", "", "", "", "", "", "", "",
"IMPLEMENTATION",
"", "", "", "",
"WHILE",
"", "", "", "", "", "", "", "", "",
"CONST",
"POINTER",
"NOT",
"WITH",
"", "", "",
"MOD",
"EXPORT",
"", "", "",
"END",
"AND",
"", "", "",
"IMPORT",
"WHILE",
"", "", "",
"DEFINITION",
"QUALIFIED",
"", "", "",
"LOOP",
"", "", "", "",
"RECORD",
"CONST",
"", "", "",
"POINTER",
"", "", "", "",
"RETURN",
"", "", "", "",
"UNTIL",
"", "", "", "",
"BEGIN",
"", "", "", "", "", "", "", "", "",
"IMPLEMENTATION",
"", "", "", "",
"WITH",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"",
"QUALIFIED",
"MODULE",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "",
"DEFINITION"
"", "", "",
"PROCEDURE"
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -7,8 +7,8 @@ struct resword { char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 59
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 15
#define MIN_HASH_VALUE 11
#define MAX_HASH_VALUE 98
#define MIN_HASH_VALUE 8
#define MAX_HASH_VALUE 95
/* maximum key range = 88, duplicates = 0 */
#ifdef __GNUC__
@@ -25,32 +25,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 16, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 1, 99, 2, 1, 32,
1, 5, 19, 36, 25, 13, 99, 1, 8, 37,
2, 41, 34, 99, 27, 12, 1, 42, 21, 28,
99, 99, 12, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 19, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 2, 96, 2, 1, 10,
26, 1, 23, 27, 27, 24, 96, 1, 25, 36,
10, 34, 23, 96, 10, 6, 8, 11, 41, 2,
96, 96, 23, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96
};
register int hval = len;
@@ -77,77 +77,76 @@ is_reserved_word (str, len)
{
static struct resword wordlist[] =
{
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""},
{"__asm__", ASM, NORID},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{"break", BREAK, NORID},
{"__typeof__", TYPEOF, NORID},
{"extern", SCSPEC, RID_EXTERN},
{"__alignof__", ALIGNOF, NORID},
{""},
{"__attribute__", ATTRIBUTE, NORID},
{"int", TYPESPEC, RID_INT},
{"__attribute", ATTRIBUTE, NORID},
{"__extension__", EXTENSION, NORID},
{""},
{"__signed", TYPESPEC, RID_SIGNED},
{"@end", END, NORID},
{"__signed__", TYPESPEC, RID_SIGNED},
{"__inline__", SCSPEC, RID_INLINE},
{""}, {""}, {""},
{"else", ELSE, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"default", DEFAULT, NORID},
{"__typeof", TYPEOF, NORID},
{"@encode", ENCODE, NORID},
{"__alignof", ALIGNOF, NORID},
{"inline", SCSPEC, RID_INLINE},
{"@interface", INTERFACE, NORID},
{"if", IF, NORID},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"return", RETURN, NORID},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"@defs", DEFS, NORID},
{"void", TYPESPEC, RID_VOID},
{"const", TYPE_QUAL, RID_CONST},
{"__const", TYPE_QUAL, RID_CONST},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{"__const__", TYPE_QUAL, RID_CONST},
{"do", DO, NORID},
{"__asm", ASM, NORID},
{"struct", STRUCT, NORID},
{"continue", CONTINUE, NORID},
{"auto", SCSPEC, RID_AUTO},
{"sizeof", SIZEOF, NORID},
{"long", TYPESPEC, RID_LONG},
{"while", WHILE, NORID},
{"static", SCSPEC, RID_STATIC},
{"__asm__", ASM, NORID},
{""}, {""},
{"__attribute", ATTRIBUTE, NORID},
{"__alignof__", ALIGNOF, NORID},
{"__extension__", EXTENSION, NORID},
{"__attribute__", ATTRIBUTE, NORID},
{"__signed__", TYPESPEC, RID_SIGNED},
{"case", CASE, NORID},
{"double", TYPESPEC, RID_DOUBLE},
{"signed", TYPESPEC, RID_SIGNED},
{"switch", SWITCH, NORID},
{"@selector", SELECTOR, NORID},
{"__typeof__", TYPEOF, NORID},
{"__const__", TYPE_QUAL, RID_CONST},
{"static", SCSPEC, RID_STATIC},
{"extern", SCSPEC, RID_EXTERN},
{"char", TYPESPEC, RID_CHAR},
{"__const", TYPE_QUAL, RID_CONST},
{""},
{"short", TYPESPEC, RID_SHORT},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"continue", CONTINUE, NORID},
{"struct", STRUCT, NORID},
{"@defs", DEFS, NORID},
{"while", WHILE, NORID},
{"const", TYPE_QUAL, RID_CONST},
{"return", RETURN, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"__alignof", ALIGNOF, NORID},
{"@encode", ENCODE, NORID},
{"__inline__", SCSPEC, RID_INLINE},
{"@selector", SELECTOR, NORID},
{"@interface", INTERFACE, NORID},
{"__typeof", TYPEOF, NORID},
{"__signed", TYPESPEC, RID_SIGNED},
{"int", TYPESPEC, RID_INT},
{"double", TYPESPEC, RID_DOUBLE},
{"__asm", ASM, NORID},
{"for", FOR, NORID},
{"@public", PUBLIC, NORID},
{"auto", SCSPEC, RID_AUTO},
{"if", IF, NORID},
{"union", UNION, NORID},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{""},
{"char", TYPESPEC, RID_CHAR},
{"float", TYPESPEC, RID_FLOAT},
{"enum", ENUM, NORID},
{"short", TYPESPEC, RID_SHORT},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"register", SCSPEC, RID_REGISTER},
{"inline", SCSPEC, RID_INLINE},
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
{"sizeof", SIZEOF, NORID},
{"@end", END, NORID},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"do", DO, NORID},
{"switch", SWITCH, NORID},
{"default", DEFAULT, NORID},
{"signed", TYPESPEC, RID_SIGNED},
{"long", TYPESPEC, RID_LONG},
{""}, {""}, {""},
{"@implementation", IMPLEMENTATION, NORID},
{""}, {""}, {""}, {""}, {""},
{"for", FOR, NORID},
{""}, {""},
{"asm", ASM, NORID},
{"float", TYPESPEC, RID_FLOAT},
{""}, {""},
{"goto", GOTO, NORID},
{""},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{""},
{"asm", ASM, NORID},
{""}, {""},
{"@implementation", IMPLEMENTATION, NORID},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{""}, {""}, {""}, {""}, {""},
{"enum", ENUM, NORID},
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
{"@public", PUBLIC, NORID},
{"register", SCSPEC, RID_REGISTER}
{"void", TYPESPEC, RID_VOID}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -7,9 +7,9 @@ struct resword { const char *name; short token; enum rid rid; };
#define TOTAL_KEYWORDS 83
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 20
#define MIN_HASH_VALUE 6
#define MAX_HASH_VALUE 170
/* maximum key range = 165, duplicates = 8 */
#define MIN_HASH_VALUE 4
#define MAX_HASH_VALUE 127
/* maximum key range = 124, duplicates = 8 */
#ifdef __GNUC__
__inline
@@ -25,32 +25,32 @@ hash (str, len)
{
static unsigned char asso_values[] =
{
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 30, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 0, 171, 10, 80, 60,
15, 20, 85, 45, 0, 30, 171, 0, 40, 35,
45, 20, 171, 171, 60, 0, 10, 15, 35, 0,
5, 60, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
171, 171, 171, 171, 171, 171
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 0, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 5, 128, 0, 15, 50,
55, 0, 15, 35, 65, 60, 128, 40, 0, 60,
65, 10, 128, 128, 15, 20, 30, 20, 40, 0,
20, 15, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128
};
return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
}
@@ -65,7 +65,17 @@ in_word_set (str, len)
{
static struct resword wordlist[] =
{
{"switch", SWITCH, NORID},
{"else", ELSE, NORID},
{"while", WHILE, NORID},
{"@encode", ENCODE, NORID},
{"@private", PRIVATE, NORID},
{"@protocol", PROTOCOL, NORID},
{"@interface", INTERFACE, NORID},
{"__real", REALPART, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"auto", SCSPEC, RID_AUTO},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"__attribute", ATTRIBUTE, NORID},
{"__asm__", ASM_KEYWORD, NORID},
{"__imag__", IMAGPART, NORID},
{"__real__", REALPART, NORID},
@@ -81,99 +91,83 @@ in_word_set (str, len)
{"__restrict__", TYPE_QUAL, RID_RESTRICT},
{"__attribute__", ATTRIBUTE, NORID},
{"__extension__", EXTENSION, NORID},
{"__complex", TYPESPEC, RID_COMPLEX},
{"short", TYPESPEC, RID_SHORT},
{"struct", STRUCT, NORID},
{"__const", TYPE_QUAL, RID_CONST},
{"__restrict", TYPE_QUAL, RID_RESTRICT},
{"signed", TYPESPEC, RID_SIGNED},
{"__signed", TYPESPEC, RID_SIGNED},
{"while", WHILE, NORID},
{"__inline", SCSPEC, RID_INLINE},
{"__volatile", TYPE_QUAL, RID_VOLATILE},
{"__attribute", ATTRIBUTE, NORID},
{"default", DEFAULT, NORID},
{"out", TYPE_QUAL, RID_OUT},
{"auto", SCSPEC, RID_AUTO},
{"@selector", SELECTOR, NORID},
{"@defs", DEFS, NORID},
{"@class", CLASS, NORID},
{"do", DO, NORID},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{"__asm", ASM_KEYWORD, NORID},
{"double", TYPESPEC, RID_DOUBLE},
{"int", TYPESPEC, RID_INT},
{"else", ELSE, NORID},
{"inout", TYPE_QUAL, RID_INOUT},
{"__real", REALPART, NORID},
{"id", OBJECTNAME, RID_ID},
{"asm", ASM_KEYWORD, NORID},
{"@end", END, NORID},
{"@compatibility_alias", ALIAS, NORID},
{"__imag", IMAGPART, NORID},
{"void", TYPESPEC, RID_VOID},
{"@protected", PROTECTED, NORID},
{"inline", SCSPEC, RID_INLINE},
{"@encode", ENCODE, NORID},
{"@private", PRIVATE, NORID},
{"enum", ENUM, NORID},
{"@interface", INTERFACE, NORID},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{"union", UNION, NORID},
{"static", SCSPEC, RID_STATIC},
{"goto", GOTO, NORID},
{"__iterator", SCSPEC, RID_ITERATOR},
{"extern", SCSPEC, RID_EXTERN},
{"const", TYPE_QUAL, RID_CONST},
{"in", TYPE_QUAL, RID_IN},
{"restrict", TYPE_QUAL, RID_RESTRICT},
{"@protocol", PROTOCOL, NORID},
{"case", CASE, NORID},
{"break", BREAK, NORID},
{"oneway", TYPE_QUAL, RID_ONEWAY},
{"continue", CONTINUE, NORID},
{"long", TYPESPEC, RID_LONG},
{"@implementation", IMPLEMENTATION, NORID},
{"sizeof", SIZEOF, NORID},
{"__typeof", TYPEOF, NORID},
{"__alignof", ALIGNOF, NORID},
{"@public", PUBLIC, NORID},
{"@selector", SELECTOR, NORID},
{"__iterator", SCSPEC, RID_ITERATOR},
{"oneway", TYPE_QUAL, RID_ONEWAY},
{"for", FOR, NORID},
{"__complex", TYPESPEC, RID_COMPLEX},
{"byref", TYPE_QUAL, RID_BYREF},
{"bycopy", TYPE_QUAL, RID_BYCOPY},
{"register", SCSPEC, RID_REGISTER},
{"long", TYPESPEC, RID_LONG},
{"@compatibility_alias", ALIAS, NORID},
{"sizeof", SIZEOF, NORID},
{"__const", TYPE_QUAL, RID_CONST},
{"out", TYPE_QUAL, RID_OUT},
{"__restrict", TYPE_QUAL, RID_RESTRICT},
{"__imag", IMAGPART, NORID},
{"volatile", TYPE_QUAL, RID_VOLATILE},
{"goto", GOTO, NORID},
{"float", TYPESPEC, RID_FLOAT},
{"typeof", TYPEOF, NORID},
{"typedef", SCSPEC, RID_TYPEDEF},
{"return", RETURN, NORID},
{"if", IF, NORID},
{"restrict", TYPE_QUAL, RID_RESTRICT},
{"case", CASE, NORID},
{"short", TYPESPEC, RID_SHORT},
{"struct", STRUCT, NORID},
{"@public", PUBLIC, NORID},
{"continue", CONTINUE, NORID},
{"@end", END, NORID},
{"break", BREAK, NORID},
{"double", TYPESPEC, RID_DOUBLE},
{"asm", ASM_KEYWORD, NORID},
{"enum", ENUM, NORID},
{"@protected", PROTECTED, NORID},
{"inline", SCSPEC, RID_INLINE},
{"do", DO, NORID},
{"__signed", TYPESPEC, RID_SIGNED},
{"char", TYPESPEC, RID_CHAR},
{"register", SCSPEC, RID_REGISTER},
{"bycopy", TYPE_QUAL, RID_BYCOPY},
{"for", FOR, NORID},
{"byref", TYPE_QUAL, RID_BYREF}
{"__asm", ASM_KEYWORD, NORID},
{"extern", SCSPEC, RID_EXTERN},
{"static", SCSPEC, RID_STATIC},
{"if", IF, NORID},
{"@implementation", IMPLEMENTATION, NORID},
{"signed", TYPESPEC, RID_SIGNED},
{"unsigned", TYPESPEC, RID_UNSIGNED},
{"const", TYPE_QUAL, RID_CONST},
{"return", RETURN, NORID},
{"union", UNION, NORID},
{"switch", SWITCH, NORID},
{"default", DEFAULT, NORID},
{"int", TYPESPEC, RID_INT},
{"inout", TYPE_QUAL, RID_INOUT},
{"void", TYPESPEC, RID_VOID},
{"id", OBJECTNAME, RID_ID},
{"in", TYPE_QUAL, RID_IN}
};
static short lookup[] =
{
-1, -1, -1, -1, -1, -1, 0, 1,
-156, -151, -145, -136, -110, -102, 16, 17,
18, 19, -69, -2, 20, 21, -1, 22,
-1, 23, -72, -3, 24, -1, 25, 26,
27, 28, 29, 30, 31, 32, 33, -1,
34, 35, -1, 36, 37, 38, 39, 40,
41, 42, 43, 44, -74, -2, 45, 46,
47, 48, 49, 50, 51, -77, -3, 52,
-1, 53, 54, -79, -2, 55, 56, 57,
-81, -2, -1, 58, -1, 59, 60, 61,
-1, -1, -1, -1, 62, 63, 64, -1,
65, 66, 67, 68, -1, 69, 70, -1,
-1, 71, -1, 72, 73, 74, 75, -1,
-1, -1, -1, -1, -1, -1, -1, 76,
-1, -1, -1, -1, -1, 77, -1, -1,
-1, -1, -1, -1, 78, -1, -1, -1,
79, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 0, 1, -1, 2,
3, 4, 5, 6, -1, 7, 8, 9,
10, 11, -184, -180, -171, -162, -158, -156,
26, 27, 28, -1, 29, 30, 31, 32,
-1, 33, 34, 35, 36, -1, 37, 38,
39, 40, 41, 42, -1, 43, 44, -1,
45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, -1, 59,
60, 61, 62, 63, 64, 65, 66, 67,
-59, -2, -62, -3, 68, 69, -64, -2,
70, 71, -1, 72, -1, 73, 74, -67,
-3, -1, 75, 76, 77, 78, -1, 79,
-69, -2, -1, 80, -71, -2, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 80, -1, 81, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 82
-1, -1, -1, -1, -1, 81, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 82
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)

View File

@@ -87,12 +87,6 @@ Algorithm employed by gperf:
$,1,2,4,6-10.
-D, --duplicates Handle keywords that hash to duplicate values. This
is useful for certain highly redundant keyword sets.
-f, --fast=ITERATIONS Generate the gen-perf.hash function "fast". This
decreases gperf's running time at the cost of
minimizing generated table size. The numeric
argument represents the number of times to iterate
when resolving a collision. '0' means "iterate by
the number of keywords".
-m, --multiple-iterations=ITERATIONS
Perform multiple choices of the -i and -j values,
and choose the best results. This increases the
@@ -106,9 +100,6 @@ Algorithm employed by gperf:
be an odd number, default is 5.
-n, --no-strlen Do not include the length of the keyword when
computing the hash function.
-o, --occurrence-sort Reorders input keys by frequency of occurrence of
the key sets. This should decrease the search time
dramatically.
-r, --random Utilizes randomness to initialize the associated
values table.
-s, --size-multiple=N Affects the size of the generated hash table. The