Commit Graph

477 Commits

Author SHA1 Message Date
Akim Demaille
06446ccf94 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
Adding #line.
Remove the duplicate `typedefs'.
(RhsNumberType): Fix the declaration and various other typos.
Use __ofile__.
* data/bison.simple: Use __ofile__.
* src/scan-skel.l: Handle __ofile__.
2002-04-08 12:31:15 +00:00
Akim Demaille
62a3e4f0c5 * src/gram.h (item_number_t): New, the type of item numbers in
RITEM.  Note that it must be able to code symbol numbers as
positive number, and the negation of rule numbers as negative
numbers.
Adjust all dependencies (pretty many).
* src/reduce.c (rule): Remove this `short *' pointer: use
item_number_t.
* src/system.h (MINSHORT, MAXSHORT): Remove.
Include `limits.h'.
Adjust dependencies to using SHRT_MAX and SHRT_MIN.
(shortcpy): Remove.
(MAXTABLE): Move to...
* src/output.c (MAXTABLE): here.
(prepare_rules): Use output_int_table to output rhs.
* data/bison.simple, data/bison.c++: Adjust.
* tests/torture.at (Big triangle): Move the limit from 254 to
500.
* tests/regression.at (Web2c Actions): Ajust.
Trying with bigger grammars shows various phenomena: at 3000 (28Mb
of grammar file) bison is killed by my system, at 2000 (12Mb) bison
passes, but produces negative #line number, once fixed, GCC is
killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
C), it passes.
* src/state.h (state_h): Code input lines on ints, not shorts.
2002-04-08 11:46:26 +00:00
Akim Demaille
680e8701b5 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
* src/output.c (output_table_data): Return the longest number.
(prepare_tokens): Output `token_number_max').
* data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
New.
Use them to define yy_token_number_type/TokenNumberType.
Use this type for yytranslate.
* tests/torture.at (Big triangle): Push the limit from 124 to
253.
* tests/regression.at (Web2c Actions): Adjust.
2002-04-07 17:44:59 +00:00
Akim Demaille
26b23c1a49 * data/bison.c++, data/bison.simple: Don't output the current file
name in #line, to avoid useless diffs between two identical
outputs under different names.
2002-04-07 15:30:31 +00:00
Akim Demaille
e53c632297 * src/conflicts.c (log_resolution): Argument `resolution' is const. 2002-03-20 09:35:27 +00:00
Paul Eggert
5b041382df (YYCOPY): New macro.
(YYSTACK_RELOCATE): Use it.
Remove Type arg; no longer needed.  All callers changed.
(yymemcpy): Remove; no longer needed.
2002-03-20 07:28:52 +00:00
Akim Demaille
642cb8f829 Test and fix the #line outputs.
* tests/atlocal.at (GCC): New.
* tests/synclines.at (AT_TEST_SYNCLINE): New macro.
(Prologue synch line, ,%union synch line, Postprologue synch line)
(Action synch line, Epilogue synch line): New tests.
* src/reader.c (parse_union_decl): Define the muscle stype_line.
* data/bison.simple, data/bison.c++: Use it.
2002-03-19 08:16:25 +00:00
Akim Demaille
0d8bed5636 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
* data/bison.simple, data/bison.c++: Handle the `#define' part, so
that we can move to enums for instance.
* src/output.c (token_definitions_output): Output a list of
`token-name, token-number' instead of the #define.
(output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
2002-03-19 07:48:47 +00:00
Robert Anisko
af27eacb6a * data/bison.c++: Make the user able to add members to the generated
parser by subclassing.
2002-03-09 14:31:16 +00:00
Robert Anisko
64dba31e7f * data/bison.c++: Remove a debug line. 2002-03-04 16:48:33 +00:00
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
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
2794679661 New. 2002-02-25 14:27:12 +00:00
Paul Eggert
45119af166 (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:27:45 +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
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
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
5bb18f9a19 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
* data/: here.
2002-02-05 09:57:52 +00:00