From: Akim Demaille Date: Sun, 30 Dec 2001 21:06:36 +0000 (+0000) Subject: * src/parse-skel.y: Get rid of the shift/reduce conflict: X-Git-Tag: before-m4-back-end~40 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/24fad99e2bb2bdb0d5bd62571a0be8d60b97e2f8 * src/parse-skel.y: Get rid of the shift/reduce conflict: replace `gb' with BLANKS. * src/scan-skel.l: Adjust. --- diff --git a/ChangeLog b/ChangeLog index 54b7fd8b..69fb9fc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-12-30 Akim Demaille + + * 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 * src/system.h: We don't need nor want bcopy. diff --git a/src/parse-skel.y b/src/parse-skel.y index 0d56dcfe..8cf7fcd5 100644 --- a/src/parse-skel.y +++ b/src/parse-skel.y @@ -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 +/* A string dedicated to Bison (%%"foo"). */ %token STRING +/* Raw data, to output directly. */ +%token RAW +/* Spaces. */ +%token BLANKS +/* Raw data, but char by char. */ %token 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 diff --git a/src/scan-skel.l b/src/scan-skel.l index 0bb71d19..fc88b4a1 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -64,6 +64,12 @@ return '\n'; } + /* White spaces. */ +[\t ]+ { + yylval.literal = yytext; + return BLANKS; +} + /* Plain Character. */ . { yylval.character = *yytext;