Commit Graph

340 Commits

Author SHA1 Message Date
Akim Demaille
ef7ddeddaa * src/output.c (output_parser): Compute the `#line' lines when
there are.
* src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
Suggested by Hans Aberg.
2000-12-19 13:40:42 +00:00
Akim Demaille
ff61dabdba Let the handling of the skeleton files be local to the procedures
that use it.
* src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
longer static.
(fparser, open_extra_files): Remove.
(open_files, output_files): Don't take care of fparser.
* src/files.h: Adjust.
* src/output.c (output_parser): Open and close the file to the
skeleton.
* src/reader.c (read_declarations): When %semantic_parser, open
fguard.
2000-12-19 13:05:52 +00:00
Akim Demaille
55b9634155 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
* src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
2000-12-19 12:30:59 +00:00
Akim Demaille
358c15b71e * src/files.c (open_files): Yipee! We no longer need all the code
looking for `/tmp' since we have no tmp file.
2000-12-19 12:24:24 +00:00
Akim Demaille
7de3329eea * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
New macros.
* src/files.c (open_files): Less dependency on MSDOS etc.
2000-12-19 12:18:45 +00:00
Akim Demaille
bfb0787482 Add tests/calc.at. 2000-12-18 09:02:16 +00:00
Akim Demaille
1addd145c2 Added tests/calc.y. 2000-12-18 09:00:07 +00:00
Akim Demaille
c95f2d781f Add tests/regression.at and tests/suite.at. 2000-12-15 09:44:44 +00:00
Akim Demaille
69b4e0c5ea Cosmetic changes. 2000-12-15 09:43:09 +00:00
Akim Demaille
3abcd45995 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
Provide a default definition.
Use it when executing the default @ action.
* src/reader.c (reader_output_yylsp): No longer include
`timestamp' and `text' in the default YYLTYPE.
2000-12-14 13:03:32 +00:00
Akim Demaille
2a91a95e9e * src/reader.c (copy_definition, parse_union_decl, copy_action)
(copy_guard): Quote the file names.
Reported by Laurent Mascherpa.
2000-12-12 17:12:43 +00:00
Akim Demaille
14d3eb9bf4 * src/output.c (output_headers, output_program, output): Be sure
to escape special characters when outputting filenames.
(ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
(output_headers): Don't depend on them, Use ACTSTR.
2000-12-12 16:09:10 +00:00
Akim Demaille
d7045ec672 * lib/obstack.h: Formatting changes.
(obstack_grow, obstack_grow0): Don't cast WHERE at all: it
prevents type checking.
(obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
cast the value to (void *): assigning a `foo *' to a `void *'
variable is valid.
(obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
* src/reader.c (parse_union_decl): Typo: use obstack_1grow to
append characters.
2000-11-17 14:14:36 +00:00
Akim Demaille
6fd54b73c3 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
as...
(suite.m4, regression.m4, calc.m4): these.
* tests/atgeneral.m4: Update from CVS Autoconf.
2000-11-17 11:16:10 +00:00
Akim Demaille
4c50eae6a0 * tests/regression.m4 (%union and --defines): New test,
demonstrating a current bug in the obstack implementation.
2000-11-17 11:08:03 +00:00
Akim Demaille
a35f64eade * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
macros.
Use them to declare the variables which are global or local to
`yyparse'.
2000-11-17 10:57:30 +00:00
Akim Demaille
7de23534ac * acconfig.h: Remove, no longer used. 2000-11-17 10:03:37 +00:00
Akim Demaille
aa7815f5c6 * src: s/Copyright (C)/Copyright/g. 2000-11-07 16:28:47 +00:00
Akim Demaille
5af1f54933 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
defining.
* src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
2000-11-07 15:56:20 +00:00
Akim Demaille
553e2b222f * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
Merge in a single CPP if/else.
2000-11-07 15:51:45 +00:00
Akim Demaille
8a4f41d6ed * src/output.c (output): Remove useless variables.
* lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
argument `data' for consistency with the prototypes.
Qualify it `const'.
(obstack_copy, obstack_copy0): Rename the second argument as
`address' for consistency.  Qualify it `const'.
* lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
(obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
`const' their input argument (`data' or `address').
Adjust the corresponding macros to include `const' in casts.
2000-11-07 11:54:01 +00:00
Akim Demaille
090c5ebfa8 Typos in ChangeLog. 2000-11-06 08:42:37 +00:00
Akim Demaille
095a3fb52f * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
s/PFILE1/BISON_HAIRY/.
Adjust dependencies.
2000-11-03 17:31:47 +00:00
Akim Demaille
d1cdce7c1c For some reasons, this has not been applied.
* src/files.c [VMS]: No longer include `ssdef.h', no longer define
`unlink': it's no longer used.
2000-11-03 17:27:19 +00:00
Akim Demaille
9311529bc5 * src/files.c (skeleton_find): New function, eved out of...
(open_files, open_extra_files): here.
2000-11-03 17:19:07 +00:00
Akim Demaille
d16e8d3cd7 Adjust the cvsignores. 2000-11-03 16:57:47 +00:00
Akim Demaille
d8880f69ff Don't use `atexit'.
* src/files.c (obstack_save): New function.
(done): Rename as...
(output_files): this.
Use `obstack_save'.
* src/main.c (main): Don't use `atexit' to register `done', since
it no longer has to remove tmp files, just call `output_files'
when there are no errors.
2000-11-03 16:52:45 +00:00
Akim Demaille
0dbb648e3f * src/files.c [VMS]: No longer include `ssdef.h', no longer define
`unlink': it's no longer used.
* src/files.h: Formatting changes.
2000-11-02 15:21:05 +00:00
Akim Demaille
896fe5c10a Remove the last uses of mktemp and unlink/delete.
* src/files.c (fdefines, ftable): Removed.
(defines_ostack, table_obstack): New.
Adjust dependencies of the former into uses of the latter.
* src/output.c (output_short_or_char_table, output_short_table):
Convert to using obstacks.
* src/reader.c (copy_comment2): Accept one FILE * and two
obstacks.
(output_token_defines, reader_output_yylsp): Use obstacks.
* src/system.h (obstack_fgrow3): New.
2000-11-02 13:38:12 +00:00
Akim Demaille
dd60faeca4 Change each use of fattrs' into a use of attrs_obstack'.
* src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
* src/files.c (fattrs): Remove.
(attrs_obstack): New.
Adjust all dependencies.
(done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
2000-11-01 17:05:54 +00:00
Akim Demaille
8c7ebe4946 Introduce obstacks.
Change each use of `faction' into a use of `action_obstack'.
* lib/obstack.h, lib/obstack.c: New files.
* src/files.c (faction): Remove.
(action_obstack): New.
Adjust all dependencies.
2000-11-01 16:03:50 +00:00
Akim Demaille
77aee78982 * lib/quote.h (PARAMS): New macro. Use it. 2000-10-20 09:22:45 +00:00
Akim Demaille
f1320c03a4 Remove spurious empty lines. 2000-10-16 19:20:52 +00:00
Akim Demaille
43591cec98 * src/output.c (output_short_or_char_table): New function.
(output_short_table, output_token_translations): Use it.
(goto_actions): Use output_short_table.
2000-10-16 18:33:38 +00:00
Akim Demaille
1e9798d569 * src/symtab.c (bucket_new): New function.
(getsym): Use it.
* src/output.c (output_short_table): New argument to display the
comment associated with the table.
Adjust dependencies.
(output_gram): Use it.
(output_rule_data): Nicer output layout for YYTNAME.
2000-10-16 18:10:46 +00:00
Akim Demaille
f282676b7e * src/lex.c (read_typename): New function.
(lex): Use it.
* src/reader.c (copy_dollar): Likewise.
2000-10-16 18:08:35 +00:00
Akim Demaille
550a72a3be * src/reader.c (copy_comment2): Expect the input stream to be on
the `/' which is suspected to open a comment, instead of being
called after `//' or `/*' was read.
(copy_comment, copy_definition, parse_union_decl, copy_action)
(copy_guard): Adjust.
2000-10-16 18:06:29 +00:00
Akim Demaille
131e2fef68 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
`read_signed_integer'.
2000-10-16 18:05:01 +00:00
Akim Demaille
79282c5ad0 * src/reader.c (copy_dollar): New function.
(copy_guard, copy_action): Use it.
2000-10-16 18:00:41 +00:00
Akim Demaille
ff4a34be27 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
* m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
New files, from Fileutils 4.0.27.
* src/main.c (printable_version): Remove.
* src/lex.c, src/reader.c: Use `quote'.


* lib/error.c, lib/error.h: New files, needed by xmalloc.c.
2000-10-16 17:28:41 +00:00
Akim Demaille
14ded68250 * doc/bison.texinfo: Various typos spotted by Neil Booth. 2000-10-04 12:52:25 +00:00
Akim Demaille
8e03724b11 When a literal string is used to define two different tokens,
`bison -v' segfaults.
Reported by Piotr Gackiewicz, and fixed by Neil Booth.
* tests/regression.m4: New file.
Include the core of the sample provided by Piotr Gackiewicz.
* src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
properly.
2000-10-04 11:52:53 +00:00
Akim Demaille
a9e64249c8 * src/reader.c (parse_expect_decl): Keep `count' within the size
of `buffer'.
From Neil Booth.
2000-10-04 11:31:14 +00:00
Jeff Bailey
42a0c7760b Gratuitous change to NEWS to test mailout 2000-10-02 20:04:58 +00:00
Jeff Bailey
e02cf9e74a Gratuitous change to test mail out 2000-10-02 20:00:35 +00:00
Akim Demaille
da9abf4366 * bison.s1 (yyparse): Assign the default value
unconditionally, to avoid a GCC warning and make the parser a
tad smaller.
2000-10-02 10:29:00 +00:00
Akim Demaille
8f52a1e790 Typos in ChangeLog. 2000-10-02 10:23:43 +00:00
Akim Demaille
c33638bb30 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
options.
2000-10-02 10:22:19 +00:00
Akim Demaille
444c570aad * src/derives.c, src/print.c, src/reduce.c: To ease the
translation, move some `n' out of the translated strings.
2000-10-02 10:21:47 +00:00
Akim Demaille
89cab50df1 The location tracking mechanism is precious for parse error
messages.  Nevertheless, it is enabled only when `@n' is used in
the grammar, which is a different issue (you can use it in error
message, but not in the grammar per se).  Therefore, there should
be another means to enable it.
* src/getargs.c (getargs): Support `--locations'.
(usage): Report it.
* src/getargs.h (locationsflag): Export it.
* src/lex.c (percent_table): Support `%locations'.
* src/reader.c (yylsp_needed): Remove this variable, now replaced
with `locationsflag'.
* doc/bison.texinfo: Document `--locations' and `%locations'.
Sort the options.
* tests/calc.m4: Test it.
For regularity of the names, replace each
(nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
(no_lineflag, token_tableflag, rawflag, no_parserflag): this.
In addition replace each `flag' with `_flag'.
2000-10-02 10:20:59 +00:00