summaryrefslogtreecommitdiff
path: root/data/c.m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-09-15 15:56:26 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-09-15 15:56:26 +0000
commit31c10e38dbf21a29af558c6f5144acd22dbc956e (patch)
treed9509b836ffef19ffc46216d124eb012c43e86d3 /data/c.m4
parent21fe08cadcb84fddd5038ac6857a904dbe1ad885 (diff)
downloadbison-31c10e38dbf21a29af558c6f5144acd22dbc956e.tar.gz
* 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.
Diffstat (limited to 'data/c.m4')
-rw-r--r--data/c.m412
1 files changed, 12 insertions, 0 deletions
diff --git a/data/c.m4 b/data/c.m4
index ffb04c20..97c80d3d 100644
--- a/data/c.m4
+++ b/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. ##