* src/parse-skel.y: Get rid of the shift/reduce conflict:

replace `gb' with BLANKS.
* src/scan-skel.l: Adjust.
This commit is contained in:
Akim Demaille
2001-12-30 21:06:36 +00:00
parent a4b36db458
commit 24fad99e2b
3 changed files with 24 additions and 6 deletions

View File

@@ -1,3 +1,10 @@
2001-12-30 Akim Demaille <akim@epita.fr>
* src/parse-skel.y: Get rid of the shift/reduce conflict:
replace `gb' with BLANKS.
* src/scan-skel.l: Adjust.
2001-12-30 Akim Demaille <akim@epita.fr>
* src/system.h: We don't need nor want bcopy.

View File

@@ -50,12 +50,20 @@ static int yyerror PARAMS ((const char* error));
{
char *muscle;
char *string;
char *literal;
char character;
int yacc;
}
/* Name of a muscle. */
%token <muscle> MUSCLE
/* A string dedicated to Bison (%%"foo"). */
%token <string> STRING
/* Raw data, to output directly. */
%token <literal> RAW
/* Spaces. */
%token <literal> BLANKS
/* Raw data, but char by char. */
%token <character> CHARACTER
%token LINE
@@ -81,7 +89,7 @@ skeleton : /* Empty. */ { }
section : section.header section.body { }
;
section.header : SECTION gb MUSCLE gb STRING gb section.yacc gb '\n'
section.header : SECTION BLANKS MUSCLE BLANKS STRING BLANKS section.yacc '\n'
{
char *name = 0;
char *limit = 0;
@@ -140,6 +148,8 @@ section.body
| section.body TOKENS { token_definitions_output (parser, &output_line); }
| section.body ACTIONS { actions_output (parser, &output_line); }
| section.body CHARACTER { fputc ($2, parser); }
| section.body RAW { fputs ($2, parser); }
| section.body BLANKS { fputs ($2, parser); }
| section.body MUSCLE {
const char* value = muscle_find ($2);
if (value)
@@ -154,11 +164,6 @@ section.body
}
}
;
gb : /* Empty. */ { }
| gb CHARACTER { /* Do not echo garbage characters. */ }
;
%%
static int

View File

@@ -64,6 +64,12 @@
return '\n';
}
/* White spaces. */
[\t ]+ {
yylval.literal = yytext;
return BLANKS;
}
/* Plain Character. */
. {
yylval.character = *yytext;