summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny@ces.clemson.edu>2006-12-02 01:52:16 +0000
committerJoel E. Denny <jdenny@ces.clemson.edu>2006-12-02 01:52:16 +0000
commit02975b9aade52df362645b82a81ac2134290e221 (patch)
treeaedcf479fe41b54bce0f8e41b14970aec27d467a /tests
parent287b314eefdbf95b888f5f13f19bb6f472285b6d (diff)
downloadbison-02975b9aade52df362645b82a81ac2134290e221.tar.gz
Support a file name argument to %defines. Deprecate `=' in
%file-prefix, %name-prefix, and %output. Discussed at <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>. * NEWS (2.3a+): Mention. * doc/bison.texinfo (Decl Summary, Bison Symbols): Add entry for new form of %defines, and remove `=' from entries for %file-prefix, %name-prefix, and %output. * src/parse-gram.y (prologue_declaration): Implement. * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from all but one occurrence of %name-prefix. * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix. * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise. * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one occurrence of each of %file-prefix and %output. Add check for %defines with argument. * tests/reduce.at (Useless Terminals, Useless Nonterminals, Useless Rules, Reduced Automaton, Underivable Rules, Empty Language): Remove the `=' from %output.
Diffstat (limited to 'tests')
-rw-r--r--tests/calc.at38
-rw-r--r--tests/headers.at2
-rw-r--r--tests/local.at4
-rw-r--r--tests/output.at10
-rw-r--r--tests/reduce.at14
5 files changed, 36 insertions, 32 deletions
diff --git a/tests/calc.at b/tests/calc.at
index 2cc68031..694327e5 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -556,7 +556,7 @@ AT_CHECK_CALC_LALR()
AT_CHECK_CALC_LALR([%defines])
AT_CHECK_CALC_LALR([%locations])
-AT_CHECK_CALC_LALR([%name-prefix="calc"])
+AT_CHECK_CALC_LALR([%name-prefix="calc"]) dnl test deprecated `='
AT_CHECK_CALC_LALR([%verbose])
AT_CHECK_CALC_LALR([%yacc])
AT_CHECK_CALC_LALR([%error-verbose])
@@ -565,15 +565,15 @@ AT_CHECK_CALC_LALR([%pure-parser %locations])
AT_CHECK_CALC_LALR([%push-parser %locations])
AT_CHECK_CALC_LALR([%error-verbose %locations])
-AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR([%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_LALR([%debug])
-AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
-AT_CHECK_CALC_LALR([%push-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
+AT_CHECK_CALC_LALR([%push-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
+AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
# ----------------------- #
@@ -594,7 +594,7 @@ AT_CHECK_CALC_GLR()
AT_CHECK_CALC_GLR([%defines])
AT_CHECK_CALC_GLR([%locations])
-AT_CHECK_CALC_GLR([%name-prefix="calc"])
+AT_CHECK_CALC_GLR([%name-prefix "calc"])
AT_CHECK_CALC_GLR([%verbose])
AT_CHECK_CALC_GLR([%yacc])
AT_CHECK_CALC_GLR([%error-verbose])
@@ -602,14 +602,14 @@ AT_CHECK_CALC_GLR([%error-verbose])
AT_CHECK_CALC_GLR([%pure-parser %locations])
AT_CHECK_CALC_GLR([%error-verbose %locations])
-AT_CHECK_CALC_GLR([%error-verbose %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR([%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_GLR([%debug])
-AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
+AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
# ----------------------------- #
@@ -626,13 +626,13 @@ m4_define([AT_CHECK_CALC_LALR1_CC],
[AT_CHECK_CALC([%skeleton "lalr1.cc" %defines %locations] $@)])
AT_CHECK_CALC_LALR1_CC([])
-AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR1_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR1_CC([%error-verbose %debug %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR1_CC([%error-verbose %debug %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
+AT_CHECK_CALC_LALR1_CC([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
@@ -650,11 +650,11 @@ m4_define([AT_CHECK_CALC_GLR_CC],
[AT_CHECK_CALC([%skeleton "glr.cc" %defines %locations] $@)])
AT_CHECK_CALC_GLR_CC([])
-AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([%error-verbose %name-prefix "calc" %verbose %yacc])
AT_CHECK_CALC_GLR_CC([%debug])
-AT_CHECK_CALC_GLR_CC([%error-verbose %debug %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([%error-verbose %debug %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc])
+AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc])
-AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
+AT_CHECK_CALC_GLR_CC([%pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
diff --git a/tests/headers.at b/tests/headers.at
index a348d65b..4168531c 100644
--- a/tests/headers.at
+++ b/tests/headers.at
@@ -89,7 +89,7 @@ AT_SETUP([export YYLTYPE])
AT_DATA_GRAMMAR([input.y],
[%locations
-%name-prefix="my_"
+%name-prefix "my_"
%{
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/local.at b/tests/local.at
index b9cace01..150602e9 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -64,8 +64,8 @@ m4_pushdef([AT_PURE_AND_LOC_IF],
m4_pushdef([AT_GLR_OR_PARAM_IF],
[m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
m4_pushdef([AT_NAME_PREFIX],
-[m4_bmatch([$3], [%name-prefix=".*"],
- [m4_bregexp([$3], [name-prefix="\([^"]*\)"], [\1])],
+[m4_bmatch([$3], [%name-prefix ".*"],
+ [m4_bregexp([$3], [name-prefix "\([^"]*\)"], [\1])],
[yy])])
# yyerror receives the location if %location & %pure & (%glr or %parse-param).
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
diff --git a/tests/output.at b/tests/output.at
index ec02c1de..468aa5fd 100644
--- a/tests/output.at
+++ b/tests/output.at
@@ -64,13 +64,13 @@ AT_CHECK_OUTPUT([foo.y], [%defines %verbose %yacc],[],
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose %yacc],[],
[y.output y.tab.c y.tab.h])
-# Exercise %output and %file-prefix
-AT_CHECK_OUTPUT([foo.y], [%file-prefix="bar" %defines %verbose], [],
+# Exercise %output and %file-prefix including deprecated `='
+AT_CHECK_OUTPUT([foo.y], [%file-prefix "bar" %defines %verbose], [],
[bar.output bar.tab.c bar.tab.h])
AT_CHECK_OUTPUT([foo.y], [%output="bar.c" %defines %verbose %yacc],[],
[bar.output bar.c bar.h])
AT_CHECK_OUTPUT([foo.y],
- [%file-prefix="baz" %output="bar.c" %defines %verbose %yacc],
+ [%file-prefix="baz" %output "bar.c" %defines %verbose %yacc],
[],
[bar.output bar.c bar.h])
@@ -86,6 +86,10 @@ AT_CHECK_OUTPUT([foo.yy], [],
[--defines=foo.hpp -o foo.c++],
[foo.c++ foo.hpp])
+AT_CHECK_OUTPUT([foo.yy], [%defines "foo.hpp"],
+ [-o foo.c++],
+ [foo.c++ foo.hpp])
+
AT_CHECK_OUTPUT([foo.yy], [],
[-o foo.c++ --graph=foo.gph],
[foo.c++ foo.gph])
diff --git a/tests/reduce.at b/tests/reduce.at
index 90b0130e..e082baab 100644
--- a/tests/reduce.at
+++ b/tests/reduce.at
@@ -27,7 +27,7 @@ AT_SETUP([Useless Terminals])
AT_DATA([[input.y]],
[[%verbose
-%output="input.c"
+%output "input.c"
%token useless1
%token useless2
@@ -71,7 +71,7 @@ AT_SETUP([Useless Nonterminals])
AT_DATA([[input.y]],
[[%verbose
-%output="input.c"
+%output "input.c"
%nterm useless1
%nterm useless2
@@ -128,7 +128,7 @@ AT_KEYWORDS([report])
AT_DATA([[input.y]],
[[%verbose
-%output="input.c"
+%output "input.c"
%token useful
%%
exp: useful;
@@ -221,7 +221,7 @@ AT_DATA([[not-reduced.y]],
/* A useful one. */
%token useful
%verbose
-%output="not-reduced.c"
+%output "not-reduced.c"
%%
@@ -267,7 +267,7 @@ AT_DATA([[reduced.y]],
/* A useful one. */
%token useful
%verbose
-%output="reduced.c"
+%output "reduced.c"
%%
@@ -304,7 +304,7 @@ AT_KEYWORDS([report])
AT_DATA([[input.y]],
[[%verbose
-%output="input.c"
+%output "input.c"
%token useful
%%
exp: useful | underivable;
@@ -342,7 +342,7 @@ AT_CLEANUP
AT_SETUP([Empty Language])
AT_DATA([[input.y]],
-[[%output="input.c"
+[[%output "input.c"
%%
exp: exp;
]])