Commit Graph

525 Commits

Author SHA1 Message Date
Akim Demaille
c85541913b Merge branch 'maint'
* origin/maint:
  maint: post-release administrivia
  version 2.6.2
  NEWS: update.
  yacc: remove trailing end of line at end of file
  thanks: fix a contributor name
  gnulib: update
  tests: synch line -> syncline, for consistency
  tests: synclines: style changes
  tests: synclines: fix perl invocation
  regen
  c++: trailing end-of-lines in %parse-param
  tests: simplify

Conflicts:
	cfg.mk
	data/glr.cc
	data/yacc.c
	src/parse-gram.c
	src/parse-gram.h
	src/parse-gram.y
2012-08-03 11:04:29 +02:00
Akim Demaille
933ec5449f maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-08-03 09:52:05 +02:00
Akim Demaille
e1eeecd384 version 2.6.2
* NEWS: Record release date.
2012-08-03 09:43:02 +02:00
Akim Demaille
de62ae867b YYPARSE_PARAM: drop support
* data/yacc.c: No longer support it.
* doc/bison.texi, tests/headers.at: Adjust.
* NEWS: Document.
2012-08-02 15:32:48 +02:00
Akim Demaille
43ca804096 NEWS: update.
* NEWS: Catch up with the other changes from 2.6.1.
2012-08-02 13:51:52 +02:00
Akim Demaille
dcd5344dcd yacc: remove trailing end of line at end of file
There are still spurious spaces at the end of some lines.  But this is
addressed in the master branch, and I am reluctant to try to backport
this.

* data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: here.
* tests/calc.at (AT_CHECK_SPACES): New.
Use it.
Be sure not to introduce trailing empty lines in the *.y files.
* NEWS: Doc it.
* cfg.mk (syntax-check): Remove the exception.
2012-08-02 13:51:52 +02:00
Akim Demaille
c9d546b2a8 c++: trailing end-of-lines in %parse-param
* src/parse-gram.y (add_param): No only skip ' ' and '\t', skip all
leading and trailing spaces.
* tests/regression.at (Lex and parse params): Check it.
* NEWS: Document it.
2012-08-01 09:16:55 +02:00
Akim Demaille
cb9ec4fada Merge branch 'maint'
* maint:
  use obstack_printf
  scanner: restore a missing start condition
  gnulib: update
  maint: post-release administrivia
  version 2.6.1
  gnulib: update
  maint: fix some syntax-check issues
  tests: do not depend on __cplusplus to decide for C++ or C output

Conflicts:
	NEWS
	bootstrap.conf
	cfg.mk
	lib/.gitignore
2012-07-31 12:03:55 +02:00
Akim Demaille
5de5b98751 lalr1.cc: do not create stack.hh without %defines
* data/stack.hh (b4_stack_define): New.
* data/lalr1.cc: Use it when %defines is not passed.
* tests/output.at: Adjust expected output.
2012-07-31 11:33:46 +02:00
Akim Demaille
93549bcd43 lalr1.cc: location.hh and position.hh are not generated without %defines
* data/location.cc (b4_position_define, b4_location_define): New.
(location.hh, position.hh): Generate only if %defines.
* data/lalr1.cc: therefore, define these classes when locations are
needed, but headers are not generated.
* tests/output.at: Check that these files are not generated.
* NEWS: Document.
2012-07-31 11:33:46 +02:00
Akim Demaille
34904c575a glr.cc: no longer require location support
* data/glr.cc: Use b4_locations_if where appropriate.
* data/lalr1.cc: M4 quotation changes to highlight code duplication
with glr.cc.
* tests/calc.at: Check glr.cc with and without %location.
While at it, fuse multiple %parse-params into one.
* tests/actions.at: Simplify.
* NEWS: Doc this.
Some other wording changes.
2012-07-31 11:33:44 +02:00
Akim Demaille
9c26b8fc03 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-07-30 11:47:29 +02:00
Akim Demaille
77b214ef48 version 2.6.1
* NEWS: Record release date.
2012-07-30 11:18:23 +02:00
Akim Demaille
4323e0dac3 Merge remote-tracking branch 'origin/maint'
* origin/maint: (29 commits)
  regen
  synclines: remove spurious empty line
  also support $<foo>$ in the %initial-action
  skeletons: b4_dollar_pushdef and popdef to simpify complex definitions
  regen
  printer/destructor: translate only once
  factor the handling of m4 escaping
  news: schedule the removal of the ";" hack
  style changes in the scanners
  regen
  support $<tag>$ in printers and destructors
  scan-code: factor the handling of the type in $<TYPE>$
  muscles: fix another occurrence of unescaped type name
  glr.cc: fix the handling of yydebug
  gnulib: update
  formatting changes
  tests: fix an assertion
  tests: adjust to GCC 4.8, which displays caret errors
  be sure to properly escape type names
  obstack_quote: escape and quote for M4
  muscles: shuffle responsabilities
  muscles: make private functions static
  muscles: rename private functions/macros
  obstack_escape: escape M4 characters
  remove dead macro
  maint: style changes
  doc: avoid problems with case insensitive file systems
  configure: fix botched quoting
  news: fix typo.

Conflicts:
	NEWS
	data/c.m4
	data/glr.cc
	data/lalr1.cc
	examples/rpcalc/local.mk
	src/muscle-tab.h
	src/output.c
	src/parse-gram.c
	src/parse-gram.h
	src/parse-gram.y
	src/scan-code.l
	src/symlist.c
	src/symlist.h
	src/symtab.h
	tests/calc.at
2012-07-27 16:35:49 +02:00
Akim Demaille
cd735a8c6c also support $<foo>$ in the %initial-action
scan-code.l is already passing argument to b4_dollar_dollar for the
initial acton, but its definition (of b4_dollar_dollar) does not use
this argument.

Generalize this definition, and use it for the %initial-action too.

* data/c.m4 (b4_dollar_dollar_, b4_dollar_pushdef, b4_dollar_popdef):
Instead of expecting a pointer, require a value, and use ".".
Since they are now generic enough, move to...
* data/c-like.m4: this new file.
* data/c.m4, data/java.m4: Load it.
* data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Use
b4_dollar_pushdef for the %initial-action.
* tests/actions.at: Check that.
* data/Makefile.am: Adjust.
* NEWS, doc/bison.texi: Document.
2012-07-27 14:47:20 +02:00
Akim Demaille
263137264f factor the handling of m4 escaping
The conversion from @ to @@ and so forth is coded is too many
different places.  Factor, a bit.

* src/scan-code.l: Instead of duplicating the logic of obstack_escape,
use it.
It sure is less efficient, but the cost is negligible.
This allows to factor rules that are alike.
And to factor some start-condition clauses.
* tests/input.at (Stray $ or @): New.
* NEWS: Document it.
2012-07-27 12:54:31 +02:00
Akim Demaille
e20e6a50d5 news: schedule the removal of the ";" hack
scan-code.l is significantly more complex because of this.

* NEWS: Doc it.
2012-07-27 12:54:31 +02:00
Akim Demaille
4982f078bf support $<tag>$ in printers and destructors
* src/scan-code.l (SC_SYMBOL_ACTION): Accept $<tag>$, not just $$.
* data/c.m4 (b4_dollar_dollar_): New.
(b4_symbol_actions): Let b4_dollar_dollar use b4_dollar_dollar_.
* NEWS, doc/bison.texi: Document it.
* tests/actions.at: Check this for C and C++.
2012-07-26 18:30:43 +02:00
Akim Demaille
0e164d43d1 glr.cc: fix the handling of yydebug
* data/glr.cc (yydebug_): Remove, unused.
(set_debug_level, debug_level): Work on yydebug instead.
* doc/bison.texi, NEWS: Document this.
2012-07-26 17:03:52 +02:00
Akim Demaille
8617d87e24 be sure to properly escape type names
* src/scan-code.l: Use obstack_quote when passing type_name to m4.
* tests/input.at (Code injection): New.
* NEWS: Document it.
Thanks to Paul Eggert for the wording.
2012-07-26 14:20:47 +02:00
Akim Demaille
5f819b2f98 yystype, yyltype: remove.
* data/c.m4: here.
* NEWS: Doc it.
2012-07-24 08:53:48 +02:00
Akim Demaille
47db7ed1a8 YYFAIL: remove.
* data/lalr1.java, data/yacc.c, src/scan-code.l: Remove YYFAIL support.
* NEWS, TODO: Update.
2012-07-22 21:17:07 +02:00
Akim Demaille
aaf6103699 news: fix typo.
* NEWS: here.
Reported by Ben Pfaff.
2012-07-20 10:01:48 +02:00
Akim Demaille
3eb4f1a3e6 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  maint: update gnu-web-doc-update.
  maint: post-release administrivia
  version 2.6
  maint: prepare for release 2.6
  maint: post-release administrivia
  version 2.5.91
  maint: prepare NEWS.
  maint: fix spaces.
  tests: adjust to case where the C compiler is actually a C++ compiler
  tests: fix dependencies
  doc: fix Texinfo command
  maint: Valgrind on OS X.
  tests: be sure that backups are safe.
  maint: dead comment.
  tests: refactor for legibility.
  tests: refactor the bison invocations.
  maint: fix syntax-check ignore patterns.
  gnulib: update
  gnulib: update.
  gnulib: update

Conflicts:
	build-aux/Makefile.am
	cfg.mk
	tests/Makefile.am
2012-07-19 17:39:13 +02:00
Akim Demaille
a4107f24bc maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-07-19 15:38:29 +02:00
Akim Demaille
1505e8bb78 version 2.6
* NEWS: Record release date.
2012-07-19 15:24:23 +02:00
Akim Demaille
58c7e5ee2c maint: prepare for release 2.6
* NEWS: here.
2012-07-19 15:21:32 +02:00
Akim Demaille
ad6b775fc5 maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-07-18 18:33:25 +02:00
Akim Demaille
5d614dfa8c version 2.5.91
* NEWS: Record release date.
2012-07-18 18:19:32 +02:00
Akim Demaille
858c700fc0 maint: prepare NEWS. 2012-07-18 18:19:12 +02:00
Akim Demaille
9553083c72 maint: minor fixes
* NEWS: restore missing entry.
* cfg.mk: Adjust to *.texinfo -> *.texi.
* src/symtab.c: Spaces fixes.
2012-07-06 11:16:08 +02:00
Akim Demaille
60aa04a236 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  maint: update release instructions
  maint: post-release administrivia
  version 2.5.90
  build: fix gen-ChangeLog call.
  gnulib: update.
  tests: fix SKIP_IF for Java.
  api.prefix: incompatible with %name-prefix.
  api.prefix: strengthen the tests and fix push-parsers.
  skeletons: style changes.
  NEWS: minor changes.
  api.prefix: improve the documentation for YYDEBUG.
  gnulib: update.

Conflicts:
	NEWS
	cfg.mk
	data/bison.m4
	doc/bison.texi
	m4/.gitignore
	tests/calc.at
	tests/headers.at
2012-07-06 11:00:57 +02:00
Akim Demaille
aca4ddc75d maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2012-07-05 16:29:06 +02:00
Akim Demaille
47977a7e74 version 2.5.90
* NEWS: Record release date.
2012-07-05 16:20:44 +02:00
Akim Demaille
c242519127 NEWS: minor changes.
* NEWS: style changes.
2012-07-05 12:41:09 +02:00
Akim Demaille
ccdc1577ef Merge remote-tracking branch 'origin/maint'
* origin/maint:
  tests: headers.at: strengthen.
  glr.cc: do not override C++ definitions by C macros.
  YYLLOC_DEFAULT: factor, and don't export it in headers.
  api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc.
  tests: portability fixes.
  c++: fewer #includes in the headers.
  glr.cc: formatting changes.
  tests: more logs.
  api.prefix: also rename YYDEBUG.

Conflicts:
	data/c.m4
	data/glr.c
	data/glr.cc
	data/lalr1.cc
	data/yacc.c
2012-07-04 17:34:57 +02:00
Akim Demaille
5f108727a1 api.prefix: also rename YYDEBUG.
The testsuite in master has shown weird errors for the "Mulitple
Parsers" tests: the caller of p5.parse() received some apparently
random value, while tracing p5.parse() showed that the function was
consistently returning 0.

It happens when mixing several parser headers, some generated without
%debug, others with.  In particular the C++ parser was generated with
%debug, i.e., with:

  #ifndef YYDEBUG
  # define YYDEBUG 1
  #endif

and compiled separatedly.  Yet, its header was included after the one
of another parser, this time without %debug, i.e., with

  #ifndef YYDEBUG
  # define YYDEBUG 0
  #endif

in its header.  As a result, the parser was compiled with YYDEBUG set,
but its header was used without.  Since the layout of the objects are
then completely different, boom.

Therefore, do not change the value of YYDEBUG.  Rather, use it as a
default value for <API.PREFIX>DEBUG.

* data/c.m4 (b4_YYDEBUG_define): New.
(b4_declare_yydebug): Rename as...
(b4_yydebug_declare): this, for consistency.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it.
* NEWS: Document it.
2012-07-04 12:24:12 +02:00
Akim Demaille
dcb366b103 NEWS: spell fixes.
* NEWS: here.
Reported by Stefano Lattarini.
2012-07-02 09:58:56 +02:00
Akim Demaille
5458913aba Merge remote-tracking branch 'origin/maint'
* origin/maint:
  NEWS: spell check.
  api.prefix.

Conflicts:
	data/c.m4
	data/glr.cc
	data/lalr1.cc
	doc/bison.texi
2012-07-02 09:56:01 +02:00
Akim Demaille
242cc08e8d NEWS: spell check.
* NEWS: here.
2012-07-02 09:26:22 +02:00
Akim Demaille
4b3847c3c0 api.prefix.
* data/c.m4 (b4_api_prefix, b4_api_PREFIX): New.
(b4_prefix, b4_union_name, b4_token_enums, b4_declare_yylstype): Use them.
* data/glr.c, data/yacc.c, data/glr.cc, data/lalr1.cc: Use them to change
the prefix of exported preprocessor symbols.
* src/getargs.c (usage): Ditto.
* tests/headers.at (Several parsers): New.
* tests/local.at (AT_API_PREFIX): New.
AT_YYSTYPE, AT_YYLTYPE): Adjust.
* doc/bison.texi (Multiple Parsers): Move documentation of %name-prefix to...
(Table of Symbols): here.
(Multiple Parsers): Document api.prefix.
(%define Summary): Point to it.
Use @code for variable names.
(Bison Options): -p/--name-prefix are obsoleted.
* NEWS: Announce api.prefix.
2012-06-29 17:40:42 +02:00
Victor Santet
73370a9daa warnings: display warnings categories
* src/complain.c (error_message): Call 'warnings_print_categories'.
* src/gram.c (grammar_rules_useless_report): Display itself warning
category.
* tests/actions.at, tests/conflicts.at, tests/existing.at,
tests/input.at, tests/named-refs.at, tests/output.at, tests/reduce.at,
tests/regression.at, tests/skeletons.at: Adjust.
* NEWS: Document this.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
2012-06-29 16:35:34 +02:00
Akim Demaille
7aaaad6c6d Merge remote-tracking branch 'origin/maint'
* origin/maint:
  tests: use the generalized default yylex.
  tests: AT_YYERROR_DEFINE: prepare for list of ints.
  skeletons: no longer define YYLSP_NEEDED.
  c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.

Conflicts:
	data/c.m4
	data/glr.cc
	data/lalr1.cc
	doc/bison.texi
	tests/regression.at
2012-06-28 15:42:00 +02:00
Akim Demaille
694af10cb7 skeletons: no longer define YYLSP_NEEDED.
* data/c.m4, data/glr.cc: here.
* NEWS, TODO: Adjust.
2012-06-27 10:03:23 +02:00
Akim Demaille
258cddbc36 c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.
* src/output.c (prepare_symbols): Do not define b4_token_table.
(prepare): Define b4_token_table_flag.
* data/bison.m4 (b4_token_table_if): New.
Arm it when error-verbose.
* data/glr.c, data/yacc.c (YYTOKEN_TABLE): Remove.
Use m4.
* data/lalr1.cc: Likewise.
(YYERROR_VERBOSE): Remove.
* NEWS, doc/bison.texi: Document this.
2012-06-27 10:03:21 +02:00
Akim Demaille
297e263a00 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  tests: do not output m4 set up.
  tests: use the generic yyerror function.
  tests: use assert instead of plain abort.
  tests: improve the generic yylex implementation.
  tests: generalize the compilation macros.
  tests: fix confusion between api.prefix and name-prefix.
  maint: gitignores.
  yacc: work around the ylwrap limitation.

Conflicts:
	NEWS
	tests/local.at
2012-06-26 16:44:59 +02:00
Victor Santet
ea9a35c605 warnings: raise warning for useless printers or destructors
* src/scan-code.h (code_props): Add field 'is_used'.
(CODE_PROPS_NONE_INIT): Adjust.
* src/scan-code.l (code_props_plain_init, code_props_symbol_action_init)
(code_props_rule_action_init): Instead of implementing several
times the initialization of the code_props structures,
use code_props_none_init.
* src/symtab.c (symbol_check_defined): If a symbol does not have a
destructor (resp. printer) but has a type which has a destructor (resp.
printer), then set field 'is_used' to true.
(semantic_type_check_defined): If a type has a destructor (resp. printer)
but all symbols of this type have already a destructor (resp. printer),
then raise a warning.
* tests/input.at (Useless printers or destructors): New.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
2012-06-26 15:57:46 +02:00
Victor Santet
9641b918ba warnings: useless semantic types
* src/symtab.h (symbol_list): Represent semantic types as structure
'semantic_type'.
* src/symlist.c (symbol_list_type_new): Allocate this structure.
(symbol_list_code_props_set): Set this semantic type's status to used if it
was not declared.
* src/symtab.c (semantic_types_sorted): New.
(semantic_type_new): Set the new semantic type's location appropriately.
(symbol_check_defined): If a symbol has a type, then set this type's status
to "declared".
(semantic_type_check_defined, semantic_type_check_defined_processor): Same
as symbol_check_defined and symbol_check_defined_processor, but for semantic
types.
(symbol_check_defined): Check semantic types usefulness.
* src/symtab.h (semantic_type): New fields 'location' and 'status'.
* src/symtab.h, src/symtab.c (semantic_type_new)
(semantic_type_from_uniqstr, semantic_type_get): Accept a location as a
supplementary argument.
* tests/input.at (Unassociated types used for printer of destructor): New.
* tests/c++.at (AT_CHECK_VARIANTS): Fix an error caught by this commit.
2012-06-25 11:29:14 +02:00
Akim Demaille
55d1006fce yacc: work around the ylwrap limitation.
* data/yacc.c (b4_shared_declarations): Include the header guards.
Do not include the header in the *.c file, duplicate it.
* NEWS (Future Changes): Extend, and announce the forthcoming change
about the use of the parser header.
2012-06-25 10:20:56 +02:00
Akim Demaille
6cf3716c31 Merge remote-tracking branch 'origin/maint'
* origin/maint:
  tests: more uniformity.
  tests: handle locations in a more generic way.
  tests: handle locations in the generic yyerror functions.
  tests: fix AT_CHECK_CALC.
  tests: improve infrastructure
  tests: factor.
  skeletons: minor style changes
  tests: AT_LANG.
  c skeletons: factor the declaration of yylloc and yylval.
  news: condemn YYPARSE_PARAM and YYLEX_PARAM.
  maint: regen.

Conflicts:
	tests/calc.at
	tests/local.at
	tests/regression.at
2012-06-25 09:46:34 +02:00