summaryrefslogtreecommitdiff
path: root/apps/gperf/tests/test-4.exp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gperf/tests/test-4.exp')
-rw-r--r--apps/gperf/tests/test-4.exp138
1 files changed, 0 insertions, 138 deletions
diff --git a/apps/gperf/tests/test-4.exp b/apps/gperf/tests/test-4.exp
deleted file mode 100644
index 5238bf94d98..00000000000
--- a/apps/gperf/tests/test-4.exp
+++ /dev/null
@@ -1,138 +0,0 @@
-/* C code produced by gperf version 2.5 (GNU C++ version) */
-/* Command-line: ../src/gperf -D -p -t */
-/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
-struct resword { char *name; short token; enum rid rid; };
-
-#define TOTAL_KEYWORDS 51
-#define MIN_WORD_LENGTH 2
-#define MAX_WORD_LENGTH 13
-#define MIN_HASH_VALUE 4
-#define MAX_HASH_VALUE 82
-/* maximum key range = 79, duplicates = 2 */
-
-static unsigned int
-hash (str, len)
- register char *str;
- register int unsigned len;
-{
- static unsigned char asso_values[] =
- {
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
- 83, 83, 83, 83, 83, 0, 83, 40, 20, 50,
- 25, 10, 30, 0, 0, 50, 83, 0, 15, 0,
- 35, 0, 83, 83, 20, 0, 10, 40, 5, 15,
- 83, 83, 83, 83, 83, 83, 83, 83,
- };
- return len + asso_values[str[len - 1]] + asso_values[str[0]];
-}
-
-struct resword *
-in_word_set (str, len)
- register char *str;
- register unsigned int len;
-{
- static struct resword wordlist[] =
- {
- {"",}, {"",}, {"",}, {"",},
- {"goto", GOTO, NORID},
- {"__asm", ASM, NORID},
- {"switch", SWITCH, NORID},
- {"__asm__", ASM, NORID},
- {"__const__", TYPE_QUAL, RID_CONST},
- {"__inline__", SCSPEC, RID_INLINE},
- {"__typeof__", TYPEOF, NORID},
- {"__signed__", TYPESPEC, RID_SIGNED},
- {"__alignof__", ALIGNOF, NORID},
- {"__volatile__", TYPE_QUAL, RID_VOLATILE},
- {"__attribute__", ATTRIBUTE, NORID},
- {"enum", ENUM, NORID},
- {"short", TYPESPEC, RID_SHORT},
- {"struct", STRUCT, NORID},
- {"__const", TYPE_QUAL, RID_CONST},
- {"__inline", SCSPEC, RID_INLINE},
- {"long", TYPESPEC, RID_LONG},
- {"__volatile", TYPE_QUAL, RID_VOLATILE},
- {"__attribute", ATTRIBUTE, NORID},
- {"volatile", TYPE_QUAL, RID_VOLATILE},
- {"else", ELSE, NORID},
- {"break", BREAK, NORID},
- {"do", DO, NORID},
- {"while", WHILE, NORID},
- {"signed", TYPESPEC, RID_SIGNED},
- {"__signed", TYPESPEC, RID_SIGNED},
- {"void", TYPESPEC, RID_VOID},
- {"sizeof", SIZEOF, NORID},
- {"__typeof", TYPEOF, NORID},
- {"__alignof", ALIGNOF, NORID},
- {"double", TYPESPEC, RID_DOUBLE},
- {"default", DEFAULT, NORID},
- {"asm", ASM, NORID},
- {"auto", SCSPEC, RID_AUTO},
- {"float", TYPESPEC, RID_FLOAT},
- {"typeof", TYPEOF, NORID},
- {"typedef", SCSPEC, RID_TYPEDEF},
- {"register", SCSPEC, RID_REGISTER},
- {"extern", SCSPEC, RID_EXTERN},
- {"for", FOR, NORID},
- {"static", SCSPEC, RID_STATIC},
- {"return", RETURN, NORID},
- {"int", TYPESPEC, RID_INT},
- {"case", CASE, NORID},
- {"const", TYPE_QUAL, RID_CONST},
- {"inline", SCSPEC, RID_INLINE},
- {"continue", CONTINUE, NORID},
- {"unsigned", TYPESPEC, RID_UNSIGNED},
- {"char", TYPESPEC, RID_CHAR},
- {"union", UNION, NORID},
- {"if", IF, NORID},
- };
-
- static char lookup[] =
- {
- -1, -1, -1, -1, 4, 5, 6, 7, -1, 8, 100, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, -1, 23, 24, 25, -1, 26,
- -9, -3, 27, 28, -1, 29, 30, -1, 31, -1, 32, 33, -1, 34,
- 35, 36, 37, 38, 39, 40, 41, -1, -1, 42, -1, 43, -1, -1,
- 44, -1, -1, -1, -1, 45, -1, 46, 47, 48, 49, -1, 50, -1,
- -1, -1, -1, 51, 52, -1, -1, -1, -1, -1, 53, -1, 54,
- };
-
- if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
- {
- register int key = hash (str, len);
-
- if (key <= MAX_HASH_VALUE && key >= 0)
- {
- register int index = lookup[key];
-
- if (index >= 0 && index < MAX_HASH_VALUE)
- {
- register char *s = wordlist[index].name;
-
- if (*s == *str && !strcmp (str + 1, s + 1))
- return &wordlist[index];
- }
- else if (index < 0 && index >= -MAX_HASH_VALUE)
- return 0;
- else
- {
- register int offset = key + index + (index > 0 ? -MAX_HASH_VALUE : MAX_HASH_VALUE);
- register struct resword *base = &wordlist[-lookup[offset]];
- register struct resword *ptr = base + -lookup[offset + 1];
-
- while (--ptr >= base)
- if (*str == *ptr->name && !strcmp (str + 1, ptr->name + 1))
- return ptr;
- }
- }
- }
- return 0;
-}