* src/symtab.h, src/symtab.c (symbol_t): printer and

printer_location are new members.
(symbol_printer_set): New.
* src/parse-gram.y (PERCENT_PRINTER): New token.
Handle its associated rule.
* src/scan-gram.l: Adjust.
(handle_destructor_at, handle_destructor_dollar): Rename as...
(handle_symbol_code_at, handle_symbol_code_dollar): these.
* src/output.c (symbol_printers_output): New.
(output_skeleton): Call it.
* data/bison.simple (yysymprint): New.  Cannot be named yyprint
since there are already many grammar files with a user `yyprint'.
Replace the calls to YYPRINT to calls to yysymprint.
* tests/calc.at: Adjust.
* tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
taking advantage of parser very internal details (stack size!).
This commit is contained in:
Akim Demaille
2002-06-20 09:08:37 +00:00
parent 1ce5149ac8
commit 366eea36d3
13 changed files with 1104 additions and 1011 deletions

View File

@@ -15,37 +15,38 @@
PERCENT_NTERM = 262,
PERCENT_TYPE = 263,
PERCENT_DESTRUCTOR = 264,
PERCENT_UNION = 265,
PERCENT_LEFT = 266,
PERCENT_RIGHT = 267,
PERCENT_NONASSOC = 268,
PERCENT_EXPECT = 269,
PERCENT_START = 270,
PERCENT_PREC = 271,
PERCENT_VERBOSE = 272,
PERCENT_ERROR_VERBOSE = 273,
PERCENT_OUTPUT = 274,
PERCENT_FILE_PREFIX = 275,
PERCENT_NAME_PREFIX = 276,
PERCENT_DEFINE = 277,
PERCENT_PURE_PARSER = 278,
PERCENT_DEFINES = 279,
PERCENT_YACC = 280,
PERCENT_DEBUG = 281,
PERCENT_LOCATIONS = 282,
PERCENT_NO_LINES = 283,
PERCENT_SKELETON = 284,
PERCENT_TOKEN_TABLE = 285,
TYPE = 286,
EQUAL = 287,
SEMICOLON = 288,
COLON = 289,
PIPE = 290,
ID = 291,
PERCENT_PERCENT = 292,
PROLOGUE = 293,
EPILOGUE = 294,
BRACED_CODE = 295
PERCENT_PRINTER = 265,
PERCENT_UNION = 266,
PERCENT_LEFT = 267,
PERCENT_RIGHT = 268,
PERCENT_NONASSOC = 269,
PERCENT_EXPECT = 270,
PERCENT_START = 271,
PERCENT_PREC = 272,
PERCENT_VERBOSE = 273,
PERCENT_ERROR_VERBOSE = 274,
PERCENT_OUTPUT = 275,
PERCENT_FILE_PREFIX = 276,
PERCENT_NAME_PREFIX = 277,
PERCENT_DEFINE = 278,
PERCENT_PURE_PARSER = 279,
PERCENT_DEFINES = 280,
PERCENT_YACC = 281,
PERCENT_DEBUG = 282,
PERCENT_LOCATIONS = 283,
PERCENT_NO_LINES = 284,
PERCENT_SKELETON = 285,
PERCENT_TOKEN_TABLE = 286,
TYPE = 287,
EQUAL = 288,
SEMICOLON = 289,
COLON = 290,
PIPE = 291,
ID = 292,
PERCENT_PERCENT = 293,
PROLOGUE = 294,
EPILOGUE = 295,
BRACED_CODE = 296
};
# endif
/* POSIX requires `int' for tokens in interfaces. */
@@ -59,37 +60,38 @@
#define PERCENT_NTERM 262
#define PERCENT_TYPE 263
#define PERCENT_DESTRUCTOR 264
#define PERCENT_UNION 265
#define PERCENT_LEFT 266
#define PERCENT_RIGHT 267
#define PERCENT_NONASSOC 268
#define PERCENT_EXPECT 269
#define PERCENT_START 270
#define PERCENT_PREC 271
#define PERCENT_VERBOSE 272
#define PERCENT_ERROR_VERBOSE 273
#define PERCENT_OUTPUT 274
#define PERCENT_FILE_PREFIX 275
#define PERCENT_NAME_PREFIX 276
#define PERCENT_DEFINE 277
#define PERCENT_PURE_PARSER 278
#define PERCENT_DEFINES 279
#define PERCENT_YACC 280
#define PERCENT_DEBUG 281
#define PERCENT_LOCATIONS 282
#define PERCENT_NO_LINES 283
#define PERCENT_SKELETON 284
#define PERCENT_TOKEN_TABLE 285
#define TYPE 286
#define EQUAL 287
#define SEMICOLON 288
#define COLON 289
#define PIPE 290
#define ID 291
#define PERCENT_PERCENT 292
#define PROLOGUE 293
#define EPILOGUE 294
#define BRACED_CODE 295
#define PERCENT_PRINTER 265
#define PERCENT_UNION 266
#define PERCENT_LEFT 267
#define PERCENT_RIGHT 268
#define PERCENT_NONASSOC 269
#define PERCENT_EXPECT 270
#define PERCENT_START 271
#define PERCENT_PREC 272
#define PERCENT_VERBOSE 273
#define PERCENT_ERROR_VERBOSE 274
#define PERCENT_OUTPUT 275
#define PERCENT_FILE_PREFIX 276
#define PERCENT_NAME_PREFIX 277
#define PERCENT_DEFINE 278
#define PERCENT_PURE_PARSER 279
#define PERCENT_DEFINES 280
#define PERCENT_YACC 281
#define PERCENT_DEBUG 282
#define PERCENT_LOCATIONS 283
#define PERCENT_NO_LINES 284
#define PERCENT_SKELETON 285
#define PERCENT_TOKEN_TABLE 286
#define TYPE 287
#define EQUAL 288
#define SEMICOLON 289
#define COLON 290
#define PIPE 291
#define ID 292
#define PERCENT_PERCENT 293
#define PROLOGUE 294
#define EPILOGUE 295
#define BRACED_CODE 296
@@ -103,8 +105,8 @@ typedef union {
char *string;
associativity assoc;
} yystype;
/* Line 1271 of /usr/local/share/bison/bison.simple. */
#line 108 "y.tab.h"
/* Line 1313 of /usr/local/share/bison/bison.simple. */
#line 110 "y.tab.h"
# define YYSTYPE yystype
#endif