mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
2006-10-16 Paolo Bonzini <bonzini@gnu.org>
* data/bison.m4 (b4_user_requires, b4_user_provides): New.
(b4_user_start_header): Remove.
* data/glr.c: Use new macros instead of b4_*start_header
and b4_*end_header.
* data/glr.cc: Likewise.
* data/lalr1.cc: Likewise.
* data/push.c: Likewise.
* data/yacc.c: Likewise.
* doc/bison.texinfo: Remove %before-header, rename
%{start,end,after}-header to %requires, %provides, %code.
* src/parse-gram.y: Likewise (also rename token names accordingly).
* src/scan-gram.l: Likewise.
* tests/actions.at: Likewise.
This commit is contained in:
1259
src/parse-gram.c
1259
src/parse-gram.c
File diff suppressed because it is too large
Load Diff
182
src/parse-gram.h
182
src/parse-gram.h
@@ -1,20 +1,20 @@
|
||||
/* A Bison parser, made by GNU Bison 2.3a. */
|
||||
/* A Bison parser, made by GNU Bison 2.3a+. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
@@ -29,7 +29,7 @@
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
@@ -55,48 +55,47 @@
|
||||
PERCENT_PREC = 269,
|
||||
PERCENT_DPREC = 270,
|
||||
PERCENT_MERGE = 271,
|
||||
PERCENT_AFTER_HEADER = 272,
|
||||
PERCENT_BEFORE_HEADER = 273,
|
||||
PERCENT_DEBUG = 274,
|
||||
PERCENT_DEFAULT_PREC = 275,
|
||||
PERCENT_DEFINE = 276,
|
||||
PERCENT_DEFINES = 277,
|
||||
PERCENT_END_HEADER = 278,
|
||||
PERCENT_ERROR_VERBOSE = 279,
|
||||
PERCENT_EXPECT = 280,
|
||||
PERCENT_EXPECT_RR = 281,
|
||||
PERCENT_FILE_PREFIX = 282,
|
||||
PERCENT_GLR_PARSER = 283,
|
||||
PERCENT_INITIAL_ACTION = 284,
|
||||
PERCENT_LEX_PARAM = 285,
|
||||
PERCENT_LOCATIONS = 286,
|
||||
PERCENT_NAME_PREFIX = 287,
|
||||
PERCENT_NO_DEFAULT_PREC = 288,
|
||||
PERCENT_NO_LINES = 289,
|
||||
PERCENT_NONDETERMINISTIC_PARSER = 290,
|
||||
PERCENT_OUTPUT = 291,
|
||||
PERCENT_PARSE_PARAM = 292,
|
||||
PERCENT_PURE_PARSER = 293,
|
||||
PERCENT_PUSH_PARSER = 294,
|
||||
PERCENT_REQUIRE = 295,
|
||||
PERCENT_CODE = 272,
|
||||
PERCENT_DEBUG = 273,
|
||||
PERCENT_DEFAULT_PREC = 274,
|
||||
PERCENT_DEFINE = 275,
|
||||
PERCENT_DEFINES = 276,
|
||||
PERCENT_ERROR_VERBOSE = 277,
|
||||
PERCENT_EXPECT = 278,
|
||||
PERCENT_EXPECT_RR = 279,
|
||||
PERCENT_FILE_PREFIX = 280,
|
||||
PERCENT_GLR_PARSER = 281,
|
||||
PERCENT_INITIAL_ACTION = 282,
|
||||
PERCENT_LEX_PARAM = 283,
|
||||
PERCENT_LOCATIONS = 284,
|
||||
PERCENT_NAME_PREFIX = 285,
|
||||
PERCENT_NO_DEFAULT_PREC = 286,
|
||||
PERCENT_NO_LINES = 287,
|
||||
PERCENT_NONDETERMINISTIC_PARSER = 288,
|
||||
PERCENT_OUTPUT = 289,
|
||||
PERCENT_PARSE_PARAM = 290,
|
||||
PERCENT_PROVIDES = 291,
|
||||
PERCENT_PURE_PARSER = 292,
|
||||
PERCENT_PUSH_PARSER = 293,
|
||||
PERCENT_REQUIRE = 294,
|
||||
PERCENT_REQUIRES = 295,
|
||||
PERCENT_SKELETON = 296,
|
||||
PERCENT_START = 297,
|
||||
PERCENT_START_HEADER = 298,
|
||||
PERCENT_TOKEN_TABLE = 299,
|
||||
PERCENT_VERBOSE = 300,
|
||||
PERCENT_YACC = 301,
|
||||
BRACED_CODE = 302,
|
||||
CHAR = 303,
|
||||
EPILOGUE = 304,
|
||||
EQUAL = 305,
|
||||
ID = 306,
|
||||
ID_COLON = 307,
|
||||
PERCENT_PERCENT = 308,
|
||||
PIPE = 309,
|
||||
PROLOGUE = 310,
|
||||
SEMICOLON = 311,
|
||||
TYPE = 312,
|
||||
PERCENT_UNION = 313
|
||||
PERCENT_TOKEN_TABLE = 298,
|
||||
PERCENT_VERBOSE = 299,
|
||||
PERCENT_YACC = 300,
|
||||
BRACED_CODE = 301,
|
||||
CHAR = 302,
|
||||
EPILOGUE = 303,
|
||||
EQUAL = 304,
|
||||
ID = 305,
|
||||
ID_COLON = 306,
|
||||
PERCENT_PERCENT = 307,
|
||||
PIPE = 308,
|
||||
PROLOGUE = 309,
|
||||
SEMICOLON = 310,
|
||||
TYPE = 311,
|
||||
PERCENT_UNION = 312
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
@@ -115,56 +114,56 @@
|
||||
#define PERCENT_PREC 269
|
||||
#define PERCENT_DPREC 270
|
||||
#define PERCENT_MERGE 271
|
||||
#define PERCENT_AFTER_HEADER 272
|
||||
#define PERCENT_BEFORE_HEADER 273
|
||||
#define PERCENT_DEBUG 274
|
||||
#define PERCENT_DEFAULT_PREC 275
|
||||
#define PERCENT_DEFINE 276
|
||||
#define PERCENT_DEFINES 277
|
||||
#define PERCENT_END_HEADER 278
|
||||
#define PERCENT_ERROR_VERBOSE 279
|
||||
#define PERCENT_EXPECT 280
|
||||
#define PERCENT_EXPECT_RR 281
|
||||
#define PERCENT_FILE_PREFIX 282
|
||||
#define PERCENT_GLR_PARSER 283
|
||||
#define PERCENT_INITIAL_ACTION 284
|
||||
#define PERCENT_LEX_PARAM 285
|
||||
#define PERCENT_LOCATIONS 286
|
||||
#define PERCENT_NAME_PREFIX 287
|
||||
#define PERCENT_NO_DEFAULT_PREC 288
|
||||
#define PERCENT_NO_LINES 289
|
||||
#define PERCENT_NONDETERMINISTIC_PARSER 290
|
||||
#define PERCENT_OUTPUT 291
|
||||
#define PERCENT_PARSE_PARAM 292
|
||||
#define PERCENT_PURE_PARSER 293
|
||||
#define PERCENT_PUSH_PARSER 294
|
||||
#define PERCENT_REQUIRE 295
|
||||
#define PERCENT_CODE 272
|
||||
#define PERCENT_DEBUG 273
|
||||
#define PERCENT_DEFAULT_PREC 274
|
||||
#define PERCENT_DEFINE 275
|
||||
#define PERCENT_DEFINES 276
|
||||
#define PERCENT_ERROR_VERBOSE 277
|
||||
#define PERCENT_EXPECT 278
|
||||
#define PERCENT_EXPECT_RR 279
|
||||
#define PERCENT_FILE_PREFIX 280
|
||||
#define PERCENT_GLR_PARSER 281
|
||||
#define PERCENT_INITIAL_ACTION 282
|
||||
#define PERCENT_LEX_PARAM 283
|
||||
#define PERCENT_LOCATIONS 284
|
||||
#define PERCENT_NAME_PREFIX 285
|
||||
#define PERCENT_NO_DEFAULT_PREC 286
|
||||
#define PERCENT_NO_LINES 287
|
||||
#define PERCENT_NONDETERMINISTIC_PARSER 288
|
||||
#define PERCENT_OUTPUT 289
|
||||
#define PERCENT_PARSE_PARAM 290
|
||||
#define PERCENT_PROVIDES 291
|
||||
#define PERCENT_PURE_PARSER 292
|
||||
#define PERCENT_PUSH_PARSER 293
|
||||
#define PERCENT_REQUIRE 294
|
||||
#define PERCENT_REQUIRES 295
|
||||
#define PERCENT_SKELETON 296
|
||||
#define PERCENT_START 297
|
||||
#define PERCENT_START_HEADER 298
|
||||
#define PERCENT_TOKEN_TABLE 299
|
||||
#define PERCENT_VERBOSE 300
|
||||
#define PERCENT_YACC 301
|
||||
#define BRACED_CODE 302
|
||||
#define CHAR 303
|
||||
#define EPILOGUE 304
|
||||
#define EQUAL 305
|
||||
#define ID 306
|
||||
#define ID_COLON 307
|
||||
#define PERCENT_PERCENT 308
|
||||
#define PIPE 309
|
||||
#define PROLOGUE 310
|
||||
#define SEMICOLON 311
|
||||
#define TYPE 312
|
||||
#define PERCENT_UNION 313
|
||||
#define PERCENT_TOKEN_TABLE 298
|
||||
#define PERCENT_VERBOSE 299
|
||||
#define PERCENT_YACC 300
|
||||
#define BRACED_CODE 301
|
||||
#define CHAR 302
|
||||
#define EPILOGUE 303
|
||||
#define EQUAL 304
|
||||
#define ID 305
|
||||
#define ID_COLON 306
|
||||
#define PERCENT_PERCENT 307
|
||||
#define PIPE 308
|
||||
#define PROLOGUE 309
|
||||
#define SEMICOLON 310
|
||||
#define TYPE 311
|
||||
#define PERCENT_UNION 312
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{/* Line 1535 of yacc.c. */
|
||||
#line 98 "parse-gram.y"
|
||||
{
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 98 "../../src/parse-gram.y"
|
||||
|
||||
symbol *symbol;
|
||||
symbol_list *list;
|
||||
@@ -174,8 +173,9 @@ typedef union YYSTYPE
|
||||
uniqstr uniqstr;
|
||||
unsigned char character;
|
||||
}
|
||||
/* Line 1535 of yacc.c. */
|
||||
#line 179 "parse-gram.h"
|
||||
|
||||
/* Line 1535 of yacc.c */
|
||||
#line 179 "../../src/parse-gram.h"
|
||||
YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
|
||||
@@ -133,13 +133,11 @@ static int current_prec = 0;
|
||||
`----------------------*/
|
||||
|
||||
%token
|
||||
PERCENT_AFTER_HEADER "%after-header"
|
||||
PERCENT_BEFORE_HEADER "%before-header"
|
||||
PERCENT_CODE "%code"
|
||||
PERCENT_DEBUG "%debug"
|
||||
PERCENT_DEFAULT_PREC "%default-prec"
|
||||
PERCENT_DEFINE "%define"
|
||||
PERCENT_DEFINES "%defines"
|
||||
PERCENT_END_HEADER "%end-header"
|
||||
PERCENT_ERROR_VERBOSE "%error-verbose"
|
||||
PERCENT_EXPECT "%expect"
|
||||
PERCENT_EXPECT_RR "%expect-rr"
|
||||
@@ -155,12 +153,13 @@ static int current_prec = 0;
|
||||
"%nondeterministic-parser"
|
||||
PERCENT_OUTPUT "%output"
|
||||
PERCENT_PARSE_PARAM "%parse-param"
|
||||
PERCENT_PROVIDES "%provides"
|
||||
PERCENT_PURE_PARSER "%pure-parser"
|
||||
PERCENT_PUSH_PARSER "%push-parser"
|
||||
PERCENT_REQUIRE "%require"
|
||||
PERCENT_REQUIRES "%requires"
|
||||
PERCENT_SKELETON "%skeleton"
|
||||
PERCENT_START "%start"
|
||||
PERCENT_START_HEADER "%start-header"
|
||||
PERCENT_TOKEN_TABLE "%token-table"
|
||||
PERCENT_VERBOSE "%verbose"
|
||||
PERCENT_YACC "%yacc"
|
||||
@@ -222,12 +221,10 @@ prologue_declarations:
|
||||
prologue_declaration:
|
||||
grammar_declaration
|
||||
| "%{...%}" { prologue_augment (translate_code ($1, @1), @1, union_seen); }
|
||||
| "%after-header" braceless { prologue_augment ($2, @2, true); }
|
||||
| "%before-header" braceless { prologue_augment ($2, @2, false); }
|
||||
| "%code" braceless { prologue_augment ($2, @2, true); }
|
||||
| "%debug" { debug_flag = true; }
|
||||
| "%define" STRING content.opt { muscle_insert ($2, $3); }
|
||||
| "%defines" { defines_flag = true; }
|
||||
| "%end-header" braceless { muscle_code_grow ("end_header", $2, @2); }
|
||||
| "%error-verbose" { error_verbose = true; }
|
||||
| "%expect" INT { expected_sr_conflicts = $2; }
|
||||
| "%expect-rr" INT { expected_rr_conflicts = $2; }
|
||||
@@ -248,11 +245,12 @@ prologue_declaration:
|
||||
| "%nondeterministic-parser" { nondeterministic_parser = true; }
|
||||
| "%output" "=" STRING { spec_outfile = $3; }
|
||||
| "%parse-param" "{...}" { add_param ("parse_param", $2, @2); }
|
||||
| "%provides" braceless { muscle_code_grow ("provides", $2, @2); }
|
||||
| "%pure-parser" { pure_parser = true; }
|
||||
| "%push-parser" { push_parser = true; }
|
||||
| "%require" STRING { version_check (&@2, $2); }
|
||||
| "%requires" braceless { muscle_code_grow ("requires", $2, @2); }
|
||||
| "%skeleton" STRING { skeleton = $2; }
|
||||
| "%start-header" braceless { muscle_code_grow ("start_header", $2, @2); }
|
||||
| "%token-table" { token_table_flag = true; }
|
||||
| "%verbose" { report_flag = report_states; }
|
||||
| "%yacc" { yacc_flag = true; }
|
||||
|
||||
@@ -156,16 +156,14 @@ splice (\\[ \f\t\v]*\n)*
|
||||
`----------------------------*/
|
||||
<INITIAL>
|
||||
{
|
||||
"%after-header" return PERCENT_AFTER_HEADER;
|
||||
"%before-header" return PERCENT_BEFORE_HEADER;
|
||||
"%binary" return PERCENT_NONASSOC;
|
||||
"%code" return PERCENT_CODE;
|
||||
"%debug" return PERCENT_DEBUG;
|
||||
"%default"[-_]"prec" return PERCENT_DEFAULT_PREC;
|
||||
"%define" return PERCENT_DEFINE;
|
||||
"%defines" return PERCENT_DEFINES;
|
||||
"%destructor" return PERCENT_DESTRUCTOR;
|
||||
"%dprec" return PERCENT_DPREC;
|
||||
"%end-header" return PERCENT_END_HEADER;
|
||||
"%error"[-_]"verbose" return PERCENT_ERROR_VERBOSE;
|
||||
"%expect" return PERCENT_EXPECT;
|
||||
"%expect"[-_]"rr" return PERCENT_EXPECT_RR;
|
||||
@@ -187,13 +185,14 @@ splice (\\[ \f\t\v]*\n)*
|
||||
"%parse-param" return PERCENT_PARSE_PARAM;
|
||||
"%prec" return PERCENT_PREC;
|
||||
"%printer" return PERCENT_PRINTER;
|
||||
"%provides" return PERCENT_PROVIDES;
|
||||
"%pure"[-_]"parser" return PERCENT_PURE_PARSER;
|
||||
"%push"[-_]"parser" return PERCENT_PUSH_PARSER;
|
||||
"%require" return PERCENT_REQUIRE;
|
||||
"%requires" return PERCENT_REQUIRES;
|
||||
"%right" return PERCENT_RIGHT;
|
||||
"%skeleton" return PERCENT_SKELETON;
|
||||
"%start" return PERCENT_START;
|
||||
"%start-header" return PERCENT_START_HEADER;
|
||||
"%symbol-default" return PERCENT_SYMBOL_DEFAULT;
|
||||
"%term" return PERCENT_TOKEN;
|
||||
"%token" return PERCENT_TOKEN;
|
||||
|
||||
Reference in New Issue
Block a user