Commit Graph

340 Commits

Author SHA1 Message Date
Joel E. Denny
628be6c97d Complain about unused %define variables and %code qualifiers.
* NEWS (2.5): Document.
* data/bison.m4 (b4_check_user_names): Complain instead of warn.
* doc/bison.texinfo (Decl Summary): Document complaint, and
improve %define documentation a little otherwise.
* tests/input.at (Reject unused %code qualifiers): Update.
(%define errors): Update.
(%define, --define, --force-define): Update.
(%define backward compatibility): Update.
(Unused %define api.pure): Update.
* tests/push.at (Push Parsing: Unsupported Skeletons): Update.
(cherry picked from commit c6abeab182)

Conflicts:

	ChangeLog
2009-09-05 18:44:02 -04:00
Joel E. Denny
f37495f601 %define: accept unquoted values.
* NEWS (2.5): Group all %define changes together, and document
this one.  Remove quotes in IELR and canonical LR entry.
* doc/bison.texinfo: Remove quotes in most examples throughout.
(Decl Summary): Update %define documentation.
(Table of Symbols): Likewise.
* src/ielr.c (LrType): Update documentation.
* src/parse-gram.y (content.opt): Add production for ID.
* tests/calc.at: Likewise.
* tests/existing.at: Likewise.
* tests/input.at: Likewise.
* tests/local.at: Likewise.
* tests/push.at: Likewise.
* tests/reduce.at: Likewise.
* tests/torture.at: Likewise.
(cherry picked from commit cf499cff31)

Conflicts:

	doc/bison.texinfo
	src/parse-gram.c
	src/parse-gram.h
	tests/actions.at
	tests/calc.at
2009-08-28 08:04:11 -04:00
Joel E. Denny
3a414bbfa0 %define lr.type: make values lowercase IDs.
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.
(cherry picked from commit 6ba9640406)
2009-08-28 07:35:23 -04:00
Akim Demaille
c33bc80009 doc: fixes.
* doc/bison.texinfo: Fix minor Texinfo errors.
(cherry picked from commit 17aed602c6)
2009-08-19 14:52:49 +02:00
Akim Demaille
8fbbeba2a4 doc: %initial-action to initialize yylloc.
Reported by Bill Allombert.
	* doc/bison.texinfo: Set fill-column to 76.
	(Location Type): Document the use of %initial-action to initialize
	yylloc.

(cherry picked from commit d59e456dbf)
2009-08-19 13:36:22 +02:00
Joel E. Denny
38609c3455 maint: run "make update-copyright" 2009-08-06 19:16:29 -04:00
Joel E. Denny
e3a33f7c23 Convert multiple variable definition warnings to complaints.
* NEWS (2.5): Add a new entry for that change.
* doc/bison.texinfo (Decl Summary): Update %define entry.
(Bison Options): Update -D/--define/-F/--force-define entry.
* src/muscle_tab.c (muscle_percent_define_insert): Implement.
* src/muscle_tab.h (muscle_percent_define_insert): Update
comments.
* tests/input.at (`%define errors'): Update.
(`%define, --define, --force-define'): Update.
2009-05-23 02:27:11 -04:00
Joel E. Denny
34d4193815 -F/--force-define and relative %define/-D/--define priorities.
* NEWS (2.5): Add documentation to -D/--define entry.
* build-aux/cross-options.pl: Hard-code association of
--force-define with %define.
* doc/bison.texinfo (Decl Summary): In %define entry,
cross-reference command-line options.
(Bison Options): Add documentation to -D/--define entry.
(Option Cross Key): Widen column for --force-define row.
* src/getargs.c (usage): Document -F/--force-define.  Realign
options in output.
(short_options, long_options, getargs): Parse -F/--force-define,
and update muscle_percent_define_insert invocation.
* src/muscle_tab.h (muscle_percent_define_how): New enum type.
(muscle_percent_define_insert): Add argument with that type.
* src/muscle_tab.c (muscle_percent_define_insert): Implement
-F/--force-define behavior and priorities.
* src/parse-gram.y (prologue_declaration): Update
muscle_percent_define_insert invocations.
* tests/input.at (`%define, --define'): Rename to...
(`%define, --define, --force-define'): ... this and extend.
2009-05-22 23:37:35 -04:00
Akim Demaille
b10dd689b6 doc: use C++ headers.
* doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
	headers.
2009-05-11 08:36:51 +02:00
Akim Demaille
c046698e6e identifiers: dashes are letters.
Dashes can now start identifiers (symbols and directives).

	* src/scan-gram.l ({letter}): Add dash.
	({id}): Remove it.
	* tests/input.at (Symbols): Adjust.
	Remove stray comment.
	* tests/regression.at (Invalid inputs): Adjust error message.
	* doc/bison.texinfo (Symbols): Update.
2009-05-04 21:30:52 +02:00
Joel E. Denny
966aba6583 Declare %code to be a permanent feature.
* NEWS (2.4.2): Here.
* doc/bison.texinfo (Prologue Alternatives): Don't say it's
experimental.
(Decl Summary): Likewise.
(cherry picked from commit cefb18280b)
2009-05-01 03:00:20 -04:00
Joel E. Denny
812775a039 Convert underscores to dashes in some %define variable names.
For now, just api.push-pull and lr.keep-unreachable-states.
Maintain old names for backward compatibility.
* NEWS (2.5): Document.
* data/c.m4 (b4_identification): Update comment.
* data/yacc.c: Update access.
* doc/bison.texinfo: Update.
* etc/bench.pl.in (bench_grammar): Update use.
* src/files.c (tr): Move to...
* src/getargs.c, src/getargs.h (tr): ... here because I can't
think of a better place to expose it.  My logic is that, for all
uses of tr so far, command-line arguments can be involved, and
getargs.h is already included.
* src/main.c (main): Update access.
* src/muscle_tab.c (muscle_percent_define_insert): Convert old
variable names to new variable names before assigning value.
* src/reader.c (reader): Update setting default.
* tests/calc.at: Update uses.
* tests/conflicts.at (Unreachable States After Conflict
Resolution): Update use.
* tests/input.at (%define enum variables): Update use.
(%define backward compatibility): New test group.
* tests/push.at: Update uses.
* tests/reduce.at: Update uses.
* tests/torture.at: Update uses.
2009-04-30 03:43:42 -04:00
Joel E. Denny
1d0f55cc84 Rename lr.default_reductions to lr.default-reductions.
* NEWS (2.5): Here.
* doc/bison.texinfo: Here.
* src/lalr.c (initialize_LA): Here.
* src/print.c (print_reductions): Here.
* src/reader.c (reader): Here.
* src/tables.c (action_row): Here.
* tests/input.at (%define enum variables): Here.
* tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
2009-04-29 21:48:21 -04:00
Akim Demaille
663ce7bb3e variables: accept dashes.
* src/scan-gram.l ({id}): Also accept dashes after the initial
	letter.
	({directive}): Use {id}.
	* src/parse-gram.y: Comment and formatting changes.
	* doc/bison.texinfo (Symbols): Adjust the lexical definitions of
	symbols.
	* src/complain.h, src/complain.c (yacc_at): New.
	* src/symtab.c (symbol_new): Use yacc_at to report inappropriate
	symbol names.
	* src/output.c (token_definitions_output): Do not #define token
	names with dashes.
(cherry picked from commit 4f646c3794)

Conflicts:

	data/bison.m4
	src/parse-gram.y
2009-04-29 18:50:12 -04:00
Joel E. Denny
379261b3fd Clean up recent patches a little.
Reported by Akim Demaille.
* doc/bison.texinfo (Understanding): Fix typos.
* src/print.c (print_reductions): Don't use negated variable.
2009-04-24 02:47:42 -04:00
Joel E. Denny
620b572773 Rename "default rule" to "default reduction".
This includes changing variable names in code, changing
comments, and renaming %define lr.default_rules to %define
lr.default_reductions.
* NEWS (2.5): Update IELR documentation.
* data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c:
Adjust YYDEFACT and yydefact_ documentation.
* doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
and lr.type documentation.  Make some other wording
improvements.
(Glossary): Adjust cross-references and Default Reduction
definition.
* src/lalr.c (state_lookahead_tokens_count): Adjust code.
Remove a confusing comment pointed out by Akim Demaille.
(initialize_LA): Adjust code.
* src/print-xml.c (print_reductions): Adjust code.
* src/print.c (print_reductions): Adjust code.
* src/reader.c (reader): Adjust code.
* src/tables.c (action_row): Adjust code.
(token_actions): Adjust code.
* src/tables.h: Adjust YYDEFACT documentation.
* tests/input.at (%define lr.default_rules invalid values):
Rename test group to...
(%define lr.default_reductions invalid values): ... this, and
update grammar file and expected output.
* tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
(AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
2009-04-23 04:29:25 -04:00
Joel E. Denny
34a6c2d19b Document %define lr.type and lr.default_rules.
* NEWS (2.5): Add an entry.
* src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
besides just LALR(1) and GLR(1).
* doc/bison.texinfo (Introduction): Likewise.
(Language and Grammar): Bison is no longer limited to LALR(1)
restrictions.
(GLR parsing): Say deterministic or LR(1) rather than LALR(1)
when trying to distinguish from GLR.  Talk about LR(1) grammars
rather than LALR(1) grammars.
(Decl Summary): In %define api.push_pull entry, say it applies
to deterministic parsers in C rather than LALR(1) parsers in C.
Add lr.default_rules entry.
Add lr.type entry.
(Mystery Conflicts): Bison is no longer limited to LALR(1)
restrictions.
(Generalized LR Parsing): Same changes as for the previous GLR
section.
(Memory Management): Say deterministic rather than LALR(1).
(Understanding): Correct some bison output.
Index discussion of "accepting state".
Say deterministic rather than LALR(1).
(Bison Options): In --yacc entry, say deterministic rather than
LALR(1).
In --report, --graph, and --xml entries, just don't mention
LALR(1).
(C++ Parsers): Say deterministic rather than LALR(1).
(Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
(Glossary): Add Accepting State, Consistent State, Default Rule,
and IELR(1) definitions.
In Generalized LR (GLR) definition, make same changes as in
previous GLR sections.
In LALR(1) definition, say Bison uses LALR(1) by default rather
than implying Bison is limited to LALR(1).
(LocalWords): Add IELR.
2009-04-21 05:13:36 -04:00
Akim Demaille
bd5df716a3 doc: minor fixes.
* doc/bison.texinfo (Decl Summary): Fix entry about %debug.
	(Table of Symbols): Remove duplicate entry for %debug.
2009-04-14 08:12:29 +02:00
Akim Demaille
fadb13b5b3 Display the changes in cross-options.texi.
* build-aux/cross-options.pl ($sep): New, to separate items.
	* doc/Makefile.am ($(srcdir)/cross-options.texi): Use diff to display
	the changes.
2009-04-06 05:47:16 -04:00
Di-an Jan
72183df4da Improves options in the manual.
* doc/bison.texinfo (-g, -x): Add space before argument.
	(Option Cross Key): Implement FIXME: listing directives also.
	* build-aux/cross-options.pl:  Read from <STDIN> rather than <>.
	(Short Option): Special case -d.  Put arguments inside @option.
	(Bison Directive): Add column, automatically extracted from
	src/scan-gram.l (actual name passed as the first argument)
	with special case for %define.
	* doc/Makefile.am (doc/cross-options.texi): Pass src/scan-gram.l
	to build-aux/cross-options.pl.
	* src/getargs.c (usage): Document limitations of cross-options.pl.
	* src/scan-gram.l: Likewise.
2009-04-06 05:40:27 -04:00
Akim Demaille
e14c68313b -D, --define.
* src/getargs.c (usage): Document -D.
	Fix help string for --locations.
	(command_line_location): New.
	(short_options, long_options, getargs): Support -D, --define.
	(getargs): Move -d support at the right place.
	* doc/bison.texinfo (Bison Options): Update.
	* tests/input.at (%define, --define): New.
(cherry picked from commit 58697c6d89)
2009-04-06 04:28:50 -04:00
Joel E. Denny
ecd1b61cd4 Fix options documentation.
* build-aux/cross-options.pl: As in --help output, write optional
arguments as [=ARG] not =[ARG].
* doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
2009-04-06 02:54:38 -04:00
Joel E. Denny
5bc993d947 Help with updating web manual.
* HACKING: Incorporate instructions from gnulib/doc/README.
* bootstrap.conf (gnulib_modules): Add gendocs.
2009-04-03 18:46:58 -04:00
Di-an Jan
f56274a8f9 Fix formatting and content of bison.texinfo menus
* doc/bison.texinfo: Synchronize ``Detail Node Listing''.
Align menus.  Adjust word wrapping.  Use node names for menu names.
(Examples): Don't abbreviate node names.
(LocalWords): Remove abbreviations.
(Copying): Make description a sentence.
(Java Action Features): Remove period to match the rest of menu.
2008-11-17 11:08:09 +01:00
Joel E. Denny
ed4d67dcbe Say %language is experimental.
We're thinking of extending it's effect on output file naming.  See the
thread at
<http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
* NEWS: Say it's experimental.
* doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
recommend it over %skeleton for now.
(Bison Options): Likewise.
(C++ Bison Interface): Use %skeleton not %language.
(Calc++ Parser): Use %skeleton not %language.
* src/getargs.c (usage): Say it's experimental.
2008-11-02 16:54:45 -05:00
Di-an Jan
e254a580b5 Java parser improvements
2008-11-01  Di-an Jan  <dianj@freeshell.org>
	    Paolo Bonzini  <bonzini@gnu.org>

	Support all Java parser class modifiers.
	* data/java.m4 (b4_percent_define_get3): New.
	(b4_final_if, b4_strictfp_if): New.
	* data/lalr1.java (final, strictfp, extends, implements): Support.
	* doc/bison.texinfo (final, strictfp, extends, implements): Add
	documentation.
	* tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
	(AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
	(AT_CHECK_JAVA_GREP): New.
	(Java parser class modifiers): New test.
	(Java parser class extends and implements): New test.

	Model exception propagation better with throws and lex_throws.
	* data/java.m4 (b4_list2): New.
	(throws): Change default.
	* data/lalr1.java (yyaction): Add throws.
	(parse): Add lex_throws in addition to throws.
	* doc/bison.texinfo (throws, lex_throws): Add documentation.
	* tests/java.at (Java throws specifications): New test.

	Improve documentation for Java parsers.
	* doc/bison.texinfo (Java Parsers): Add subsections.
	Don't quote first argument of %define.
	(Java Bison Interface): Document output files.  Move documentation
	of parser class and merge into Java Parser Interface.  Document
	features that error out.  Document directives with no effect.
	Move note about Javadoc higher.
	(Java Semantic Values): Explicitly mention stype.
	Document that generic types cannot be used.
	(Java Location Values): Use @deftypeivar.  Document constructors.
	Correct return value for toString.
	(Java Parser Interface): List undocumented constants/fields.
	Move documentation of fields added by %parse-param closer to list
	of members.  Document that token names are added as fields.
	Document constructors accurately.  Remove error method.
	(Java Scanner Interface): Move note on %pure-parser to Java Bison
	Interface.  Describe %code lexer and yylex accutately.
	Remove documentation that does not match the code.
	(Java Action Features): New.
	(Java Differences): Add reference.  Add item on semantic values.
	Add note about @{ ... @}.  Clarify %% epilogue placement.
	(Java Declarations Summary): New.

	Fix Java skeleton.
	* data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
	(b4_remove_comma): Quote test argument.
	* tests/java.at (Java parser class and package names): New test.
	(Java %parse-param and %lex-param): New test.
	(Java stype, position_class and location_class): New test.
2008-11-01 20:00:01 +01:00
Akim Demaille
e1145ad8bd Clarify UPDATED use.
* doc/bison.texinfo: It refers to the last edition of this file,
	not to the release date of Bison.
	Reported by Joel E. Denny.
2008-08-29 10:12:23 +02:00
Joel E. Denny
78029cd561 Remove remaining dependence on CVS Id keyword.
* ChangeLog: For the sake of people still using CVS, don't use dollars
when mentioning Id.
* data/xslt/bison.xsl: Remove Id from header comments, where it was
unusual anyway.
* data/xslt/xml2dot.xsl: Likewise.
* data/xslt/xml2text.xsl: Likewise.
* data/xslt/xml2xhtml.xsl: Likewise.
* doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
* doc/Makefile.am (neutralize): Remove, no longer needed.
(.x.1): Don't use neutralize.
(edit): Don't substitute for ID.
(Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
2008-07-27 15:49:04 -04:00
Joel E. Denny
c53d18b157 Fix dependence on computed configure variables.
* doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
$(top_srcdir)/configure.ac so that changes to computed variables, such
as PACKAGE_VERSION, are seen.
* tests/Makefile.am ($(srcdir)/package.m4): Likewise.
2008-07-27 01:15:12 -04:00
Joel E. Denny
8fa369111f Use git-version-gen for version names between releases.
* .cvsignore (.tarball-version, GNUmakefile, *~): Add.
* .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
* .prev-version: New.
* .version.in: Remove.
* ChangeLog: Remove the $Id$ previously used for capturing the CVS
revision.
* GNUmakefile: Remove, now copied from Gnulib.
* Makefile.am: Add code suggested by comments in
build-aux/git-version-gen.
(EXTRA_DIST): Remove GNUmakefile, handled by Gnulib.  Add maint.mk,
.prev-version, and .version.
* NEWS (2.3b+): Rename to...
(?.?): ... this because we're dropping the "+" version naming scheme,
but, in general, we still can't be sure of our next release name.
* bootstrap: Add a quick hack to remove from .gitignore the
GNUmakefile entry that gnulib adds.  We already have a /GNUmakefile
entry.  This should really be fixed in gnulib instead.
* bootstrap.conf (gnulib_modules): Add gnumakefile.
* configure.ac (AC_INIT): Set version name by invoking
build-aux/git-version-gen.
(AC_CONFIG_FILES): Remove .version, now generated by
build-aux/git-version-gen.
* maint.mk: New, copied from coreutils.
* doc/.cvsignore (bison.1): Add.
* doc/.gitignore (/bison.1): Add.
* doc/bison.1: Remove, generated.
* src/.cvsignore (revision.c): Remove.
* src/.gitignore (/revision.c): Remove.
* src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
(BUILT_SOURCES): Remove revision.c.
(revision.c): Remove.
* src/getargs.c (version): Don't print revision after the VERSION.
* src/revision.h: Remove.
2008-07-18 12:55:39 -04:00
Joel E. Denny
a9fc7990fa Improve forward-compatibility with GNU M4.
Reported by Eric Blake at
<http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
* bootstrap.conf (gnulib_modules): Add unsetenv.
* lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
* m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
(/setenv.m4): Add.
* src/output.c (output_skeleton): For the m4 invocation, pass -dV as
the first argument because it may become position-dependent, and unset
POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
Add comments explaining these issues in more detail.
2008-07-15 21:00:36 -04:00
Joel E. Denny
0f1d6f10d7 Add .gitignore everywhere based on .cvsignore.
* .gitignore: New.
* build-aux/.gitignore: New.
* data/.gitignore: New.
* doc/.gitignore: New.
* etc/.gitignore: New.
* examples/.gitignore: New.
* examples/calc++/.gitignore: New.
* lib/.gitignore: New.
* m4/.gitignore: New.
* po/.gitignore: New.
* runtime-po/.gitignore: New.
* src/.gitignore: New.
* tests/.gitignore: New.
2008-07-14 06:06:26 -04:00
Joel E. Denny
7bd1665a86 * NEWS (2.3b+): New section, empty for now.
* configure.ac (AC_INIT): 2.3b -> 2.3b+.
2008-05-28 03:25:22 +00:00
Joel E. Denny
bd02cd5d3a * NEWS: Version 2.3b.
* configure.ac (AC_INIT): Likewise.
(PACKAGE_COPYRIGHT_YEAR): Update to 2008.
2008-05-23 05:32:11 +00:00
Joel E. Denny
8e55b3aac2 * NEWS (2.3a+): Mention that -g now takes an argument.
* doc/bison.texinfo (Bison Options): Reword -W entry a little for
consistency.  Update the -g and -x entries now that they take
arguments.  Use brackets to indicate optional arguments.
* src/getargs.c (usage): Explain the relationship between arguments of
long and short options more completely.  Document --defines and -d
separately since the former takes an argument but, for POSIX Yacc, the
latter does not.
(short_options): Let -W take an optional argument like --warnings.
(getargs): Sort cases.
2008-03-08 20:49:57 +00:00
Akim Demaille
59c5ac7244 * doc/bison.texinfo: Fix a few typos. 2008-02-28 16:28:07 +00:00
Akim Demaille
118d497883 * doc/bison.texinfo (Bison Options): Document -W.
Based on Joel E. Denny's NEWS entry, and Automake's documentation.
2008-02-28 16:18:37 +00:00
Joel E. Denny
59da312bc7 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
say its interface is experimental.
* doc/bison.texinfo (Decl Summary): In the %language entry, mention
Java.
(Bison Options): In the -L and --language entry, mention Java.
(Java Bison Interface): Say the interface is experimental.
* src/getargs.c (usage): Mention -L and --language.

* NEWS (2.3a+): Say the push parsing interface is experimental.
* doc/bison.texinfo (Push Decl): Likewise.
(Decl Summary): Likewise in the "%define api.push_pull" entry.
(Push Parser Function): Likewise.
(Pull Parser Function): Likewise.
(Parser Create Function): Likewise.
(Parser Delete Function): Likewise.
(Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
yypull_parse, and yypush_parse entries.

* NEWS (2.3a+): Mention XML support, and say the schema is
experimental.
* doc/bison.texinfo (Bison Options): Mention -x and --xml.
* src/getargs.c (usage): Say the XML schema is experimental.

* NEWS (2.3a+): Say option instead of flag.
2008-02-23 04:26:14 +00:00
Joel E. Denny
333e670c85 Fix impure push parser compile error reported by Bob Rossi at
<http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
* data/yacc.c: Clean up whitespace in the output a little.
(yypstate_allocated): Define for impure push parsers regardless of
whether the pull interface is also requested.
* tests/push.at (Push Parsing: Multiple impure instances): Extend to
check impure push parsers without the pull interface.

* data/yacc.c (yypstate_new): Don't try to invoke yyerror since
yyerror takes arguments specified by %parse-param while yypstate_new
does not.
* doc/bison.texinfo (Parser Create Function): Document that
yypstate_new returns 0 for multiple impure parser instances.
* tests/push.at (Push Parsing: Multiple impure instances): Update
expected stderr output.
2008-02-20 18:23:21 +00:00
Joel E. Denny
b1cc23c4e3 Fix documentation problems reported by Tim Josling at
<http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
* NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
* doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
integers.  Explain the effect of literal string aliases on error
messages.  Copy token 0 documentation from the C++ skeleton
documentation.
2008-02-17 02:47:53 +00:00
Joel E. Denny
ab7f29f8f9 Accept a token number in a %left, %right, or %nonassoc for POSIX
conformance.  Reported by Tim Josling at
<http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
* NEWS (2.3a+): Mention.
* doc/bison.texinfo (Precedence Decl): Describe how literal strings
and code numbers are treated by precedence declarations.
* src/parse-gram.y (precedence_declaration): Use symbols.prec instead
of symbols.1.
(symbols.prec): New, just like symbols.1 but uses symbol.prec instead
of symbol.
(symbol.prec): New, just like symbol but allows INT.
* src/symtab.c (symbol_user_token_number_set): Remove an aver that no
longer holds.
* tests/regression.at (Token number in precedence declaration): New
test case.
2008-02-17 00:18:36 +00:00
Paul Eggert
389c8cfd1c * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording. 2008-01-31 00:53:21 +00:00
Joel E. Denny
d80fb37a26 In the XML output, list useless and unused symbols and rules with the
useful ones and add a "usefulness" attribute.  Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
* src/gram.c (grammar_rules_partial_print_xml): Remove.
(grammar_rules_print_xml): Print all rules instead of just those
useful in the grammar, and add a "usefulness" attribute.
* src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
* src/print-xml.c (print_rules_useless_in_parser): Remove.
(print_grammar): Print all nonterminals instead of just useful ones,
and add a "usefulness" attribute to nonterminals and terminals.
(print_xml): Don't print a separate "reductions" or
"rules-useless-in-parser" element.
* src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
(reduce_xml): Remove.
(reduce_token_unused_in_grammar): New.
(reduce_nonterminal_useless_in_grammar): New.
* src/reduce.h (reduce_xml): Remove prototype.
(reduce_token_unused_in_grammar): Add prototype.
(reduce_nonterminal_useless_in_grammar): Add prototype.
* data/xslt/xml2text.xsl: Update for XML changes.
* data/xslt/xml2xhtml.xsl: Update for XML changes.
* tests/reduce.at (Useless Terminals): Update output.
(Useless Rules): Update output.
(Reduced Automaton): Update output.

Say "Terminals unused in grammar" instead of "Unused terminals".
* NEWS (2.3a+): Update.
* doc/bison.texinfo (Understanding): Update example output.
* src/reduce.c (reduce_output): Implement.
* data/xslt/xml2text.xsl: Implement.
* data/xslt/xml2xhtml.xsl: Implement.
2007-11-24 19:41:25 +00:00
Joel E. Denny
1bb2bd75f0 Accept --report-file=FILE to override the default `.output' filename.
* NEWS (2.3a+): Mention.
* doc/bison.texinfo (Bison Options): Add an entry.
* src/files.c (compute_output_file_names): Don't override
spec_verbose_file if already set.
* src/getargs.c (usage): Document --report-file.
(REPORT_FILE_OPTION): New anonymous enum member.
(long_options): Add entry for it.
(getargs): Add case for it setting spec_verbose_file.

* build-aux/cross-options.pl: Don't record a short option just because
there's an arg.
* doc/.cvsignore: Add yacc.1.
2007-11-18 06:40:41 +00:00
Akim Demaille
a005a9c4dc * doc/yacc.1.in: New.
* configure.ac, doc/Makefile.am: Adjust.
* configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
config.h symbol.
Use AC_SUBST for assignments too.
* src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
2007-11-14 13:18:44 +00:00
Joel E. Denny
cff03fb2b9 * src/gram.c: Remove comments that duplicate comments in gram.h.
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.
2007-11-10 03:42:37 +00:00
Joel E. Denny
66f0441da3 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
here document and before the EOF so that BSD's implementation of Bourne
shell doesn't parse the delimiter as part of the here document.
* doc/.cvsignore: Add cross-options.texi.
* src/getargs.c (usage): Add a blank line after the warning categories.
2007-11-10 01:36:54 +00:00
Akim Demaille
e8b1fb9b99 Remove Id: from bison.1.
* doc/Makefile.am (remove_time_stamp): Include the sed invocation.
(perl -0777 -pi -e 's/.PPnId): New.
(.x.1): Use it to ignore the version control revision.
2007-11-05 16:10:09 +00:00
Akim Demaille
2f7a96b58f * build-aux/Makefile.am: Ship cross-options.pl.
* doc/Makefile.am: Always refer to cross-options.texi with
$(srcdir).
(MAINTAINERCLEANFILES): Add it.
2007-11-05 06:38:00 +00:00
Akim Demaille
be252c3968 * doc/Makefile.am: Complete the previous checkin. 2007-11-04 21:17:55 +00:00