59 |
do { \ |
do { \ |
60 |
obstack_1grow (&string_obstack, '\0'); \ |
obstack_1grow (&string_obstack, '\0'); \ |
61 |
last_string = obstack_finish (&string_obstack); \ |
last_string = obstack_finish (&string_obstack); \ |
|
yylval->string = last_string; \ |
|
62 |
} while (0) |
} while (0) |
63 |
|
|
64 |
#define YY_OBS_FREE \ |
#define YY_OBS_FREE \ |
66 |
obstack_free (&string_obstack, last_string); \ |
obstack_free (&string_obstack, last_string); \ |
67 |
} while (0) |
} while (0) |
68 |
|
|
69 |
|
void |
70 |
|
scanner_last_string_free (void) |
71 |
|
{ |
72 |
|
YY_OBS_FREE; |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
/* This is only to avoid GCC warnings. */ |
/* This is only to avoid GCC warnings. */ |
77 |
#define YY_USER_INIT if (yycontrol) {;}; |
#define YY_USER_INIT if (yycontrol) {;}; |
78 |
|
|
154 |
{eols} YY_LINES; YY_STEP; |
{eols} YY_LINES; YY_STEP; |
155 |
{blanks} YY_STEP; |
{blanks} YY_STEP; |
156 |
{id} { |
{id} { |
157 |
YY_OBS_INIT; YY_OBS_GROW; YY_OBS_FINISH; |
yylval->symbol = getsym (yytext); |
|
yylval->symbol = getsym (last_string); |
|
|
YY_OBS_FREE; |
|
158 |
return ID; |
return ID; |
159 |
} |
} |
160 |
|
|
177 |
"{" YY_OBS_INIT; YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE); |
"{" YY_OBS_INIT; YY_OBS_GROW; ++braces_level; yy_push_state (SC_BRACED_CODE); |
178 |
|
|
179 |
/* A type. */ |
/* A type. */ |
180 |
"<"[^>]+">" YY_OBS_INIT; obstack_grow (&string_obstack, yytext + 1, yyleng - 2); YY_OBS_FINISH; return TYPE; |
"<"[^>]+">" { |
181 |
|
YY_OBS_INIT; |
182 |
|
obstack_grow (&string_obstack, yytext + 1, yyleng - 2); |
183 |
|
YY_OBS_FINISH; |
184 |
|
yylval->string = last_string; |
185 |
|
return TYPE; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
"%%" { |
"%%" { |
190 |
if (++percent_percent_count == 2) |
if (++percent_percent_count == 2) |
255 |
assert (yy_top_state () == INITIAL); |
assert (yy_top_state () == INITIAL); |
256 |
YY_OBS_GROW; |
YY_OBS_GROW; |
257 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
258 |
|
yylval->string = last_string; |
259 |
yy_pop_state (); |
yy_pop_state (); |
260 |
return STRING; |
return STRING; |
261 |
} |
} |
269 |
fprintf (stderr, ": unexpected end of file in a string\n"); |
fprintf (stderr, ": unexpected end of file in a string\n"); |
270 |
assert (yy_top_state () == INITIAL); |
assert (yy_top_state () == INITIAL); |
271 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
272 |
|
yylval->string = last_string; |
273 |
yy_pop_state (); |
yy_pop_state (); |
274 |
return STRING; |
return STRING; |
275 |
} |
} |
305 |
fprintf (stderr, ": unexpected end of file in a character\n"); |
fprintf (stderr, ": unexpected end of file in a character\n"); |
306 |
assert (yy_top_state () == INITIAL); |
assert (yy_top_state () == INITIAL); |
307 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
308 |
|
yylval->string = last_string; |
309 |
yy_pop_state (); |
yy_pop_state (); |
310 |
return CHARACTER; |
return CHARACTER; |
311 |
} |
} |
435 |
{ |
{ |
436 |
yy_pop_state (); |
yy_pop_state (); |
437 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
438 |
|
yylval->string = last_string; |
439 |
return BRACED_CODE; |
return BRACED_CODE; |
440 |
} |
} |
441 |
} |
} |
456 |
fprintf (stderr, ": unexpected end of file in a braced code\n"); |
fprintf (stderr, ": unexpected end of file in a braced code\n"); |
457 |
yy_pop_state (); |
yy_pop_state (); |
458 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
459 |
return PROLOGUE; |
yylval->string = last_string; |
460 |
|
return BRACED_CODE; |
461 |
} |
} |
462 |
|
|
463 |
} |
} |
472 |
"%}" { |
"%}" { |
473 |
yy_pop_state (); |
yy_pop_state (); |
474 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
475 |
|
yylval->string = last_string; |
476 |
return PROLOGUE; |
return PROLOGUE; |
477 |
} |
} |
478 |
|
|
485 |
fprintf (stderr, ": unexpected end of file in a prologue\n"); |
fprintf (stderr, ": unexpected end of file in a prologue\n"); |
486 |
yy_pop_state (); |
yy_pop_state (); |
487 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
488 |
|
yylval->string = last_string; |
489 |
return PROLOGUE; |
return PROLOGUE; |
490 |
} |
} |
491 |
|
|
504 |
<<EOF>> { |
<<EOF>> { |
505 |
yy_pop_state (); |
yy_pop_state (); |
506 |
YY_OBS_FINISH; |
YY_OBS_FINISH; |
507 |
|
yylval->string = last_string; |
508 |
return EPILOGUE; |
return EPILOGUE; |
509 |
} |
} |
510 |
} |
} |
626 |
complain (_("%s is invalid"), quote (buf)); |
complain (_("%s is invalid"), quote (buf)); |
627 |
} |
} |
628 |
} |
} |
629 |
|
|
630 |
|
void |
631 |
|
scanner_free (void) |
632 |
|
{ |
633 |
|
obstack_free (&string_obstack, 0); |
634 |
|
} |