diff options
author | Bruno Haible <bruno@clisp.org> | 2003-03-18 10:22:37 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2003-03-18 10:22:37 +0000 |
commit | 6d268d095b4cb2bab821e82b785a4b74810b01a6 (patch) | |
tree | 5b3f7f60909fc6a7d5f4697c9d4ae58f947f0a7a /tests/c-parse.exp | |
parent | 40f37680ac107a61bbe14efe6213f70c91c6b461 (diff) | |
download | gperf-6d268d095b4cb2bab821e82b785a4b74810b01a6.tar.gz |
Completely new asso_values search algorithm.
Diffstat (limited to 'tests/c-parse.exp')
-rw-r--r-- | tests/c-parse.exp | 204 |
1 files changed, 97 insertions, 107 deletions
diff --git a/tests/c-parse.exp b/tests/c-parse.exp index 9d229ba..405be7b 100644 --- a/tests/c-parse.exp +++ b/tests/c-parse.exp @@ -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}, - {"__signed__", TYPESPEC, RID_SIGNED}, - {"__extension__", EXTENSION, NORID}, - {"inout", TYPE_QUAL, RID_INOUT}, + {"__restrict__", TYPE_QUAL, RID_RESTRICT}, + {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"__imag__", IMAGPART, NORID}, - {"else", ELSE, NORID}, + {"__asm__", ASM_KEYWORD, NORID}, {"__inline__", SCSPEC, RID_INLINE}, - {"byref", TYPE_QUAL, RID_BYREF}, + {"__iterator", SCSPEC, RID_ITERATOR}, {"__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}, + {"__alignof__", ALIGNOF, NORID}, {"__const", TYPE_QUAL, RID_CONST}, - {"oneway", TYPE_QUAL, RID_ONEWAY}, + {"__attribute__", ATTRIBUTE, NORID}, {"__const__", TYPE_QUAL, RID_CONST}, - {"__complex", TYPESPEC, RID_COMPLEX}, + {"struct", STRUCT, NORID}, {"__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}, + {"restrict", TYPE_QUAL, RID_RESTRICT}, + {"__signed__", TYPESPEC, RID_SIGNED}, + {"__extension__", EXTENSION, 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}, + {"__signed", TYPESPEC, RID_SIGNED}, + {"extern", SCSPEC, RID_EXTERN}, + {"@protected", PROTECTED, NORID}, + {"__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}, - {"__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}, + {"@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}, - {"__alignof__", ALIGNOF, NORID}, - {"@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}, + {"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}, + {"__volatile", TYPE_QUAL, RID_VOLATILE}, + {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, + {"float", TYPESPEC, RID_FLOAT}, + {"", 0, 0}, + {"@compatibility_alias", ALIAS, NORID}, + {"void", TYPESPEC, RID_VOID}, {"", 0, 0}, {"", 0, 0}, - {"@implementation", IMPLEMENTATION, NORID}, + {"long", TYPESPEC, RID_LONG}, + {"enum", ENUM, NORID}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, - {"union", UNION, NORID}, + {"byref", TYPE_QUAL, RID_BYREF}, + {"", 0, 0}, + {"@implementation", IMPLEMENTATION, 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}, - {"static", SCSPEC, RID_STATIC}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, - {"long", TYPESPEC, RID_LONG}, {"", 0, 0}, {"", 0, 0}, {"", 0, 0}, - {"char", TYPESPEC, RID_CHAR} + {"volatile", TYPE_QUAL, RID_VOLATILE} }; #ifdef __GNUC__ |