Commit 2b3a9101 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

widl: Group <INITIAL,ATTR> tokens together.

parent 88fa3459
...@@ -140,7 +140,6 @@ struct uuid *parse_uuid(const char *u) ...@@ -140,7 +140,6 @@ struct uuid *parse_uuid(const char *u)
*/ */
%% %%
<INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA); <INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA);
<INITIAL,ATTR>^{ws}*\#{ws}* yy_push_state(PP_LINE);
<PP_LINE>[^\n]* { <PP_LINE>[^\n]* {
int lineno; int lineno;
char *cptr, *fname; char *cptr, *fname;
...@@ -202,40 +201,47 @@ struct uuid *parse_uuid(const char *u) ...@@ -202,40 +201,47 @@ struct uuid *parse_uuid(const char *u)
<SQUOTE>\\\' addcchar(yytext[1]); <SQUOTE>\\\' addcchar(yytext[1]);
<QUOTE,WSTRQUOTE,SQUOTE>\\. addcchar('\\'); addcchar(yytext[1]); <QUOTE,WSTRQUOTE,SQUOTE>\\. addcchar('\\'); addcchar(yytext[1]);
<QUOTE,WSTRQUOTE,SQUOTE>. addcchar(yytext[0]); <QUOTE,WSTRQUOTE,SQUOTE>. addcchar(yytext[0]);
<INITIAL,ATTR>\[ yy_push_state(ATTR); return '[';
<ATTR>\] yy_pop_state(); return ']'; <ATTR>\] yy_pop_state(); return ']';
<ATTR>{cident} return attr_token(yytext, yylval); <ATTR>{cident} return attr_token(yytext, yylval);
<ATTR>{uuid} { <ATTR>{uuid} {
yylval->uuid = parse_uuid(yytext); yylval->uuid = parse_uuid(yytext);
return aUUID; return aUUID;
} }
<INITIAL,ATTR>{hex} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aHEXNUM;
}
<INITIAL,ATTR>{int} {
yylval->num = xstrtoul(yytext, NULL, 0);
return aNUM;
}
<INITIAL>{double} { <INITIAL>{double} {
yylval->dbl = strtod(yytext, NULL); yylval->dbl = strtod(yytext, NULL);
return aDOUBLE; return aDOUBLE;
} }
SAFEARRAY{ws}*/\( return tSAFEARRAY; SAFEARRAY{ws}*/\( return tSAFEARRAY;
{cident} return kw_token(yytext, yylval); {cident} return kw_token(yytext, yylval);
<INITIAL,ATTR>\n line_number++;
<INITIAL,ATTR>{ws} <INITIAL,ATTR>{
<INITIAL,ATTR>\<\< return SHL; ^{ws}*\#{ws}* { yy_push_state(PP_LINE); }
<INITIAL,ATTR>\>\> return SHR; \[ { yy_push_state(ATTR); return '['; }
<INITIAL,ATTR>\-\> return MEMBERPTR;
<INITIAL,ATTR>== return EQUALITY; {hex} {
<INITIAL,ATTR>!= return INEQUALITY; yylval->num = xstrtoul(yytext, NULL, 0);
<INITIAL,ATTR>\>= return GREATEREQUAL; return aHEXNUM;
<INITIAL,ATTR>\<= return LESSEQUAL; }
<INITIAL,ATTR>\|\| return LOGICALOR; {int} {
<INITIAL,ATTR>&& return LOGICALAND; yylval->num = xstrtoul(yytext, NULL, 0);
<INITIAL,ATTR>\.\.\. return ELLIPSIS; return aNUM;
<INITIAL,ATTR>. return yytext[0]; }
\n { line_number++; }
{ws} {}
\<\< { return SHL; }
\>\> { return SHR; }
\-\> { return MEMBERPTR; }
== { return EQUALITY; }
!= { return INEQUALITY; }
\>= { return GREATEREQUAL; }
\<= { return LESSEQUAL; }
\|\| { return LOGICALOR; }
&& { return LOGICALAND; }
\.\.\. { return ELLIPSIS; }
. { return yytext[0]; }
}
<<EOF>> { <<EOF>> {
if (!list_empty( &import_stack )) if (!list_empty( &import_stack ))
return aEOF; return aEOF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment