Commit Graph

2314 Commits

Author SHA1 Message Date
Paul Eggert
67961b9ea0 Add strdup.m4. 2004-12-09 07:55:04 +00:00
Paul Eggert
44aabce335 Add strdup.c, strdup.h. 2004-12-09 07:54:47 +00:00
Paul Eggert
00baeeac7e goto-number minor cleanup. 2004-12-08 07:30:21 +00:00
Paul Eggert
78143b92af (save_column, default_goto):
Use goto_number, not int, for goto numbers.
2004-12-08 05:54:51 +00:00
Paul Eggert
60e3ecc734 (set_goto_map): Don't allow ngotos to equal
GOTO_NUMBER_MAXIMUM, since we occasionally compute
ngotos + 1 without checking for overflow.
(build_relations): Use END_NODE, not -1, to denote end of edges.
(set_goto_map, map_goto, initialize_F, add_loopback_edge,
build_relations): Use goto_number, not int, for goto numbers.
2004-12-08 05:54:20 +00:00
Paul Eggert
b03595a5c2 (GOTO_NUMBER_MAXIMUM): New macro. 2004-12-08 05:53:55 +00:00
Akim Demaille
be3d9d4219 2004-11-23 Akim Demaille <akim@epita.fr>
* data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
	of #defining from yystype.
	Don't typedef yystype, C++ does not need it.
	This lets it possible to forward declare it as union.
2004-11-23 19:56:12 +00:00
Paul Eggert
78e526d5fa * bootstrap (gnulib_modules): Add extensions. 2004-11-23 08:50:37 +00:00
Paul Eggert
42e826a47d (gnulib_modules): Add extensions. 2004-11-23 08:50:17 +00:00
Paul Eggert
afbb696d19 XFREE -> free 2004-11-22 21:05:25 +00:00
Akim Demaille
c1f8f16a9b * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings. 2004-11-17 16:48:45 +00:00
Akim Demaille
9a1e998918 Alexandre Duret-Lutz <adl@gnu.org>
* data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
changes.
(YYCDEBUG): Adjust.
Use it instead of cdebug_.
(Parser::debug_stream, Parser::set_debug_stream): New.
(Parser::symprint_): Define cdebug_ for temporary backward
compatibility.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
debug_stream ().
2004-11-17 16:17:50 +00:00
Akim Demaille
85c19f8819 Remove an entry that was not actually committed, yet. 2004-11-17 16:12:46 +00:00
Akim Demaille
68e11668e4 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
* tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
* tests/calc.at (_AT_DATA_CALC_Y): Ditto.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2004-11-17 14:19:37 +00:00
Akim Demaille
e268877e7e This ChangeLog entry belongs to the previous patch. 2004-11-17 14:13:38 +00:00
Paul Eggert
b9b51bf05a Fix wording problem in comment. 2004-10-27 22:22:51 +00:00
Paul Eggert
97cbc73e2a * data/glr.c (yyloc_default): Remove; not used. 2004-10-27 22:20:01 +00:00
Paul Eggert
288006a259 (yyloc_default): Remove; not used. 2004-10-27 22:19:44 +00:00
Paul Eggert
f74b6f91f6 Goto numbers are no longer arbitrarily limited to 16-bit counts. 2004-10-25 16:26:20 +00:00
Akim Demaille
e342c3beaf * data/glr.c (YYRHSLOC): Move its definition next to its uses.
Introduce another definition to address simple location arrays.
(yyGLRStack): New member: yyerror_range.
(yyrecoverSyntaxError, yyparse): Update it.
(yyrecoverSyntaxError): Use it when shifting the error token to
have an accurate range, equivalent to the one computed by both
yacc.c and lalr1.cc.
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
that column numbers start at column 0, as per GNU Coding
Standards, the others tests, and the doc.
(_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
Adjust to the above change (first column is 0).
And adjust the location of the "<error>", now covering the whole
line.
2004-10-25 10:37:35 +00:00
Paul Eggert
93602febc0 Remove some arbitrary limits on goto numbers and relations. 2004-10-22 23:35:17 +00:00
Paul Eggert
7886c2d419 Use size_t rather than unsigned int in previous patch. 2004-10-22 23:14:00 +00:00
Paul Eggert
ed4cdb7afc (END_NODE): New macro.
(relation_node): Now unsigned int, not short int.
2004-10-22 23:10:39 +00:00
Paul Eggert
0859e438eb (relation_print, traverse, relation_transpose):
Check for END_NODE rather than looking at sign.
2004-10-22 23:10:07 +00:00
Paul Eggert
f55ec70868 (goto_number): Now unsigned int, not short int.
(GOTO_NUMBER_MAXIMUM): Remove.
2004-10-22 23:09:27 +00:00
Paul Eggert
4cf44c0045 (goto_map, ngotos, from_state, to_state): Omit
initial values, since they're never used.
(set_goto_map): ngotos is now unsigned, so test for overflow
2004-10-22 23:08:33 +00:00
Paul Eggert
dba08b0461 doc/bison.texinfo (Language and Grammar): In example, "int" is a
keyword, not an identifier.
2004-10-22 18:12:50 +00:00
Paul Eggert
14d4662b83 (Language and Grammar): In example, "int" is a keyword, not an identifier. 2004-10-22 18:10:59 +00:00
Akim Demaille
df09ef2e8f * src/symtab.c (symbol_check_alias_consistency): Also check
type names, destructors, and printers.
Reported by Alexandre Duret-Lutz.
Recode the handling of associativity and precedence in terms
of symbol_precedence_set.
Accept no redeclaration at all, not even equal to the previous
value.
(redeclaration): New.
Use it to factor redeclaration complaints.
(symbol_make_alias): Don't set the type of the alias, let
symbol_check_alias_consistency do it as for other features.
* src/symtab.h (symbol): Add new member prec_location, and
type_location.
* src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
* tests/input.at (Incompatible Aliases): New.
2004-10-11 09:03:55 +00:00
Paul Eggert
2ed24dd8c7 Regenerate. 2004-10-09 18:08:21 +00:00
Paul Eggert
146bc99dcf .cvsignore fixes to accommodate gnulib changes,
and the practice of naming build directories "_build".
2004-10-09 17:59:04 +00:00
Paul Eggert
7d1be3bdff Add "*_gl.m4". 2004-10-09 17:57:39 +00:00
Paul Eggert
bd22e8363a Add getopt_.h, xalloc-die.c. 2004-10-09 17:57:21 +00:00
Paul Eggert
13c29075c5 Add "_*". Sort. 2004-10-09 17:57:06 +00:00
Akim Demaille
e503aa60d5 * src/parse-gram.y (add_param): Fix the truncation of trailing
spaces.
2004-10-06 15:52:24 +00:00
Akim Demaille
2c0ddf03ab Word changes. 2004-10-05 09:58:58 +00:00
Akim Demaille
8a8dc872fa Regen. 2004-10-05 08:41:44 +00:00
Akim Demaille
b4a2033855 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
whether the reducion was empty or not.  This leaves room to
improve the use of YYLLOC_DEFAULT in such a case.
lalr1.cc is still experimental, so changing this is acceptable.
And finally, there are probably not many users who changed the
handling of locations in GLR, so changing is admissible too.
* data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
empty reduction, set @$ to an empty location ending the previously
stacked symbol.
Adjust uses to make sure the code is triggered on empty
reductions.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
expected output: empty reductions have empty locations.
2004-10-05 08:39:17 +00:00
Akim Demaille
f85a5e6f4b * data/lalr1.cc: Move towards a more standard C++ coding style
for templates: Class < T > -> Class<T>.
2004-09-29 12:49:50 +00:00
Akim Demaille
b203fc2c07 * data/lalr1.cc: Reinstall the former ctor, for sake of
compatibility, but warn it will be removed.
Move towards a more standard C++ coding style (i.e., type *var ->
type* var).
2004-09-29 12:41:58 +00:00
Paul Eggert
3fee967f83 Fix comment in latest checkin; there wasn't a bug. 2004-09-27 22:06:45 +00:00
Paul Eggert
5b7e1e73e6 * src/parse-gram.y (add_param): Fix bug where NUL was mishandled. 2004-09-27 22:04:13 +00:00
Paul Eggert
ead9e56eb2 (add_param): Fix bug where NUL was mishandled.
Avoid the use of strchr to avoid future recurrences.
2004-09-27 22:03:42 +00:00
Akim Demaille
0dcca5c22f * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration. 2004-09-27 07:47:47 +00:00
Akim Demaille
6dde1c82cd * data/lalr1.cc (b4_parse_param_decl_1): New.
(b4_parse_param_decl): Use it to have different names bw attribute
and argument names.
(b4_cc_constructor_call): Likewise.
2004-09-27 07:45:09 +00:00
Akim Demaille
b233d5558f * src/parse-gram.y (add_param): Strip the leading and trailing
blanks from a formal argument declaration.
(YY_LOCATION_PRINT): New.
2004-09-27 07:42:04 +00:00
Akim Demaille
619404e3fd * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
after the location.
2004-09-24 14:14:58 +00:00
Akim Demaille
dd8d90221a * doc/bison.texinfo (Table of Symbols): Sort. 2004-09-24 11:55:40 +00:00
Akim Demaille
0092f063af * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
the useless parentheses.
Suggested by Paul Eggert.
2004-09-21 06:59:19 +00:00
Akim Demaille
451364edb1 Let the initial-action act on the look-ahead, and use it for the
"initial push" (corresponding to an hypothetical beginning-of-file).
And let lalr1.cc honor %initial-action.
* doc/bison.texinfo (Initial Action Decl): Clarify, and add an
example.
* data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
(Parser::Parser): Remove the ctor that used to initialize it.
(Parser::parse): Like in the other skeletons, issue the "starting
parse" message before any action.
Honor %initial-action.
Initialize the stacks with the lookahead.
* data/yacc.c: Let $$ and @$ in %initial-action designate the
look-ahead.
Push them in the stacks.
* tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
2004-09-20 15:25:25 +00:00