prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \
prohibit_magic_number_exit=^doc/bison.texi$$ \
prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \
+ prohibit_strcmp=^doc/bison\.texi$$ \
require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \
space_tab=^tests/(input|c\+\+)\.at$$ \
- unmarked_diagnostics=^(djgpp/|doc/bison.texi$$) \
- trailing_blank=^src/parse-gram.[ch]$$ \
+ unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \
)
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([[-o glr-regr1.c glr-regr1.y]], 0, [],
-[glr-regr1.y: conflicts: 1 shift/reduce
-])
+[[glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
+]])
AT_COMPILE([glr-regr1])
- AT_PARSER_CHECK([[echo BPBPB | ./glr-regr1]], 0,
+ AT_PARSER_CHECK([[./glr-regr1 BPBPB]], 0,
[[E -> 'B'
E -> 'B'
E -> E 'P' E
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([[-o glr-regr2a.c glr-regr2a.y]], 0, [],
-[glr-regr2a.y: conflicts: 2 shift/reduce
-])
+[[glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
+]])
AT_COMPILE([glr-regr2a])
- AT_PARSER_CHECK([[echo s VARIABLE_1 t v x q | ./glr-regr2a]], 0,
+ AT_DATA([input1.txt],
+ [[s VARIABLE_1 t v x q
+ ]])
+ AT_PARSER_CHECK([[./glr-regr2a input1.txt]], 0,
[[Variable: 'VARIABLE_1'
- ]], [])
- AT_PARSER_CHECK([[echo s VARIABLE_1 , ANOTHER_VARIABLE_2 t e | ./glr-regr2a]],
+ ]])
+
+ AT_DATA([input2.txt],
+ [[s VARIABLE_1 , ANOTHER_VARIABLE_2 t e
+ ]])
+ AT_PARSER_CHECK([[./glr-regr2a input2.txt]],
0,
[[Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2'
]])
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([[-o glr-regr3.c glr-regr3.y]], 0, [],
-[glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce
-])
+[[glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
+glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
+]])
AT_COMPILE([glr-regr3])
- AT_PARSER_CHECK([[echo p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 | ./glr-regr3]],
+ AT_DATA([input.txt],
+ [[p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2
+ ]])
+ AT_PARSER_CHECK([[./glr-regr3 input.txt]],
0,
[[Result: 1c04
- ]], [])
+ ]])
AT_CLEANUP
AT_TEST([x8], [%define api.pure %define api.push-pull both])
#AT_TEST([x5], [%locations %language "c++" %glr-parser])
-# Ignore comments, YYPARSE_PARAM (obsolete), YYPUSH_MORE(_DEFINED)?
-# (constant definition), YY_\w+_INCLUDED (header guards).
+ # Check there is no 'yy' left.
+ # C++ output relies on namespaces and still uses yy a lot.
+ #
+ # Check there is no 'YY' left.
- s{\b(YYPARSE_PARAM
- |YYPUSH_MORE(_DEFINED)?
++# Ignore comments, YYPUSH_MORE(_DEFINED)? (constant definition),
++# YY_\w+_INCLUDED (header guards).
+ #
+ # YYDEBUG (not renamed) can be read, but not changed.
+ AT_CHECK([[$PERL -n -0777 -e '
+ s{/\*.*?\*/}{}gs;
+ s{//.*}{}g;
++ s{\b(YYPUSH_MORE(_DEFINED)?
+ |YY_\w+_INCLUDED
+ |YY_NULL
+ |(defined|if)\ YYDEBUG
+ )\b}{}gx;
+ while (/^(.*YY.*)$/gm)
+ {
+ print "$ARGV: $1\n";
+ }
+ if ($ARGV =~ /\.h$/)
+ {
+ while (/^(.*yy.*)$/gm)
+ {
+ print "$ARGV: $1\n";
+ }
+ }
+ ' -- *.hh *.h]])
+
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h *.hh