* data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of

arguments is really empty, not only equal to `[]'.
* src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
member.
(symbol_destructor_set): New.
* src/output.c (symbol_destructors_output): New.
* src/reader.h (brace_code_t, current_braced_code): New.
* src/scan-gram.l (BRACED_CODE): Use it to branch on...
(handle_dollar): Rename as...
(handle_action_dollar): this.
(handle_destructor_dollar): New.
* src/parse-gram.y (PERCENT_DESTRUCTOR): New.
(grammar_declaration): Use it.
* data/bison.simple (yystos): Is always defined.
(yydestructor): New.
* tests/actions.at (Destructors): New.
* tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
This commit is contained in:
Akim Demaille
2002-06-17 08:43:12 +00:00
parent dafdc66ff0
commit 9280d3ef89
15 changed files with 1222 additions and 848 deletions

View File

@@ -14,37 +14,38 @@
PERCENT_TOKEN = 261,
PERCENT_NTERM = 262,
PERCENT_TYPE = 263,
PERCENT_UNION = 264,
PERCENT_LEFT = 265,
PERCENT_RIGHT = 266,
PERCENT_NONASSOC = 267,
PERCENT_EXPECT = 268,
PERCENT_START = 269,
PERCENT_PREC = 270,
PERCENT_VERBOSE = 271,
PERCENT_ERROR_VERBOSE = 272,
PERCENT_OUTPUT = 273,
PERCENT_FILE_PREFIX = 274,
PERCENT_NAME_PREFIX = 275,
PERCENT_DEFINE = 276,
PERCENT_PURE_PARSER = 277,
PERCENT_DEFINES = 278,
PERCENT_YACC = 279,
PERCENT_DEBUG = 280,
PERCENT_LOCATIONS = 281,
PERCENT_NO_LINES = 282,
PERCENT_SKELETON = 283,
PERCENT_TOKEN_TABLE = 284,
TYPE = 285,
EQUAL = 286,
SEMICOLON = 287,
COLON = 288,
PIPE = 289,
ID = 290,
PERCENT_PERCENT = 291,
PROLOGUE = 292,
EPILOGUE = 293,
BRACED_CODE = 294
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
};
# endif
/* POSIX requires `int' for tokens in interfaces. */
@@ -57,43 +58,44 @@
#define PERCENT_TOKEN 261
#define PERCENT_NTERM 262
#define PERCENT_TYPE 263
#define PERCENT_UNION 264
#define PERCENT_LEFT 265
#define PERCENT_RIGHT 266
#define PERCENT_NONASSOC 267
#define PERCENT_EXPECT 268
#define PERCENT_START 269
#define PERCENT_PREC 270
#define PERCENT_VERBOSE 271
#define PERCENT_ERROR_VERBOSE 272
#define PERCENT_OUTPUT 273
#define PERCENT_FILE_PREFIX 274
#define PERCENT_NAME_PREFIX 275
#define PERCENT_DEFINE 276
#define PERCENT_PURE_PARSER 277
#define PERCENT_DEFINES 278
#define PERCENT_YACC 279
#define PERCENT_DEBUG 280
#define PERCENT_LOCATIONS 281
#define PERCENT_NO_LINES 282
#define PERCENT_SKELETON 283
#define PERCENT_TOKEN_TABLE 284
#define TYPE 285
#define EQUAL 286
#define SEMICOLON 287
#define COLON 288
#define PIPE 289
#define ID 290
#define PERCENT_PERCENT 291
#define PROLOGUE 292
#define EPILOGUE 293
#define BRACED_CODE 294
#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
#ifndef YYSTYPE
#line 90 "parse-gram.y"
#line 91 "parse-gram.y"
typedef union {
symbol_t *symbol;
symbol_list_t *list;
@@ -102,7 +104,7 @@ typedef union {
associativity assoc;
} yystype;
/* Line 1271 of /usr/local/share/bison/bison.simple. */
#line 106 "y.tab.h"
#line 108 "y.tab.h"
# define YYSTYPE yystype
#endif