* src/scan-gram.l: Complete the scanner with the missing patterns

to pacify Flex.
Use `quote' and `symbol_tag_get' where appropriate.
This commit is contained in:
Akim Demaille
2002-06-20 07:19:13 +00:00
parent 93b68a0e09
commit 4f25ebb043
3 changed files with 411 additions and 368 deletions

View File

@@ -1,3 +1,10 @@
2002-06-20 Akim Demaille <akim@epita.fr>
* src/scan-gram.l: Complete the scanner with the missing patterns
to pacify Flex.
Use `quote' and `symbol_tag_get' where appropriate.
2002-06-19 Akim Demaille <akim@epita.fr> 2002-06-19 Akim Demaille <akim@epita.fr>
* tests/actions.at (Destructors): Augment to test locations. * tests/actions.at (Destructors): Augment to test locations.

File diff suppressed because it is too large Load Diff

View File

@@ -324,7 +324,7 @@ blanks [ \t\f]+
if (c > 255) if (c > 255)
{ {
LOCATION_PRINT (stderr, *yylloc); LOCATION_PRINT (stderr, *yylloc);
fprintf (stderr, ": invalid escape: %s\n", yytext); fprintf (stderr, ": invalid escape: %s\n", quote (yytext));
YY_STEP; YY_STEP;
} }
else else
@@ -343,11 +343,13 @@ blanks [ \t\f]+
\\t obstack_1grow (&string_obstack, '\t'); \\t obstack_1grow (&string_obstack, '\t');
\\v obstack_1grow (&string_obstack, '\v'); \\v obstack_1grow (&string_obstack, '\v');
\\[\\""] obstack_1grow (&string_obstack, yytext[1]); \\[\\""] obstack_1grow (&string_obstack, yytext[1]);
\\. { \\(.|\n) {
LOCATION_PRINT (stderr, *yylloc); LOCATION_PRINT (stderr, *yylloc);
fprintf (stderr, ": unrecognized escape: %s\n", yytext); fprintf (stderr, ": unrecognized escape: %s\n", quote (yytext));
YY_OBS_GROW; YY_OBS_GROW;
} }
/* FLex wants this rule, in case of a `\<<EOF>>'. */
\\ YY_OBS_GROW;
} }
@@ -364,8 +366,10 @@ blanks [ \t\f]+
yy_pop_state (); yy_pop_state ();
} }
[^\[\]\'\n\r\\] YY_OBS_GROW; [^\[\]\'\n\r\\]+ YY_OBS_GROW;
\\. YY_OBS_GROW; \\(.|\n) YY_OBS_GROW;
/* FLex wants this rule, in case of a `\<<EOF>>'. */
\\ YY_OBS_GROW;
{eols} YY_OBS_GROW; YY_LINES; {eols} YY_OBS_GROW; YY_LINES;
@@ -392,7 +396,9 @@ blanks [ \t\f]+
} }
[^\[\]\"\n\r\\]+ YY_OBS_GROW; [^\[\]\"\n\r\\]+ YY_OBS_GROW;
\\. YY_OBS_GROW; \\(.|\n) YY_OBS_GROW;
/* FLex wants this rule, in case of a `\<<EOF>>'. */
\\ YY_OBS_GROW;
{eols} YY_OBS_GROW; YY_LINES; {eols} YY_OBS_GROW; YY_LINES;
@@ -420,6 +426,9 @@ blanks [ \t\f]+
/* Comments. */ /* Comments. */
"/*" YY_OBS_GROW; yy_push_state (SC_COMMENT); "/*" YY_OBS_GROW; yy_push_state (SC_COMMENT);
"//".* YY_OBS_GROW; "//".* YY_OBS_GROW;
/* Not comments. */
"/" YY_OBS_GROW;
} }
@@ -479,9 +488,9 @@ blanks [ \t\f]+
return PROLOGUE; return PROLOGUE;
} }
[^%\[\]/\'\"\n\r]+ YY_OBS_GROW; [^%\[\]/\'\"\n\r]+ YY_OBS_GROW;
"%"+[^%\}\n\r]+ YY_OBS_GROW; "%" YY_OBS_GROW;
{eols} YY_OBS_GROW; YY_LINES; {eols} YY_OBS_GROW; YY_LINES;
<<EOF>> { <<EOF>> {
LOCATION_PRINT (stderr, *yylloc); LOCATION_PRINT (stderr, *yylloc);
@@ -491,7 +500,6 @@ blanks [ \t\f]+
yylval->string = last_string; yylval->string = last_string;
return PROLOGUE; return PROLOGUE;
} }
} }
@@ -546,7 +554,7 @@ handle_action_dollar (char *cp, location_t location)
type_name = symbol_list_n_type_name_get (current_rule, location, 0); type_name = symbol_list_n_type_name_get (current_rule, location, 0);
if (!type_name && typed) if (!type_name && typed)
complain_at (location, _("$$ of `%s' has no declared type"), complain_at (location, _("$$ of `%s' has no declared type"),
current_rule->sym->tag); symbol_tag_get (current_rule->sym));
if (!type_name) if (!type_name)
type_name = ""; type_name = "";
obstack_fgrow1 (&string_obstack, obstack_fgrow1 (&string_obstack,
@@ -570,7 +578,7 @@ handle_action_dollar (char *cp, location_t location)
n); n);
if (!type_name && typed) if (!type_name && typed)
complain_at (location, _("$%d of `%s' has no declared type"), complain_at (location, _("$%d of `%s' has no declared type"),
n, current_rule->sym->tag); n, symbol_tag_get (current_rule->sym));
if (!type_name) if (!type_name)
type_name = ""; type_name = "";
obstack_fgrow3 (&string_obstack, obstack_fgrow3 (&string_obstack,