}
%}
-"..." return T_ELLIPSIS;
-";" return T_SEMICOLON;
-"*" return T_ASTERISK;
-"(" return T_LPAREN;
-")" return T_RPAREN;
-"[" return T_LBRACKET;
-"]" return T_RBRACKET;
-"," return T_COMMA;
+"..."|[][;*(),] {
+ unsigned char *match;
+ static const unsigned char tab[2][8] = {
+ "*[](),.;",
+ {
+ PACK_TOKEN(T_ASTERISK),
+ PACK_TOKEN(T_LBRACKET),
+ PACK_TOKEN(T_RBRACKET),
+ PACK_TOKEN(T_LPAREN),
+ PACK_TOKEN(T_RPAREN),
+ PACK_TOKEN(T_COMMA),
+ PACK_TOKEN(T_ELLIPSIS),
+ PACK_TOKEN(T_SEMICOLON)
+ }
+ };
+
+ match = memchr(&tab, yytext[0], sizeof tab[0]);
+ return UNPACK_TOKEN(match[sizeof tab[0]]);
+}
{INTEGER} {
char *end;
}
{IDENT} {
- int ret = cdecl__to_keyword(yytext, yyleng, yyextra);
- if (ret == T_IDENT) {
+ unsigned x = cdecl__to_keyword(yytext, yyleng, yyextra);
+ int tok;
+
+ yylval->spectype = UNPACK_SPEC(x & 0xff);
+ if ((tok = (x >> 8)) == PACK_TOKEN(T_IDENT)) {
/*
* Our IDENT pattern includes hyphens so we can match
* "variable-length" as a keyword. In all other cases a
#endif
dup_token();
}
- return ret;
+ return UNPACK_TOKEN(tok);
}
[[:space:]]+