Commit 6b808baf authored by Alexandre Julliard's avatar Alexandre Julliard

widl: Rename parser states to uppercase to avoid conflicts.

parent 0679dee7
...@@ -31,8 +31,8 @@ hex 0x{hexd}+ ...@@ -31,8 +31,8 @@ hex 0x{hexd}+
uuid {hexd}{8}-{hexd}{4}-{hexd}{4}-{hexd}{4}-{hexd}{12} uuid {hexd}{8}-{hexd}{4}-{hexd}{4}-{hexd}{4}-{hexd}{12}
%x QUOTE %x QUOTE
%x attr %x ATTR
%x pp_line %x PP_LINE
%{ %{
...@@ -105,8 +105,8 @@ static UUID* parse_uuid(const char*u) ...@@ -105,8 +105,8 @@ static UUID* parse_uuid(const char*u)
************************************************************************** **************************************************************************
*/ */
%% %%
<INITIAL,attr>^{ws}*\#{ws}* yy_push_state(pp_line); <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;
yy_pop_state(); yy_pop_state();
...@@ -125,7 +125,7 @@ static UUID* parse_uuid(const char*u) ...@@ -125,7 +125,7 @@ static UUID* parse_uuid(const char*u)
free( input_name ); free( input_name );
input_name = xstrdup(fname); input_name = xstrdup(fname);
} }
<INITIAL,attr>\" yy_push_state(QUOTE); cbufidx = 0; <INITIAL,ATTR>\" yy_push_state(QUOTE); cbufidx = 0;
<QUOTE>\" { <QUOTE>\" {
yy_pop_state(); yy_pop_state();
parser_lval.str = get_buffered_cstring(); parser_lval.str = get_buffered_cstring();
...@@ -135,28 +135,28 @@ static UUID* parse_uuid(const char*u) ...@@ -135,28 +135,28 @@ static UUID* parse_uuid(const char*u)
<QUOTE>\\\" addcchar(yytext[1]); <QUOTE>\\\" addcchar(yytext[1]);
<QUOTE>\\. addcchar('\\'); addcchar(yytext[1]); <QUOTE>\\. addcchar('\\'); addcchar(yytext[1]);
<QUOTE>. addcchar(yytext[0]); <QUOTE>. addcchar(yytext[0]);
<INITIAL,attr>\[ yy_push_state(attr); return '['; <INITIAL,ATTR>\[ yy_push_state(ATTR); return '[';
<attr>\] yy_pop_state(); return ']'; <ATTR>\] yy_pop_state(); return ']';
<attr>{cident} return attr_token(yytext); <ATTR>{cident} return attr_token(yytext);
<attr>{uuid} { <ATTR>{uuid} {
parser_lval.uuid = parse_uuid(yytext); parser_lval.uuid = parse_uuid(yytext);
return aUUID; return aUUID;
} }
<INITIAL,attr>{hex} { <INITIAL,ATTR>{hex} {
parser_lval.num = strtoul(yytext, NULL, 0); parser_lval.num = strtoul(yytext, NULL, 0);
return aHEXNUM; return aHEXNUM;
} }
<INITIAL,attr>{int} { <INITIAL,ATTR>{int} {
parser_lval.num = strtoul(yytext, NULL, 0); parser_lval.num = strtoul(yytext, NULL, 0);
return aNUM; return aNUM;
} }
SAFEARRAY{ws}*/\( return tSAFEARRAY; SAFEARRAY{ws}*/\( return tSAFEARRAY;
{cident} return kw_token(yytext); {cident} return kw_token(yytext);
<INITIAL,attr>\n line_number++; <INITIAL,ATTR>\n line_number++;
<INITIAL,attr>{ws} <INITIAL,ATTR>{ws}
<INITIAL,attr>\<\< return SHL; <INITIAL,ATTR>\<\< return SHL;
<INITIAL,attr>\>\> return SHR; <INITIAL,ATTR>\>\> return SHR;
<INITIAL,attr>. return yytext[0]; <INITIAL,ATTR>. return yytext[0];
<<EOF>> { <<EOF>> {
if (import_stack_ptr) { if (import_stack_ptr) {
pop_import(); pop_import();
......
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