mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
* 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:
@@ -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>
|
2001-12-30 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* src/system.h: We don't need nor want bcopy.
|
* src/system.h: We don't need nor want bcopy.
|
||||||
|
|||||||
@@ -50,12 +50,20 @@ static int yyerror PARAMS ((const char* error));
|
|||||||
{
|
{
|
||||||
char *muscle;
|
char *muscle;
|
||||||
char *string;
|
char *string;
|
||||||
|
char *literal;
|
||||||
char character;
|
char character;
|
||||||
int yacc;
|
int yacc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Name of a muscle. */
|
||||||
%token <muscle> MUSCLE
|
%token <muscle> MUSCLE
|
||||||
|
/* A string dedicated to Bison (%%"foo"). */
|
||||||
%token <string> STRING
|
%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 <character> CHARACTER
|
||||||
|
|
||||||
%token LINE
|
%token LINE
|
||||||
@@ -81,7 +89,7 @@ skeleton : /* Empty. */ { }
|
|||||||
section : section.header section.body { }
|
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 *name = 0;
|
||||||
char *limit = 0;
|
char *limit = 0;
|
||||||
@@ -140,6 +148,8 @@ section.body
|
|||||||
| section.body TOKENS { token_definitions_output (parser, &output_line); }
|
| section.body TOKENS { token_definitions_output (parser, &output_line); }
|
||||||
| section.body ACTIONS { actions_output (parser, &output_line); }
|
| section.body ACTIONS { actions_output (parser, &output_line); }
|
||||||
| section.body CHARACTER { fputc ($2, parser); }
|
| section.body CHARACTER { fputc ($2, parser); }
|
||||||
|
| section.body RAW { fputs ($2, parser); }
|
||||||
|
| section.body BLANKS { fputs ($2, parser); }
|
||||||
| section.body MUSCLE {
|
| section.body MUSCLE {
|
||||||
const char* value = muscle_find ($2);
|
const char* value = muscle_find ($2);
|
||||||
if (value)
|
if (value)
|
||||||
@@ -154,11 +164,6 @@ section.body
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
gb : /* Empty. */ { }
|
|
||||||
| gb CHARACTER { /* Do not echo garbage characters. */ }
|
|
||||||
;
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
@@ -64,6 +64,12 @@
|
|||||||
return '\n';
|
return '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* White spaces. */
|
||||||
|
[\t ]+ {
|
||||||
|
yylval.literal = yytext;
|
||||||
|
return BLANKS;
|
||||||
|
}
|
||||||
|
|
||||||
/* Plain Character. */
|
/* Plain Character. */
|
||||||
. {
|
. {
|
||||||
yylval.character = *yytext;
|
yylval.character = *yytext;
|
||||||
|
|||||||
Reference in New Issue
Block a user