Commit Graph

579 Commits

Author SHA1 Message Date
Robert Anisko
374f5a14de * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
location as yylloc and location as yyloc.  Use YYLLOC_DEFAULT, and
provide a default implementation.
2002-03-04 16:37:52 +00:00
Akim Demaille
bfcf1f3af0 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
* tests/output.at (AT_CHECK_OUTPUT): Likewise.
* tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
* tests/semantic.at (Parsing Guards): Similarly.
* src/reader.at (readgram): Complain if the last rule is not ended
with a semi-colon.
2002-03-04 16:23:35 +00:00
Akim Demaille
65ccf9fc1d * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
* src/closure.c: here.
(set_firsts): Use bitsetv_reflexive_transitive_closure instead of
RTC.
* src/warshall.h, src/warshall.c: Remove.
* tests/sets.at (Broken Closure): Adjust.
2002-03-04 14:29:27 +00:00
Akim Demaille
d0039cbcf8 * src/output.c (output_skeleton): tempdir is const.
bytes_read is unused.
2002-03-04 14:17:30 +00:00
Akim Demaille
345cea780a * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
Update.
From Michael Hayes.
2002-03-04 14:15:01 +00:00
Akim Demaille
564801f795 * src/closure.c (closure): `r' is unused. 2002-03-04 14:13:12 +00:00
Akim Demaille
b23e820381 Regen. 2002-03-04 14:04:09 +00:00
Akim Demaille
e5352bc7bf * tests/sets.at (Broken Closure): Add the ending `;'.
* src/reader.at (readgram): Complain if a rule is not ended with a
semi-colon.
2002-03-04 13:58:20 +00:00
Akim Demaille
914feea9d0 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
(count_sr_conflicts): Use bitset_count.
* src/reduce.c (inaccessable_symbols): Ditto.
(bits_size): Remove.
* src/warshall.h, src/warshall.c: Convert to bitsetv.
2002-03-04 13:58:05 +00:00
Akim Demaille
f0250de62e * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
* src/reduce.c: Remove the `bitset_zero's following the
`bitset_create's, as now it is performed by the latter.
2002-03-04 13:56:41 +00:00
Akim Demaille
ef01750240 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
* lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
* lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
latest sources from Michael.
2002-03-04 12:07:08 +00:00
Akim Demaille
7651439487 * src/output.c (output): Don't free the grammar.
* src/reader.c (grammar_free): New.
* src/main.c (main): Call it and don't free symtab here.
2002-03-04 12:06:42 +00:00
Akim Demaille
550245801e * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
before returning.
Reported by Benoit Perrot.
2002-03-04 12:06:07 +00:00
Akim Demaille
f9abaa2c4c Use bitset operations when possible, not loops over bits.
* src/conflicts.c (set_conflicts, count_sr_conflicts): Use
bitset_or.
* src/print.c (print_reductions): Use bitset_and, bitset_andn.
* src/reduce.c (useless_nonterminals): Formatting changes.
* src/warshall.c (TC): Use bitset_or.
2002-03-04 12:05:30 +00:00
Akim Demaille
0e721e7569 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
* src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
Ditto.
2002-03-04 12:05:15 +00:00
Akim Demaille
0fb1ffb1bf * src/lalr.c (F): Now a bitset*.
Adjust all dependencies.
2002-03-04 12:04:47 +00:00
Akim Demaille
b86796bf87 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
Adjust all dependencies.
2002-03-04 12:04:33 +00:00
Akim Demaille
602bbf31c1 * src/L0.c, src/LR0.h (nstates): Be size_t.
Adjust comparisons (signed vs unsigned).
* src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
bitset*.
Adjust all dependencies.
2002-03-04 12:03:36 +00:00
Akim Demaille
d8a0245ce7 * src/closure.c (firsts): Now, also a bitset.
Adjust all dependencies.
(varsetsize): Remove, now unused.
* src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
2002-03-04 12:03:01 +00:00
Akim Demaille
34ba97434f * src/print.c: Convert to use bitset.h, not hand coded iterations
over ints.
2002-03-04 12:02:16 +00:00
Akim Demaille
ed86e78c90 * src/reduce.c: Convert to use bitset.h, not hand coded BSet. 2002-03-04 12:01:44 +00:00
Akim Demaille
dfdb1797c3 * src/closure.c (ruleset): Be a bitset.
(rulesetsize): Remove.
2002-03-04 11:59:18 +00:00
Akim Demaille
7086e7071e * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
* lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
* src/closure.c (fderives): Be an array of bitsets.
2002-03-04 11:58:52 +00:00
Robert Anisko
98254360e3 * data/bison.c++: Merge the two generated headers. Insert a copyright
notice in each output file.
2002-02-28 14:56:33 +00:00
Akim Demaille
a75c057f10 * data/bison.c++: Copy the prologue of bison.simple to fetch
useful M4 definitions, such as b4_header_guard.
2002-02-28 11:41:00 +00:00
Akim Demaille
06b00abcdd * src/getargs.c (version): Give the name of the authors, and use a
translator friendly scheme for the copyright notice.
2002-02-25 14:26:28 +00:00
Akim Demaille
70e7d534a9 * src/output.c (header_output): Remove, now handled completely via
M4.
2002-02-25 14:06:53 +00:00
Akim Demaille
abe017f60d * m4/m4.m4: New, from CVS Autoconf.
* configure.in: Invoke it.
* src/output.c (output_skeleton): Use its result instead of the
hard coded name.
2002-02-25 14:00:57 +00:00
Akim Demaille
381fb12e1e * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
Fileutils 4.1.5.
* configure.in: Invoke UTILS_FUNC_MKSTEMP.
* src/output.c (output_skeleton): Use mkstemp to create a real
temporary file.
Move the filling of `skeleton' and its muscle to...
(prepare): here.
(output): Move the definition of the prologue muscle to...
(prepare): here.
* src/system.h (DEFAULT_TMPDIR): New.
2002-02-25 13:44:43 +00:00
Paul Eggert
6f38107f80 Remove the support for C++ namespace cleanliness; it was
causing more problems than it was curing, since it didn't work
properly on some nonstandard C++ compilers.  This can wait
for a proper C++ parser.

* NEWS: Document this.
* doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
of C++, as it's treated like C now.
* src/bison.simple (YYSTD): Remove.
(YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
Treat C++ just like Standard C instead of trying to support
namespace cleanliness.
2002-02-14 20:29:31 +00:00
Akim Demaille
80cce3da95 * tests/regression.at (else): Adjust to Andreas' change. 2002-02-14 12:35:32 +00:00
Akim Demaille
842e86794f * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c. 2002-02-14 11:51:42 +00:00
Akim Demaille
4bda3f10ca * src/output.c (output_rule_data): Don't output NULL, it might
not be defined yet.
2002-02-13 18:35:03 +00:00
Akim Demaille
bd16a5dcf5 Fix ChangeLog. 2002-02-11 16:28:40 +00:00
Robert Anisko
4162fa07ae * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
(Copyright notice): Update.
2002-02-11 14:15:51 +00:00
Akim Demaille
b418ecd84f * tests/regression.at (%nonassoc and eof): Don't include
nonportable headers.
2002-02-11 13:38:43 +00:00
Robert Anisko
8d69a1a3ae * data/bison.c++: Correct error recovery. Make the user able to
initialize the starting location.
2002-02-08 14:07:10 +00:00
Akim Demaille
9b2d067768 * tests/input.at: New. 2002-02-07 17:18:49 +00:00
Robert Anisko
69e2658bf6 * data/bison.c++: Replace some direct m4 expansions by constants. Be
more consistent when naming methods and variables.  Put preprocessor
directives around tables only needed for debugging.
2002-02-07 16:41:23 +00:00
Robert Anisko
4aacc3a71d * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
C++ parsers.
(yy::b4_name::parse): Use print_.
2002-02-07 14:41:46 +00:00
Robert Anisko
762a801e00 * data/bison.c++ (yy::b4_name::parse): Error recovery is back. 2002-02-07 13:02:40 +00:00
Robert Anisko
4bb2bc3f61 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
C++ parsers.
(yy::b4_name::parse): Build verbose error messages, and use error_.
2002-02-07 11:35:40 +00:00
Robert Anisko
6b45a3ca82 * data/bison.c++: Fix m4 quoting in comments. 2002-02-06 15:17:57 +00:00
Robert Anisko
50997c6eeb * data/bison.c++: Adjust the parser code. Fix some muscles that were
not expanded by m4.
2002-02-06 14:22:44 +00:00
Akim Demaille
ea6cfe9ebd Really add m4sugar to the repo. 2002-02-05 10:13:16 +00:00
Akim Demaille
3f3eed2770 * data/bison.c++: Adjust to the M4 back end.
More is certainly needed.
2002-02-05 10:09:49 +00:00
Akim Demaille
be2a1a68ef Give a try to M4 as a back end.
* lib/readpipe.c: New, from wdiff.
* src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
BISON_HAIRY.
* src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
specific values.  Now it is m4 that performs the lookup.
* src/parse-skel.y: Remove.
* src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
* src/output.c (actions_output, guards_output)
(token_definitions_output): No longer keeps track of the output
line number, hence remove the second argument.
(guards_output): Check against the guard member of a rule, not the
action member.
Adjust callers.
(output_skeleton): Don't look for the skeleton location, let m4 do
that.
Create `/tmp/muscles.m4'.  This is temporary, a proper temporary
file will be used.
Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
(prepare): Given that for the time being changesyntax is not
usable in M4, rename the muscles using `-' to `_'.
Define `defines_flag', `output_parser_name' and `output_header_name'.
* src/output.h (actions_output, guards_output)
(token_definitions_output): Adjust prototypes.
* src/scan-skel.l: Instead of scanning the skeletons, it now
processes the output of m4: `__oline__' and `#output'.
* data/bison.simple: Adjust to be used by M4(sugar).
* tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
to date.
* tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
* data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
shamelessly stolen from CVS Autoconf.
2002-02-05 10:08:59 +00:00
Akim Demaille
8e86444744 Revert the previous patch. 2002-02-05 10:04:24 +00:00
Akim Demaille
beda758b1f * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
* configure.in: Check for the declarations of free and malloc.
* src/muscle_tab.c: Adjust.
2002-02-05 10:00:47 +00:00
Akim Demaille
5ece6d436f * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
which have no values.
2002-02-05 09:58:57 +00:00