Commit Graph

1002 Commits

Author SHA1 Message Date
Paul Eggert
ad8a3efc5a (print_token_value): Renamed from yyprint.
All uses changed.
(YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove.  All uses changed.
The name "yycontrol" violates the name space rules, and this stuff
wasn't being used anyway.
(input): Remove action; this stuff wasn't being used.
(gram_error): Rename local variable yylloc -> loc.
2002-11-27 18:33:18 +00:00
Paul Eggert
4344c500b5 (get_color_str, get_textmode_str, get_shape_str,
get_layoutalgorithm_str, get_decision_str, get_orientation_str,
get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
get_view_str, get_linestyle_str, get_arrowstyle_str): Use abort rather
than assert.
2002-11-21 05:26:41 +00:00
Paul Eggert
443594d0c4 (conflict_row, pack_vector): Use abort rather than assert.
(tables_generate): Use verify rather than assert.
2002-11-21 05:25:55 +00:00
Paul Eggert
87aabbff99 Do not include <assert.h>.
(verify): New macro.
2002-11-21 05:24:53 +00:00
Paul Eggert
2f82502a6f (symbol_user_token_number_set, symbol_make_alias, symbol_pack):
Use abort rather than assert.
2002-11-21 05:23:46 +00:00
Paul Eggert
fe22d5d20f (struniq_assert): Now returns void, and aborts if the assertion is false. 2002-11-21 05:22:29 +00:00
Paul Eggert
ec14f0c83f (state_new, state_free, state_transitions_set, state_reduction_find):
Use abort rather than assert.
2002-11-21 05:21:35 +00:00
Paul Eggert
35dcf428c9 (packgram, reader): Use abort rather than assert. 2002-11-21 05:20:49 +00:00
Paul Eggert
a932883e41 (prepare_rules, token_definitions_output): Use abort rather than assert. 2002-11-21 05:20:05 +00:00
Paul Eggert
b475e0cce5 (nullable_compute): Use abort rather than assert. 2002-11-21 05:18:57 +00:00
Paul Eggert
58a84254ef (set_goto_map, map_goto): Use abort rather than assert. 2002-11-21 05:18:08 +00:00
Paul Eggert
7223426a2b (trace_argmatch, report_argmatch): Use verify rather than assert. 2002-11-21 05:17:21 +00:00
Paul Eggert
b9a0104860 (resolve_sr_conflict): Use abort rather than assert. 2002-11-21 05:16:36 +00:00
Akim Demaille
60a3dcf956 Really remove it. 2002-11-16 12:36:30 +00:00
Akim Demaille
c5e3e51055 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
Add support for --trace=skeleton.
* src/scan-skel.l: %option debug.
Scan strings of non-@ or n instead of character by character.
(scan_skel): Handle trace_skeleton.
(QPUTS): New.
(@output_parser_name@, @output_header_name@): ``Restore'' their
support (used to be M4 macros).
* data/yacc.c: Quote larger chunks, a la glr.c.
* data/lalr1.cc: Likewise.
The header guards are no longer available, so use some other
string than `YYLSP_NEEDED'.
2002-11-16 12:31:36 +00:00
Paul Eggert
f0616f0b5c Regenerate. 2002-11-15 20:58:07 +00:00
Paul Eggert
6e649e659e * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
tests/action.at, tests/calc.at, tests/conflicts.at,
tests/cxx-type.at, tests/regression.at:
"parse error" -> "syntax error" for POSIX compatibility.
"parsing stack overflow..." -> "parser stack overflow" so
that code matches Bison documentation.
2002-11-15 20:32:21 +00:00
Akim Demaille
0f39aab92a * src/parse-gram.y (declaration): Have %parse-param and %lex-param
take two BRACED_CODE, not two string_content.
Free the scanner's obstack when we are done.
(code_content): New.
* tests/calc.at: Adjust.
* doc/bison.texinfo: Adjust.
Also, make sure to include the `,' for these declarations.
2002-11-15 16:42:16 +00:00
Akim Demaille
0258d1661c 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
* src/.cvsignore: Add src-gram.c.
* tests/.cvsignore: Add atlocal.
* config/.cvsignore, m4/.cvsignore, po/.cvsignore:
Add several files that autoreconf may bring in during
bootstrap.
2002-11-15 09:04:37 +00:00
Paul Eggert
93ba6bf344 (output_skeleton): Call xfopen instead of duplicating xfopen's body. 2002-11-15 01:28:40 +00:00
Paul Eggert
412f8a5975 Revamp regular expressions so that " and '
do not confuse xgettext.
2002-11-13 06:40:35 +00:00
Paul Eggert
0eae1c91c8 (struniq_new): Do not declare the return type
to be 'const'; this violates the C standard.
2002-11-13 06:27:18 +00:00
Akim Demaille
be14ade55e * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
linker.
2002-11-12 17:51:38 +00:00
Akim Demaille
886b69d197 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
not yyvalue.
2002-11-12 09:44:41 +00:00
Akim Demaille
b1ae9233bc * src/tables.c (tables_generate): Use free for pointers that
cannot be NULL, not XFREE.
(pack_vector): Use assert, not fatal, for bound violations.
* src/state.c (state_new): Likewise.
* src/reader.c (reader): Likewise.
* src/lalr.c (set_goto_map): Likewise.
* src/location.h (LOCATION_PRINT): If first_line is 0, just issue
the file name.
2002-11-12 08:30:47 +00:00
Akim Demaille
7ec2d4cd39 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
Restore.
* src/scan-gram.l (last_string): Is global to the file, not to
yylex.
* src/parse-gram.y (input): Don't append the epilogue here,
(epilogue.opt): do it here, and free the scanner's obstack.
* src/reader.c (epilogue_set): Rename as...
(epilogue_augment): this.
* data/c.m4 (b4_epilogue): Defaults to empty.
2002-11-12 08:26:38 +00:00
Akim Demaille
573a6cd356 * src/getargs.c (long_options): Remove duplicates.
* src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
Remove.
* doc/bison.rnh: Remove.
* doc/bison.texinfo (VMS Invocation): Remove.
2002-11-12 08:13:10 +00:00
Akim Demaille
95612cfa60 * src/struniq.h, src/struniq.c (struniq_t): Is const.
(STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
Use struniq for symbols.
* src/symtab.h (symbol_t): The tag member is a struniq.
(symbol_type_set): Adjust.
* src/symtab.c (symbol_new): Takes a struniq.
(symbol_free): Don't free the tag member.
(hash_compare_symbol_t, hash_symbol_t): Rename as...
(hash_compare_symbol, hash_symbol): these.
Use the fact that tags as struniqs.
(symbol_get): Use struniq_new.
* src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
Returns a strniq.
* src/reader.h (merger_list, grammar_currentmerge_set): The name
and type members are struniqs.
* src/reader.c (get_merge_function)
(grammar_current_rule_merge_set): Adjust.
(TYPE, current_type): Are struniq.
Use struniq for file names.
* src/files.h, src/files.c (infile): Split into...
(grammar_file, current_file): these.
* src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
* src/reduce.c (reduce_print): Likewise.
* src/getargs.c (getargs): Likewise.
* src/complain.h, src/complain.c: Likewise.
* src/main.c (main): Call struniqs_new early enough to use it for
file names.
Don't free the input file name.
2002-11-12 08:05:59 +00:00
Akim Demaille
3e6656f9ab * src/symtab.c (symbol_free): Remove dead deactivated code:
type_name are properly removed.
Don't use XFREE to free items that cannot be NULL.
* src/struniq.h, src/struniq.c: New.
* src/main.c (main): Initialize/free struniqs.
* src/parse-gram.y (%union): Add astruniq member.
(yyprint): Adjust.
* src/scan-gram.l (<{tag}>): Return a struniq.
Free the obstack bit that used to store it.
* src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2002-11-12 07:55:55 +00:00
Paul Eggert
62ddaef6a7 Regenerate. 2002-11-12 07:44:22 +00:00
Paul Eggert
ea44c25efc No need to keep this file in CVS, since it's automatically generated. 2002-11-12 07:40:11 +00:00
Paul Eggert
e9683cfd3d (yylineno, yyoutname): Remove static vars, replacing
them with auto vars.
Switch to new escape scheme, where @ is the escape character uniformly.
Abort if a stray escape character is found.  Avoid unbounded input
buffer when parsing non-escaped text.
2002-11-12 07:27:51 +00:00
Paul Eggert
ac060e78a3 (<SC_CHARACTER>): Don't worry about any backslash
escapes other than \\ and \'; this simplifies the code.
(<SC_STRING>): Likewise, for \\ and \".
(<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
Use new escapes @{ and @} for [ and ].
2002-11-12 07:27:04 +00:00
Paul Eggert
6c239755dc (prologue_augment, epilogue_set):
Quote filenames for C and M4.
2002-11-12 07:26:27 +00:00
Paul Eggert
3813e141f8 (escaped_file_name_output): New function.
(prepare_symbols): Quote tokens for M4.
(prepare): Don't insert output_infix, output_prefix,
output_parser_name, output_header_name; this is now down by scan-skel.
Insert skeleton as a C string.
(user_actions_output, symbol_destructors_output,
symbol_printers_output): Quote filenames for C and M4.
2002-11-12 07:25:36 +00:00
Paul Eggert
a027c30d42 (MUSCLE_GROW_STRING_PAIR): Remove; unused.
(MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2002-11-12 07:24:33 +00:00
Paul Eggert
4e956a7d9e Include quotearg.h, since we need to quote C strings now.
(muscle_init): Quote filename as a C string.
2002-11-12 07:23:52 +00:00
Paul Eggert
42481a1fd1 (output_infix): Remove; all uses removed. 2002-11-12 07:23:13 +00:00
Paul Eggert
345532d70b (unexpected_end_of_file): Fix bug: columns were counted in the token
inserted at end of file.  Now takes location_t *, not location_t, so
that the location can be adjusted.  All uses changed.
2002-11-10 05:17:56 +00:00
Paul Eggert
09d353a08f (scanner_last_string_free): Remove decl. 2002-11-08 06:14:29 +00:00
Paul Eggert
a706a1cc03 Remove stack option. We no longer use the stack, since the stack was
never deeper than 1; instead, use the new auto var c_context to record
the stacked value.

Remove nounput option.  At an unexpected end of file, we now unput
the minimal input necessary to end cleanly; this simplifies the
code.

Avoid unbounded token sizes where this is easy.

(unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
(last-string): Now auto, not static.
(YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
(scanner_last_string_free): Remove; not used.
(percent_percent_count): Move decl to just before use.
(SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
not the (never otherwised-used) CHARACTER.
2002-11-08 05:20:20 +00:00
Paul Eggert
87fbb0bffc (CHARACTER): Remove unused token. All uses removed. 2002-11-08 05:19:30 +00:00
Akim Demaille
0e25cad542 Regen. 2002-11-07 12:50:34 +00:00
Paul Eggert
8e6ef48342 (unexpected_end_of_file): New function.
Use it to systematize the error message on unexpected EOF.
2002-11-07 08:15:11 +00:00
Akim Demaille
6e40b4ebd4 #line should have quoted strings.
Ideally, this should be done by m4_quotearg.
* src/scan-skel.l: Include quotearg.h.
Quote __ofile__.
* src/output.c (symbol_printers_output)
(symbol_destructors_output): Quote the file name.
2002-11-06 16:22:04 +00:00
Akim Demaille
437c2d8000 Restore --no-lines.
Reported by Jim Kent.
* data/c.m4 (b4_syncline): New.
* data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
* src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
* src/output.c (user_actions_output): Likewise.
(prepare): Define 'b4_synclines_flag'.
2002-11-06 14:11:47 +00:00
Akim Demaille
900c5db537 * src/main.c (main): Free `infile'.
* src/scan-gram.l (handle_syncline): New.
Recognize `#line'.
* src/output.c (user_actions_output, symbol_destructors_output)
(symbol_printers_output): Use the location's file name, not
infile.
* src/reader.c (prologue_augment, epilogue_set): Likewise.
2002-11-06 08:08:46 +00:00
Paul Eggert
98f2caaa5f Use more accurate diagnostics, e.g.
"integer out of range" rather than "invalid value".
2002-11-06 07:01:06 +00:00
Paul Hilfinger
51b4a04cd0 src/tables.c (matching_state): Don't allow states to match if
either has GLR conflict entries.
ChangeLog: update for this and Hilfinger's preceding test-suite	addition.
2002-11-06 02:46:08 +00:00
Paul Eggert
d04946c717 Regenerate. 2002-11-06 00:06:50 +00:00