summaryrefslogtreecommitdiff
path: root/tests/existing.at
Commit message (Collapse)AuthorAgeFilesLines
...
* | %define lr.type: make values lowercase IDs.Joel E. Denny2009-08-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | That is, "LALR" => "lalr", "IELR" => "ielr", and "canonical LR" => "canonical-lr". * NEWS (2.5): Update documentation. * doc/bison.texinfo (Decl Summary): Likewise. * src/ielr.c (ielr): Use new values. * src/ielr.h (ielr): Update documentation. * src/reader.c (prepare_percent_define_front_end_variables): Use and validate new values. * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test grammars. * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
* | Some M4 cleanup in the testsuite.Joel E. Denny2009-07-221-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Eric Blake at <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>. * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not complicate the code by distinguishing between a missing value and an empty string value for an optional argument. This fix is allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below. * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into... (AT_TEST_TABLES_AND_PARSE): ... this now that the special arguments are not needed because of the following changes. Fix stale comments. Bison developers should use GNU M4 and should not use POSIXLY_CORRECT when building the test suite, so do not complicate the code by avoiding $10 and above. Do not quote an empty string value for an optional argument, and do not distinguish between a missing value and an empty string value. (cherry picked from commit cba975069a746bccdd2f2a954954ac7e43a47ac2)
* | Finish implementing %define lr.type.Joel E. Denny2009-04-211-60/+1659
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its value can be "LALR", "IELR", or "canonical LR". * lib/timevar.def (TV_IELR_PHASE1): New var. (TV_IELR_PHASE2): New var. (TV_IELR_PHASE3): New var. (TV_IELR_PHASE4): New var. * src/local.mk (src_bison_SOURCES): Add AnnotationList.c, AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c, Sbitset.h, ielr.c, and ielr.h. * src/getargs.h, src/getargs.c (enum trace, trace_args, trace_types): Add trace_ielr. * src/lalr.h, src/lalr.c (ngotos): Export it. (F): Rename to... (goto_follows): ... this, update all uses, and export it. (set_goto_map): Export it. (map_goto): Export it. (compute_lookahead_tokens): Don't free goto_follows yet. Now handled in ielr. (initialize_LA): Export it. Move lookback allocation to... (lalr): ... here because, for canonical LR, initialize_LA must be invoked but lookback and much of the rest of LALR isn't needed. * main.c (main): Instead of lalr, invoke ielr, which invokes lalr. * src/reader.c (reader): Default lr.type to "LALR". Default lr.default_rules to "accepting" if lr.type is "canonical LR". Leave the default as "all" otherwise. Check for a valid lr.type value. * src/state.h, src/state.c (struct state_list): Add state_list member. (state_new): Initialize state_list member to NULL. (state_new_isocore): New function, exported. * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that exercises all values of lr.type. (GNU AWK Grammar): Rename test group to... (GNU AWK 3.1.0 Grammar): ... this, and extend to use AT_TEST_EXISTING_GRAMMAR. (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR. (GNU pic Grammar): Rename test group to... (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use AT_TEST_EXISTING_GRAMMAR. * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises all values of lr.type. (Single State Split): New test groups using AT_TEST_LR_TYPE. (Lane Split): Likewise. (Complex Lane Split): Likewise. (Split During Added Lookahead Propagation): Likewise.
* Automate regression testing of the XML/XSLT implementation. DiscussedJoel E. Denny2007-12-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | starting at <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>. * configure.ac (XSLTPROC): New substitution. * Makefile.am (maintainer-xml-check): New phony target invoking... * tests/Makefile.am (maintainer-xml-check): ... this new phony target invoking make maintainer-check with BISON_TEST_XML=1. * tests/atlocal.in (XSLTPROC): New. * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind not to report reachable memory when Bison is expected to have a non-zero exit status and (2) to compare XML/XSLT output with --graph and --report=all output for every working grammar when BISON_TEST_XML=1. (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks. (AT_BISON_CHECK_XML): New. (AT_QUELL_VALGRIND): New. * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and... (AT_CHECK): ... don't redefine this since this was the old way to quell Valgrind. * tests/actions.at: Rewrite all AT_CHECK invocations for bison as AT_BISON_CHECK invocations. * tests/c++.at: Likewise. * tests/calc.at: Likewise. * tests/conflicts.at: Likewise. * tests/cxx-type.at: Likewise. * tests/existing.at: Likewise. * tests/glr-regression.at: Likewise. * tests/headers.at: Likewise. * tests/input.at: Likewise. * tests/java.at: Likewise. * tests/output.at: Likewise. * tests/push.at: Likewise. * tests/reduce.at: Likewise. * tests/regression.at: Likewise. * tests/sets.at: Likewise. * tests/skeletons.at: Likewise. * tests/synclines.at: Likewise. * tests/torture.at: Likewise. (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar tends to hang xsltproc. (Big horizontal): Likewise.
* In XML output, remove redundant class attribute on symbol element.Joel E. Denny2007-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New. * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to look up a symbol to determine whether it's a nonterminal or terminal. * src/gram.c (rule_rhs_print_xml): Remove class attribute. * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise. Add prec/assoc information to XML output. * src/gram.c (grammar_rules_print_xml): For each rule that has a %prec, add a percent_prec attribute. * src/print-xml.c (print_grammar): For each terminal that has a precedence or associativity, add a prec or assoc attribute. (xml_indent): New. (xml_puts): Use xml_indent. (xml_printf): Use xml_indent. * src/print-xml.h (xml_indent): Prototype. * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
* * src/gram.c: Remove comments that duplicate comments in gram.h.Joel E. Denny2007-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reporting useless rules and nonterminals, say "useless in grammar" instead of "useless", and say "useless in parser" instead of "never reduced". Discussed starting at <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>. * NEWS (2.3a+): Mention this change. * data/xslt/xml2text.xsl: Update output text and expected input XML element names to match changes below. * data/xslt/xml2xhtml.xsl: Likewise. (xsl:template match="bison-xml-report"): Add missing entry in Table of Contents: "Rules useless in parser due to conflicts". * doc/bison.texinfo (Decl Summary): Reword a little. (Understanding): Update example output for changes below. * src/gram.c: (rule_useful_p): Rename to... (rule_useful_in_grammar_p): ... this. (rule_useless_p): Rename to... (rule_useless_in_grammar_p): ... this. (rule_never_reduced_p): Rename to... (rule_useless_in_parser_p): ... this. (grammar_rules_print): Update for renames. (grammar_rules_print_xml): Update for renames. (grammar_rules_never_reduced_report): Rename to... (grammar_rules_useless_report): ... this since it is used for either kind of useless rule. * src/gram.h: Reword comments and update function names in prototypes. * src/main.c (main): Say "rule useless in parser due to conflicts". * src/print-xml.c (print_rules_never_reduced): Rename to... (print_rules_useless_in_parser): ... this, and rename output XML element "rules-never-reduced" to "rules-useless-in-parser". (print_xml): Update for rename. * src/print.c (print_results): Say "Rules useless in parser due to conflicts". * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar". (nonterminals_reduce): Say "nonterminal useless in grammar". (reduce_output): Say "Nonterminals useless in grammar". Say "Rules useless in grammar". (reduce_xml): Rename output XML element "useless" to "useless-in-grammar". (reduce_print): Don't report the count of grammatically useless rules as "rules never reduced" just because %yacc is specified. In the correct report of this count, say nonterminal(s) and rule(s) "useless in grammar". * tests/conflicts.at (S/R in initial): Update expected output. (Defaulted Conflicted Reduction): Likewise. (Unreachable States After Conflict Resolution): Likewise. * tests/existing.at (GNU pic Grammar): Likewise. * tests/reduce.at (Useless Nonterminals): Likewise. (Useless Rules): Likewise. (Reduced Automaton): Likewise. (Underivable Rules): Likewise. (Empty Language): Likewise.
* Update to GPLv3.Paul Eggert2007-08-151-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/gpl-3.0.texi: New file. * doc/gpl.texi: Remove. * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg: * Makefile.maint, NEWS, PACKAGING, README, README-alpha: * README-hacking, TODO, bootstrap, bootstrap.conf: * configure.ac, data/Makefile.am, data/README, data/bison.m4: * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4: * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4: * data/lalr1.cc, data/lalr1.java, data/location.cc: * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4: * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat: * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed: * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h: * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo: * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README: * etc/bench.pl.in, examples/Makefile.am, examples/extexi: * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c: * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h: * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c: * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h: * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c: * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h: * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h: * lib/timevar.c, lib/timevar.def, lib/timevar.h: * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c: * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4: * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am: * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h: * src/complain.c, src/complain.h, src/conflicts.c: * src/conflicts.h, src/derives.c, src/derives.h, src/files.c: * src/files.h, src/flex-scanner.h, src/getargs.c: * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c: * src/lalr.c, src/lalr.h, src/location.c, src/location.h: * src/main.c, src/muscle_tab.c, src/muscle_tab.h: * src/nullable.c, src/nullable.h, src/output.c, src/output.h: * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y: * src/print.c, src/print.h, src/print_graph.c: * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c: * src/reduce.h, src/relation.c, src/relation.h: * src/revision.h, src/scan-code.h, src/scan-code.l: * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h: * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c: * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h: * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h: * tests/Makefile.am, tests/actions.at, tests/c++.at: * tests/calc.at, tests/conflicts.at, tests/cxx-type.at: * tests/existing.at, tests/glr-regression.at: * tests/headers.at, tests/input.at, tests/java.at: * tests/local.at, tests/output.at, tests/push.at: * tests/reduce.at, tests/regression.at, tests/sets.at: * tests/skeletons.at, tests/synclines.at, tests/testsuite.at: * tests/torture.at: Update to GPLv3.
* * NEWS (2.3a+): Mention yesterday's state-removal change.Joel E. Denny2007-05-081-2/+2
| | | | | | | | (2.3a): Remove the %language entry, which was added after 2.3a. * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c, src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c, src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at, tests/existing.at: Update copyright date.
* If conflict resolution makes states unreachable, remove those states,Joel E. Denny2007-05-071-1/+3
| | | | | | | | | | | | | | | | | | | | | report rules that are then unused, and don't report conflicts in those states. * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers): New global function. * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global function. * src/main.c (main): After conflict resolution, remove the unreachable states and update all data structures that reference states by number. * src/state.c (state_new): Initialize each state's reachable member to false. (state_mark_reachable_states): New static function. (state_remove_unreachable_states): New global function. * src/state.h (struct state): Add member bool reachable. (state_remove_unreachable_states): Prototype. * tests/conflicts.at (Unreachable States After Conflict Resolution): New test case. * tests/existing.at (GNU pic Grammar): Update test case output now that an unused rule is discovered.
* Fix white space glitches.Paul Eggert2006-01-221-349/+349
|
* Warn about unused values.Akim Demaille2005-12-221-1432/+204
| | | | | | | | | | | | | | | | | | | | | * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add a `used' member. (symbol_list_n_get, symbol_list_n_used_set): New. (symbol_list_n_type_name_get): Use symbol_list_n_get. * src/scan-gram.l (handle_action_dollar): Flag used symbols. * src/reader.c (grammar_current_rule_check): Check that values are used. * src/symtab.c (symbol_print): Accept 0. * tests/existing.at: Remove the type information. Empty the actions. Remove useless actions (beware of mid-rule actions: perl -000 -pi -e 's/s*{}(?=[ns]*[|;])//g'). * tests/actions.at (Exotic Dollars): Use unused values. * tests/calc.at: Likewise. * tests/glr-regression.at (No users destructors if stack 0 deleted): Likewise. * src/gram.c (rule_useful_p, rule_never_reduced_p): Use rule_useful_p.
* * NEWS: Version 2.0b.Paul Eggert2005-07-241-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on the user's name space. All uses changed to __attribute__ ((__unused__)). (yyFail, yyMemoryExhausted, yyreportAmbiguity): Add __attribute__ ((__noreturn__)). * etc/clcommit: Remove. We weren't using it, and it failed "make maintainer-distcheck". * Makefile.maint: Merge from coreutils. (CVS_LIST, CVS_LIST_EXCEPT): New macros. (syntax-check-rules): Change list of rules as described below. (sc_cast_of_alloca_return_value, sc_dd_max_sym_length): (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof): (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope): (sc_trailing_space): New rules. (sc_xalloc_h_in_src): Remove. (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value): (sc_space_tab, sc_error_exit_success, sc_changelog): (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics): (makefile-check, po-check, author_mark_check): (makefile_path_separator_check, copyright-check): Use grep -n, to make it easier to find violations. Use CVS_LIST and CVS_LIST_EXCEPT. (header_regexp, h_re): Remove. (dd_c): New macro. (sc_dd_max_sym_length, .re-list, news-date-check): New rules. (my-distcheck): Use more-modern GCC flags. (signatures, %.asc): Remove. (rel-files, announcement): Remove signatures. Restore old updating code, even though we don't use it, so that we're the same as coreutils. (alpha, beta, major): Depend on news-date-check. Make the upload commands. * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space. * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise. * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise. * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise. * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise. * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise. * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise. * tests/sets.at: Likewise. * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that we comment out the Autoconf version number. * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as it's error-prone and "make maintainer-distcheck" rejects it. * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H. Indent calls to "error" to pacify "make maintainer-distcheck", when the calls are not intended to be translated. * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h. * src/Makefile.am (DEFS): Use +=, to pacify "make maintainer-distcheck". (bison_SOURCES): Add scan-skel.h. (sc_tight_scope): New rule, from coreutils. * src/files.c (src_extension, header_extension): Now static, not extern. * src/getargs.c (short_options): Likewise. * src/muscle_tab.c (muscle_table): Likewise. * src/parse-gram.y (current_class, current_type, current_prec): Likewise. * src/reader.c (grammar_end, previous_rule_end): Likewise. * src/getargs.h: Redo comments to pacify "make maintainer-distcheck". * src/main.c (main): Cast bindtextdomain and textdomain calls to void, to avoid warning when NLS is disabled. * src/output.c: Include scan-skel.h. (scan_skel): Remove decl, since scan-skel.h does this. (output_skeleton): Indent calls to "error" to pacify "make maintainer-distcheck". * src/print_graph.c: Don't include <obstack.h>, as system.h does this. * src/reader.h (gram_end, gram_lineno): New decls to pacify "make maintainer-distcheck". * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in): (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno): (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug): (skel_lex_destroy, scan_skel): Move these decls to... * src/scan-skel.h: New file. * src/uniqstr.c (uniqstr_assert): Indent calls to "error" to pacify "make maintainer-distcheck". * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR), not @VAR@. * tests/torture.at: Revamp to avoid misuse of atoi that "make maintainer-distcheck" complained about.
* Update FSF postal mail address.Paul Eggert2005-05-141-2/+2
|
* Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc.Paul Eggert2004-03-311-4/+4
|
* (GNU pic Grammar): New test case, taken fromPaul Eggert2003-04-181-1/+1545
| | | | <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
* (GNU Cim Grammar): Switch to Yacc-style reports.Paul Eggert2002-12-291-11/+11
|
* Normalize conflict related messages.Akim Demaille2002-07-301-1/+1
| | | | | | | | * src/complain.h, src/complain.c (warn, complain): New. * src/conflicts.c (conflicts_print): Use them. (conflict_report_yacc): New, extracted from... (conflicts_print): here. * tests/conflicts.at, tests/existing.at: Adjust.
* * src/reader.c (grammar_current_rule_prec_set).Akim Demaille2002-06-111-3/+3
| | | | | | | | (grammar_current_rule_check): New, eved out from... (readgram): here. Remove `xaction', `first_rhs': useless. * tests/input.at (Type clashes): New. * tests/existing.at (GNU Cim Grammar): Adjust.
* * tests/torture.at (Big triangle): New.Akim Demaille2002-04-071-0/+1209
(GNU AWK Grammar, GNU Cim Grammar): Move to... * tests/existing.at: here.