1 /* C code produced by gperf version 2.5 (GNU C++ version) */
2 /* Command-line: gperf -acCgopt -k1,2,5, keyword.gperf */
3 /* `strncmp' is used for comparison. */
6 /* This file defines `enum token'. */
8 struct locale_keyword
{ char *name
; enum token token_id
; };
10 #define TOTAL_KEYWORDS 68
11 #define MIN_WORD_LENGTH 3
12 #define MAX_WORD_LENGTH 17
13 #define MIN_HASH_VALUE 4
14 #define MAX_HASH_VALUE 140
15 /* maximum key range = 137, duplicates = 0 */
21 hash (register const char *str
, register int len
)
23 static const unsigned char asso_values
[] =
25 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
26 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
27 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
28 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
29 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
30 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
31 141, 141, 141, 141, 141, 141, 141, 0, 141, 65,
32 5, 0, 141, 30, 141, 141, 0, 141, 0, 95,
33 141, 141, 0, 141, 45, 10, 141, 141, 141, 141,
34 141, 141, 141, 141, 141, 5, 141, 10, 85, 0,
35 20, 0, 40, 35, 30, 10, 141, 0, 30, 15,
36 15, 0, 0, 141, 55, 0, 0, 80, 141, 15,
37 10, 0, 141, 141, 141, 141, 141, 141,
39 register int hval
= len
;
45 hval
+= asso_values
[str
[4]];
49 hval
+= asso_values
[str
[1]];
51 hval
+= asso_values
[str
[0]];
59 const struct locale_keyword
*
60 in_word_set (register const char *str
, register int len
)
62 static const struct locale_keyword wordlist
[] =
64 {"",}, {"",}, {"",}, {"",},
68 {"toupper", TOK_TOUPPER
},
69 {"position", TOK_POSITION
},
72 {"escape_char", TOK_ESCAPE_CHAR
},
73 {"comment_char", TOK_COMMENT_CHAR
},
74 {"positive_sign", POSITIVE_SIGN
},
76 {"t_fmt_ampm", T_FMT_AMPM
},
80 {"p_sep_by_space", P_SEP_BY_SPACE
},
81 {"LC_NUMERIC", _NL_NUM_LC_NUMERIC
},
83 {"tolower", TOK_TOLOWER
},
84 {"p_cs_precedes", P_CS_PRECEDES
},
85 {"UNDEFINED", TOK_UNDEFINED
},
87 {"collating_symbol", TOK_COLLATING_SYMBOL
},
88 {"collating_element", TOK_COLLATING_ELEMENT
},
89 {"negative_sign", NEGATIVE_SIGN
},
93 {"mon_thousands_sep", MON_THOUSANDS_SEP
},
95 {"n_sep_by_space", N_SEP_BY_SPACE
},
97 {"IGNORE", TOK_IGNORE
},
98 {"LC_TIME", _NL_NUM_LC_TIME
},
99 {"n_cs_precedes", N_CS_PRECEDES
},
101 {"int_curr_symbol", INT_CURR_SYMBOL
},
103 {"thousands_sep", THOUSANDS_SEP
},
106 {"xdigit", TOK_XDIGIT
},
108 {"decimal_point", DECIMAL_POINT
},
110 {"cntrl", TOK_CNTRL
},
111 {"p_sign_posn", P_SIGN_POSN
},
112 {"mon_decimal_point", MON_DECIMAL_POINT
},
113 {"LC_CTYPE", _NL_NUM_LC_CTYPE
},
115 {"alpha", TOK_ALPHA
},
117 {"forward", TOK_FORWARD
},
120 {"print", TOK_PRINT
},
122 {"mon_grouping", MON_GROUPING
},
123 {"era_year", ERA_YEAR
},
125 {"n_sign_posn", N_SIGN_POSN
},
129 {"alt_digits", ALT_DIGITS
},
131 {"d_t_fmt", D_T_FMT
},
134 {"LC_MESSAGES", _NL_NUM_LC_MESSAGES
},
136 {"int_frac_digits", INT_FRAC_DIGITS
},
138 {"era_d_fmt", ERA_D_FMT
},
139 {"punct", TOK_PUNCT
},
140 {"",}, {"",}, {"",}, {"",},
141 {"lower", TOK_LOWER
},
142 {"",}, {"",}, {"",}, {"",},
143 {"currency_symbol", CURRENCY_SYMBOL
},
145 {"grouping", GROUPING
},
148 {"",}, {"",}, {"",}, {"",},
149 {"LC_COLLATE", _NL_NUM_LC_COLLATE
},
150 {"LC_MONETARY", _NL_NUM_LC_MONETARY
},
151 {"",}, {"",}, {"",}, {"",},
152 {"frac_digits", FRAC_DIGITS
},
156 {"backward", TOK_BACKWARD
},
157 {"order_end", TOK_ORDER_END
},
158 {"blank", TOK_BLANK
},
159 {"order_start", TOK_ORDER_START
},
161 {"graph", TOK_GRAPH
},
162 {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
163 {"",}, {"",}, {"",}, {"",}, {"",},
164 {"upper", TOK_UPPER
},
167 if (len
<= MAX_WORD_LENGTH
&& len
>= MIN_WORD_LENGTH
)
169 register int key
= hash (str
, len
);
171 if (key
<= MAX_HASH_VALUE
&& key
>= 0)
173 register const char *s
= wordlist
[key
].name
;
175 if (*s
== *str
&& !strncmp (str
+ 1, s
+ 1, len
- 1))
176 return &wordlist
[key
];