mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
* data/Makefile.am (dist_pkgdata_DATA): Add push.c.
* data/c.m4 (YYPUSH): New. (b4_push_if): New macro. Use it instead of #ifdef YYPUSH. * src/getargs.c (push_parser): New var. * src/getargs.h (push_parser): New declaration. * src/output.c (prepare): Add macro insertion of `push_flag'. * src/parse-gram.y (PERCENT_PUSH_PARSER): New token. (prologue_declaration): Parse %push-parser. * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token. * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to list of removed lines from the traces observed. (AT_CHECK_CALC_LALR): Added push parser tests.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
## Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2002, 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
|
||||
@@ -16,7 +16,7 @@
|
||||
## 02110-1301 USA
|
||||
|
||||
dist_pkgdata_DATA = README \
|
||||
c.m4 yacc.c glr.c \
|
||||
c.m4 yacc.c glr.c push.c \
|
||||
c++.m4 location.cc lalr1.cc glr.cc
|
||||
|
||||
m4sugardir = $(pkgdatadir)/m4sugar
|
||||
|
||||
12
data/c.m4
12
data/c.m4
@@ -76,6 +76,9 @@ m4_define([b4_identification],
|
||||
/* Pure parsers. */
|
||||
[#]define YYPURE b4_pure_flag
|
||||
|
||||
/* Push parsers. */
|
||||
[#]define YYPUSH b4_push_flag
|
||||
|
||||
/* Using locations. */
|
||||
[#]define YYLSP_NEEDED b4_locations_flag
|
||||
])
|
||||
@@ -225,6 +228,15 @@ b4_define_flag_if([pure]) # Whether the interface is pure.
|
||||
b4_define_flag_if([yacc]) # Whether POSIX Yacc is emulated.
|
||||
|
||||
|
||||
# b4_push_if(IF-TRUE, IF-FALSE)
|
||||
# -----------------------------
|
||||
# Expand IF-TRUE, if %push-parser, IF-FALSE otherwise.
|
||||
m4_define([b4_push_if],
|
||||
[m4_if(b4_push_flag, [1],
|
||||
[$1],
|
||||
[$2])])
|
||||
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
## Assigning token numbers. ##
|
||||
|
||||
1799
data/push.c
Normal file
1799
data/push.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user