Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / apps / gperf / tests / test-5.exp
blob56143fbd915c8ba387c88221958dd8cca41aa4c3
1 /* C code produced by gperf version 2.8 (ACE version) */
2 /* Command-line: ../src/gperf -g -o -j1 -t -p -N is_reserved_word */
3 /* ISO Pascal 7185 reserved words.
5 * For GNU Pascal compiler (GPC) by jtv@hut.fi
7 * run this through the Doug Schmidt's gperf program
8 * with command
9 * gperf -g -o -j1 -t -p -N is_reserved_word
12 #include <string.h>
13 struct resword { const char *name; short token; short iclass;};
15 #define TOTAL_KEYWORDS 35
16 #define MIN_WORD_LENGTH 2
17 #define MAX_WORD_LENGTH 9
18 #define MIN_HASH_VALUE 2
19 #define MAX_HASH_VALUE 43
20 #define HASH_VALUE_RANGE 42
21 #define DUPLICATES 0
22 #define WORDLIST_SIZE 37
24 inline
25 static unsigned int
26 hash (str, len)
27 char *str;
28 unsigned int len;
30 static unsigned char asso_values[] =
32 #if defined (ACE_MVS)
33 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
34 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
35 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
36 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
37 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
38 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
39 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
40 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
41 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
42 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
43 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
45 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
46 44, 44, 0, 0, 13, 44, 30, 44, 44, 44,
47 44, 44, 44, 44, 44, 44, 44, 0, 25, 1,
48 0, 44, 44, 0, 44, 44, 44, 44, 44, 44,
49 44, 44, 44, 1, 44, 25, 44, 44, 0, 44,
50 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
51 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
52 44, 44, 44, 18, 29, 14, 6, 7, 10, 20,
53 44, 28, 44, 44, 44, 44, 44, 44, 44, 44,
54 44, 28, 19, 22, 15, 0, 44, 9, 44, 44,
55 44, 44, 44, 44, 44, 44, 23, 0, 23, 26,
56 2, 44, 44, 44, 44, 44, 44, 44, 44, 44,
57 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
58 44, 44, 44, 44, 44, 44,
59 #else
60 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
61 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
62 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
63 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
64 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
65 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
66 44, 44, 44, 44, 44, 18, 29, 14, 6, 7,
67 10, 20, 44, 28, 44, 44, 28, 19, 22, 15,
68 0, 44, 9, 23, 0, 23, 26, 2, 44, 44,
69 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
70 0, 0, 13, 44, 30, 44, 44, 44, 0, 25,
71 1, 0, 44, 44, 0, 44, 1, 44, 25, 44,
72 44, 0, 44, 44, 44, 44, 44, 44,
73 #endif /* ACE_MVS */
75 return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]];
78 inline
79 struct resword *
80 is_reserved_word (str, len)
81 char *str;
82 unsigned int len;
84 static struct resword wordlist[] =
86 {"",},{"",},
87 {"To", TO, PASCAL_ISO},
88 {"",},
89 {"Type", TYPE, PASCAL_ISO},
90 {"Then", THEN, PASCAL_ISO},
91 {"Packed", PACKED, PASCAL_ISO},
92 {"While", WHILE, PASCAL_ISO},
93 {"Do", DO, PASCAL_ISO},
94 {"Procedure", PROCEDURE, PASCAL_ISO},
95 {"End", END, PASCAL_ISO},
96 {"Else", ELSE, PASCAL_ISO},
97 {"Downto", DOWNTO, PASCAL_ISO},
98 {"For", FOR, PASCAL_ISO},
99 {"File", FILE_, PASCAL_ISO},
100 {"Record", RECORD, PASCAL_ISO},
101 {"Repeat", REPEAT, PASCAL_ISO},
102 {"Or", OR, PASCAL_ISO},
103 {"Case", CASE, PASCAL_ISO},
104 {"Function", FUNCTION, PASCAL_ISO},
105 {"Const", CONST, PASCAL_ISO},
106 {"And", AND, PASCAL_ISO},
107 {"Mod", MOD, PASCAL_ISO},
108 {"Array", ARRAY, PASCAL_ISO},
109 {"Goto", GOTO, PASCAL_ISO},
110 {"Nil", NIL, PASCAL_ISO},
111 {"Not", NOT, PASCAL_ISO},
112 {"Set", SET, PASCAL_ISO},
113 {"Until", UNTIL, PASCAL_ISO},
114 {"Var", VAR, PASCAL_ISO},
115 {"Of", OF, PASCAL_ISO},
116 {"In", IN, PASCAL_ISO},
117 {"Program", PROGRAM,PASCAL_ISO},
118 {"Label", LABEL, PASCAL_ISO},
119 {"Div", DIV, PASCAL_ISO},
120 {"Begin", BEGIN_, PASCAL_ISO},
121 {"With", WITH, PASCAL_ISO},
122 {"",},{"",},{"",},{"",},{"",},{"",},
123 {"If", IF, PASCAL_ISO},
126 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
128 unsigned int key = hash (str, len);
130 if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
132 char *s = wordlist[key].name;
134 if (*str == *s && !strcmp (str + 1, s + 1))
135 return &wordlist[key];
138 return 0;