Commit Graph

860 Commits

Author SHA1 Message Date
Akim Demaille
bec30531f7 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition. 2002-01-21 15:50:39 +00:00
Marc Autret
fc6edc45c0 * src/files.c (compute_output_file_names): Fix 2002-01-20 15:59:34 +00:00
Marc Autret
5e5d541531 * tests/output.at: New test.
* src/files.c (compute_base_names): Don't map extensions when
the YACC flag is set, use defaults.
Reported by Evgeny Stambulchik.
2002-01-20 15:46:19 +00:00
Marc Autret
52d1aeee3d Update. 2002-01-20 14:37:39 +00:00
Marc Autret
44ea3fbdf5 * src/system.h: Need to define __attribute__ away for non-GCC
compilers as well (i.e.	the vendor C compiler).
Suggested by Albert Chin-A-Young.
2002-01-20 11:34:02 +00:00
Tim Van Holder
338963d177 * src/system.h, lib/hash.h, lib/hash.c: PARAMS fixes. 2002-01-11 15:32:06 +00:00
Tim Van Holder
e1dd105c0a * src/system.h: Use canonical definition for PARAMS (avoids clash with macro from hash.h). 2002-01-11 15:27:54 +00:00
Tim Van Holder
a10778dc32 * lib/hash.h, lib/hash.c (__P): Renamed to PARAMS; canonical definition used. 2002-01-11 15:26:56 +00:00
Akim Demaille
d9e9746c06 More thanks. 2002-01-11 13:37:39 +00:00
Akim Demaille
c57b2479ff * configure.in: Use AC_FUNC_STRNLEN. 2002-01-11 13:33:05 +00:00
Akim Demaille
b85810aec0 * src/files.c, src/files.h (output_infix): New.
(tab_extension): Remove.
(compute_base_names): Compute the former, drop the latter.
* src/output.c (prepare): Insert the muscles `output-infix', and
`output-suffix'.
* src/parse-skel.y (string, string.1): New.
(section.header): Use it.
(section.yacc): Remove.
(prefix): Remove too.
* src/scan-skel.l: Adjust.
* src/bison.simple, src/bison.hairy: Adjust.
2002-01-09 13:03:45 +00:00
Akim Demaille
cae601224e * configure.in (WERROR_CFLAGS): Compute it.
* src/Makefile.am (CFLAGS): Pass it.
* tests/atlocal.in (CFLAGS): Idem.
* src/files.c: Fix a few warnings.
(get_extension_index): Remove, unused.
2002-01-09 13:03:20 +00:00
Akim Demaille
ae40480115 * src/getargs.c (AS_FILE_NAME): New.
(getargs): Use it to convert DOSish file names.
* src/files.c (base_name): Rename as full_base_name to avoid
clashes with `base_name ()'.
(filename_split): New.
(compute_base_names): N-th rewrite, using filename_split.
2002-01-08 17:28:18 +00:00
Akim Demaille
22312b71e0 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
New, stolen from the Fileutils 4.1.
* lib/Makefile.am (libbison_a_SOURCES): Adjust.
* configure.in: Check for the presence of memrchr, and of its
prototype.
2002-01-08 17:27:46 +00:00
Tim Van Holder
a67cef01b1 * lib/hash.h (__P): Added definition for this macro.
* src/Makefile.am: Add parse-skel.c and scan-skel.c to BUILT_SOURCES, to ensure they are generated first.
* src/parse-skel.y: Use YYERROR_VERBOSE instead of %error-verbose to allow bootstrapping with bison 1.30x.
2002-01-07 23:00:39 +00:00
Akim Demaille
e9f87b5b7d Regen. 2002-01-07 08:44:08 +00:00
Akim Demaille
2b25d624f6 * src/reader.c (parse_braces): Don't fetch the next char, the
convention is to fetch on entry.
* tests/torture.at (GNU Cim Grammar): Reintroduce their weird
'switch' without a following semicolon.
* tests/regression.at (braces parsing): New.
2002-01-06 20:50:08 +00:00
Akim Demaille
3460813bdb Bison is dead wrong in its RR conflict reports.
* tests/torture.at (GNU Cim Grammar): New.
* src/conflicts.c (count_rr_conflicts): Fix.
2002-01-06 20:49:53 +00:00
Akim Demaille
73784c645d Creating package.m4 from configure.ac causes too many problems.
* tests/Makefile.am (package.m4): Create it by hand,
AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2002-01-06 20:49:40 +00:00
Akim Demaille
25d810906c * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
skeleton.h.
2002-01-06 20:49:27 +00:00
Paul Eggert
a9b8959efa * doc/bison.texinfo (Debugging):
Remove YYSTDERR; it's no longer defined or used.
Also, s/cstdio.h/cstdio/.
2002-01-05 01:26:32 +00:00
Paul Eggert
e2742e46ba (Debugging): Remove YYSTDERR; it's no longer defined or used.
Also, s/cstdio.h/cstdio/.
2002-01-05 01:25:38 +00:00
Akim Demaille
1109455ce9 * src/parse-skel.y (process_skeleton): Don't bind the parser's
tracing code to --trace, wait for a better --trace option, with
args.
2002-01-03 09:56:04 +00:00
Akim Demaille
7ea5e9779b * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
The ISO C++ standard is extremely clear about it: stderr is
considered a macro, not a regular symbol (see table 94 `Header
<cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
Therefore std:: does not apply to it.  It still does with fprintf.
Also, s/cstdio.h/cstdio/.
2002-01-03 09:55:49 +00:00
Akim Demaille
fab5b110fb * lib/quotearg.c: Use #include "..."' instead of #include <...>'
for non system headers.
2002-01-03 09:55:33 +00:00
Akim Demaille
aed7fd9b97 Equip the skeleton chain with location tracking, runtime trace,
pure parser and scanner.
* src/parse-skel.y: Request a pure parser, locations, and prefix
renaming.
(%union): Having several members with the same type does not help
type mismatches, simplify.
(YYPRINT, yyprint): New.
(yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
(skel_error): this.
Handle locations.
* src/scan-skel.l: Adjust to these changes.
* src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
(LOCATION_PRINT, skel_control_t): New.
2002-01-02 14:56:12 +00:00
Akim Demaille
24fad99e2b * src/parse-skel.y: Get rid of the shift/reduce conflict:
replace `gb' with BLANKS.
* src/scan-skel.l: Adjust.
2001-12-30 21:06:36 +00:00
Akim Demaille
a4b36db458 * src/system.h: We don't need nor want bcopy.
Throw away MS-DOS crap: we don't need getpid.
* configure.in: We don't need strndup.  It was even causing
problems: because Flex includes the headers *before* us,
_GNU_SOURCE is not defined by config.h, and therefore strndup was
not visible.
* lib/xstrndup.c: New.
* src/scan-skel.l: Use it.
Be sure to initialize yylval.muscle member when scanning a MUSCLE.
* src/parse-skel.y: Use %directives instead of #defines.
2001-12-30 21:06:22 +00:00
Akim Demaille
1239777d4f * src/skeleton.h: New.
* src/output.c (output_parser, output_master_parser): Remove, dead
code.
* src/output.h (get_lines_number, actions_output, guards_output)
(token_definitions_output): Prototype them.
* src/parse-skel.y: Add the license notice.
Include output.h and skeleton.h.
(process_skeleton): Returns void, and takes a single parameter.
* src/scan-skel.l: Add the license notice.
Include skeleton.h.
Don't use %option yylineno: it seems that then Flex imagines
REJECT has been used, and therefore it won't reallocate its
buffers (which makes no other sense to me than a bug).  It results
in warnings for `unused: yy_flex_realloc'.
to guess if the generated parsers should have '.tab' in their
* src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2001-12-30 21:05:12 +00:00
Robert Anisko
9b3add5beb * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
(MUSCLE_INSERT_PREFIX): ...to there.
* src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
(MUSCLE_INSERT_PREFIX): Move from here...
* src/bison.hairy: Add a section directive.  Put braces around muscle
names.  This parser skeleton is still broken, but Bison should not
choke on a bad muscle 'syntax'.
* src/bison.simple: Add a section directive.  Put braces around muscle
names.
* src/files.h (strsuffix, stringappend): Add declarations.
(tab_extension): Add declaration.
(short_base_name): Add declaration.
* src/files.c (strsuffix, stringappend): No longer static.  These
functions are used in the skeleton parser.
(tab_extension): New.
(compute_base_names): Use the computations done in this function
to guess if the generated parsers should have '.tab' in their
names.
(short_base_name): No longer static.
* src/output.c (output_skeleton): New.
(output): Disable call to output_master_parser, and give a try to
a new skeleton handling system.
(guards_output, actions_output): No longer static.
(token_definitions_output, get_lines_number): No longer static.
* configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
* src/Makefile.am (bison_SOURCES): Add scan-skel.l and
parse-skel.y.
* src/parse-skel.y: New file.
* src/scan-skel.l: New file.
2001-12-30 15:01:06 +00:00
Akim Demaille
3cd5bcdd19 Regen. 2001-12-29 14:46:03 +00:00
Akim Demaille
b5b61c616b %name-prefix is broken.
* src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
Adjust all dependencies.
* tests/headers.at (export YYLTYPE): Strengthen this test: use
%name-prefix.
Renaming yylval but not yylloc is not consistent.  Now we do.
* src/bison.simple: Prefix yylloc if used.
* doc/bison.texinfo (Decl Summary): Document that.
2001-12-29 14:27:45 +00:00
Akim Demaille
8c9a50bee1 * doc/bison.texinfo: Promote `%long-directive' over
`%long_directive'.
Remove all references to fixed-output-files, yacc is enough.
2001-12-29 14:27:20 +00:00
Akim Demaille
d99361e657 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
user prologue.  These are defaults.
* tests/actions.at (Mid-rule actions): Make sure the user can
define YYDEBUG and YYERROR_VERBOSE.
2001-12-29 14:27:01 +00:00
Akim Demaille
b9cecb91a0 * src/output.c (header_output): Don't forget to export YYLTYPE and
yylloc.
* tests/headers.at (export YYLTYPE): New, make sure it does.
* tests/regression.at (%union and --defines, Invalid CPP headers):
Move to...
* tests/headers.at: here.
2001-12-29 14:26:49 +00:00
Akim Demaille
aea13e9790 * src/gram.h (rule_s): Member assoc' is of type associativity'. 2001-12-29 14:26:21 +00:00
Akim Demaille
931394cbc1 * tests/actions.at (Mid-rule actions): Output on a single line
instead of several.
2001-12-29 14:25:58 +00:00
Akim Demaille
704a47c475 * doc/bison.texinfo: Formatting changes. 2001-12-29 14:25:45 +00:00
Akim Demaille
091e20bbee Don't store the token defs in a muscle, just be ready to output it
on command.  Now possible via `symbols'.  Fixes a memory leak.
* src/output.c (token_definitions_output): New.
(output_parser, header_output): Use it.
* src/reader.c (symbols_save): Remove.
2001-12-29 14:25:27 +00:00
Akim Demaille
cce7171088 * src/bison.simple: Do not provide a default for YYSTYPE and
YYLTYPE before the user's prologue.  Otherwise it's hardly... a
default.
2001-12-29 14:25:08 +00:00
Akim Demaille
82c035a823 Mid-rule actions are simply... ignored!
* src/reader.c (readgram): Be sure to attach mid-rule actions to
the empty-rule associated to the dummy symbol, not to the host
rule.
* tests/actions.at (Mid-rule actions): New.
2001-12-29 14:24:51 +00:00
Akim Demaille
8419d367e1 Memory leak.
* src/reader.c (reader): Free grammar.
2001-12-29 14:24:35 +00:00
Akim Demaille
375d580671 Memory leak.
* src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
since it allocates it for each state, although only one is needed.
(allocate_storage): Do it here.
2001-12-29 14:21:23 +00:00
Akim Demaille
f51cb8ff8c * src/options.h, src/options.c (create_long_option_table): Rename
as...
(long_option_table_new): this, with a clearer prototype.
(percent_table): Remove, unused,
* src/getargs.c (getargs): Adjust.
2001-12-29 14:21:06 +00:00
Akim Demaille
29e8831621 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
* src/print.c, src/print_graph.c, src/state.h: Rename state_table
as states.
2001-12-29 14:20:47 +00:00
Akim Demaille
b9f71f19cc * src/lalr.c (build_relations): Rename states' as states1'.
Sorry, I don't understand exactly what it is, no better name...
2001-12-29 14:20:27 +00:00
Akim Demaille
1a2b5d37e1 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
* src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
* src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
as rules.
2001-12-29 14:20:13 +00:00
Akim Demaille
1cca533e2e * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
ago.
2001-12-29 14:19:46 +00:00
Akim Demaille
c03ae96659 * src/reader.c, src/reader.h (user_toknums): Remove.
Adjust all users to use symbols[i]->user_token_number.
2001-12-29 14:19:31 +00:00
Akim Demaille
5a670b1ed9 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
Adjust all users to use symbols[i]->prec or ->assoc.
2001-12-29 14:19:13 +00:00