mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
Minor code cleanup.
* src/parse-gram.y: Clean up sorting of declarations. Use types to simplify %printer declarations where possible. Provide %printer for BRACKETED_ID and symbol.prec. * src/symtab.c: Whitespace change.
This commit is contained in:
@@ -1,3 +1,11 @@
|
|||||||
|
2009-10-04 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
|
Minor code cleanup.
|
||||||
|
* src/parse-gram.y: Clean up sorting of declarations.
|
||||||
|
Use types to simplify %printer declarations where possible.
|
||||||
|
Provide %printer for BRACKETED_ID and symbol.prec.
|
||||||
|
* src/symtab.c: Whitespace change.
|
||||||
|
|
||||||
2009-10-04 Joel E. Denny <jdenny@clemson.edu>
|
2009-10-04 Joel E. Denny <jdenny@clemson.edu>
|
||||||
|
|
||||||
tests: skip tests of file names that platform does not support.
|
tests: skip tests of file names that platform does not support.
|
||||||
|
|||||||
666
src/parse-gram.c
666
src/parse-gram.c
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
/* A Bison parser, made by GNU Bison 2.4.425-305c-dirty. */
|
/* A Bison parser, made by GNU Bison 2.4.434-7439c. */
|
||||||
|
|
||||||
/* Interface for Bison's Yacc-like parsers in C
|
/* Interface for Bison's Yacc-like parsers in C
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
/* "%code requires" blocks. */
|
/* "%code requires" blocks. */
|
||||||
/* Line 1624 of yacc.c */
|
/* Line 1624 of yacc.c */
|
||||||
#line 201 "src/parse-gram.y"
|
#line 202 "src/parse-gram.y"
|
||||||
|
|
||||||
# ifndef PARAM_TYPE
|
# ifndef PARAM_TYPE
|
||||||
# define PARAM_TYPE
|
# define PARAM_TYPE
|
||||||
@@ -94,19 +94,19 @@
|
|||||||
PERCENT_VERBOSE = 293,
|
PERCENT_VERBOSE = 293,
|
||||||
PERCENT_YACC = 294,
|
PERCENT_YACC = 294,
|
||||||
BRACED_CODE = 295,
|
BRACED_CODE = 295,
|
||||||
CHAR = 296,
|
BRACKETED_ID = 296,
|
||||||
EPILOGUE = 297,
|
CHAR = 297,
|
||||||
EQUAL = 298,
|
EPILOGUE = 298,
|
||||||
ID = 299,
|
EQUAL = 299,
|
||||||
ID_COLON = 300,
|
ID = 300,
|
||||||
PERCENT_PERCENT = 301,
|
ID_COLON = 301,
|
||||||
PIPE = 302,
|
PERCENT_PERCENT = 302,
|
||||||
PROLOGUE = 303,
|
PIPE = 303,
|
||||||
SEMICOLON = 304,
|
PROLOGUE = 304,
|
||||||
TAG = 305,
|
SEMICOLON = 305,
|
||||||
TAG_ANY = 306,
|
TAG = 306,
|
||||||
TAG_NONE = 307,
|
TAG_ANY = 307,
|
||||||
BRACKETED_ID = 308,
|
TAG_NONE = 308,
|
||||||
PERCENT_PARAM = 309,
|
PERCENT_PARAM = 309,
|
||||||
PERCENT_UNION = 310
|
PERCENT_UNION = 310
|
||||||
};
|
};
|
||||||
@@ -151,19 +151,19 @@
|
|||||||
#define PERCENT_VERBOSE 293
|
#define PERCENT_VERBOSE 293
|
||||||
#define PERCENT_YACC 294
|
#define PERCENT_YACC 294
|
||||||
#define BRACED_CODE 295
|
#define BRACED_CODE 295
|
||||||
#define CHAR 296
|
#define BRACKETED_ID 296
|
||||||
#define EPILOGUE 297
|
#define CHAR 297
|
||||||
#define EQUAL 298
|
#define EPILOGUE 298
|
||||||
#define ID 299
|
#define EQUAL 299
|
||||||
#define ID_COLON 300
|
#define ID 300
|
||||||
#define PERCENT_PERCENT 301
|
#define ID_COLON 301
|
||||||
#define PIPE 302
|
#define PERCENT_PERCENT 302
|
||||||
#define PROLOGUE 303
|
#define PIPE 303
|
||||||
#define SEMICOLON 304
|
#define PROLOGUE 304
|
||||||
#define TAG 305
|
#define SEMICOLON 305
|
||||||
#define TAG_ANY 306
|
#define TAG 306
|
||||||
#define TAG_NONE 307
|
#define TAG_ANY 307
|
||||||
#define BRACKETED_ID 308
|
#define TAG_NONE 308
|
||||||
#define PERCENT_PARAM 309
|
#define PERCENT_PARAM 309
|
||||||
#define PERCENT_UNION 310
|
#define PERCENT_UNION 310
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ typedef union YYSTYPE
|
|||||||
unsigned char character;
|
unsigned char character;
|
||||||
|
|
||||||
/* Line 1624 of yacc.c */
|
/* Line 1624 of yacc.c */
|
||||||
#line 225 "src/parse-gram.y"
|
#line 226 "src/parse-gram.y"
|
||||||
|
|
||||||
param_type param;
|
param_type param;
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ static char const *char_name (char);
|
|||||||
;
|
;
|
||||||
|
|
||||||
%token BRACED_CODE "{...}"
|
%token BRACED_CODE "{...}"
|
||||||
|
%token BRACKETED_ID "[identifier]"
|
||||||
%token CHAR "char"
|
%token CHAR "char"
|
||||||
%token EPILOGUE "epilogue"
|
%token EPILOGUE "epilogue"
|
||||||
%token EQUAL "="
|
%token EQUAL "="
|
||||||
@@ -163,7 +164,6 @@ static char const *char_name (char);
|
|||||||
%token TAG "<tag>"
|
%token TAG "<tag>"
|
||||||
%token TAG_ANY "<*>"
|
%token TAG_ANY "<*>"
|
||||||
%token TAG_NONE "<>"
|
%token TAG_NONE "<>"
|
||||||
%token BRACKETED_ID "[identifier]"
|
|
||||||
|
|
||||||
%type <character> CHAR
|
%type <character> CHAR
|
||||||
%printer { fputs (char_name ($$), stderr); } CHAR
|
%printer { fputs (char_name ($$), stderr); } CHAR
|
||||||
@@ -177,22 +177,23 @@ static char const *char_name (char);
|
|||||||
%printer { fprintf (stderr, "{\n%s\n}", $$); }
|
%printer { fprintf (stderr, "{\n%s\n}", $$); }
|
||||||
braceless content.opt "{...}" "%{...%}" EPILOGUE
|
braceless content.opt "{...}" "%{...%}" EPILOGUE
|
||||||
|
|
||||||
%type <uniqstr> TAG ID ID_COLON BRACKETED_ID PERCENT_FLAG variable
|
%type <uniqstr> BRACKETED_ID ID ID_COLON PERCENT_FLAG TAG variable
|
||||||
%type <named_ref> named_ref.opt
|
%printer { fputs ($$, stderr); } <uniqstr>
|
||||||
%printer { fputs ($$, stderr); } ID variable
|
%printer { fprintf (stderr, "[%s]", $$); } BRACKETED_ID
|
||||||
%printer { fprintf (stderr, "%s:", $$); } ID_COLON
|
%printer { fprintf (stderr, "%s:", $$); } ID_COLON
|
||||||
%printer { fprintf (stderr, "%%%s", $$); } PERCENT_FLAG
|
%printer { fprintf (stderr, "%%%s", $$); } PERCENT_FLAG
|
||||||
%printer { fprintf (stderr, "<%s>", $$); } TAG
|
%printer { fprintf (stderr, "<%s>", $$); } TAG
|
||||||
|
|
||||||
%type <integer> INT
|
%type <integer> INT
|
||||||
%printer { fprintf (stderr, "%d", $$); } INT
|
%printer { fprintf (stderr, "%d", $$); } <integer>
|
||||||
|
|
||||||
%type <symbol> id id_colon symbol symbol.prec string_as_id
|
%type <symbol> id id_colon string_as_id symbol symbol.prec
|
||||||
%printer { fprintf (stderr, "%s", $$->tag); } id symbol string_as_id
|
%printer { fprintf (stderr, "%s", $$->tag); } <symbol>
|
||||||
%printer { fprintf (stderr, "%s:", $$->tag); } id_colon
|
%printer { fprintf (stderr, "%s:", $$->tag); } id_colon
|
||||||
|
|
||||||
%type <assoc> precedence_declarator
|
%type <assoc> precedence_declarator
|
||||||
%type <list> symbols.1 symbols.prec generic_symlist generic_symlist_item
|
%type <list> symbols.1 symbols.prec generic_symlist generic_symlist_item
|
||||||
|
%type <named_ref> named_ref.opt
|
||||||
|
|
||||||
/*---------.
|
/*---------.
|
||||||
| %param. |
|
| %param. |
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ static inline void
|
|||||||
symbol_check_alias_consistency (symbol *this)
|
symbol_check_alias_consistency (symbol *this)
|
||||||
{
|
{
|
||||||
symbol *sym = this;
|
symbol *sym = this;
|
||||||
symbol *str = this->alias;
|
symbol *str = this->alias;
|
||||||
|
|
||||||
/* Check only the symbol in the symbol-string pair. */
|
/* Check only the symbol in the symbol-string pair. */
|
||||||
if (!(this->alias
|
if (!(this->alias
|
||||||
|
|||||||
Reference in New Issue
Block a user