Commit Graph

131 Commits

Author SHA1 Message Date
Paul Eggert
6273355b36 If the user does not define YYSTYPE as a macro, Bison now declares it
using typedef instead of defining it as a macro.  POSIX requires this.
	For consistency, YYLTYPE is also declared instead of defined.

	%union directives can now have a tag before the `{', e.g., the
	directive `%union foo {...}' now generates the C code
	`typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
	The default union tag is `YYSTYPE', for compatibility with Solaris 9
	Yacc.  For consistency, YYLTYPE's struct tag is now `YYLTYPE'
	instead of `yyltype'.

	`yystype' and `yyltype' are now obsolescent macros instead of being
	typedefs or tags; they are no longer documented and will be
	withdrawn in a future release.
2002-12-24 07:43:43 +00:00
Paul Eggert
f67ad422a4 (Decl Summary): yytname's first element is not always "$end", as the
user might specify a different name for the end token.
2002-12-21 12:49:33 +00:00
Paul Eggert
9417597809 (Parser Function, Purel Calling, Error
Reporting, Table of Symbols): Omit mentions of %lex-param and
%parse-param from the documentation for now.
2002-12-18 00:09:33 +00:00
Paul Eggert
b317297e4d (Error Reporting): randomness -> nastiness, to fix a typo. 2002-12-15 09:39:12 +00:00
Paul Eggert
397ec0734f (Invocation, Bison Options): Mention yacc
as an alias for bison y.
2002-12-13 12:18:31 +00:00
Paul Eggert
ec1ef903c3 Upgrade to FDL 1.2. 2002-12-13 11:15:01 +00:00
Paul Eggert
b69d743e78 (Table of Symbols): YYERROR_VERBOSE should
be #defined in the prologue, not in the Bison declarations.
This fixes Debian Bug 102878, reported by Shaul Karl.
2002-12-07 05:50:45 +00:00
Paul Eggert
3b0ee3aa8b fund -> found 2002-11-30 09:25:06 +00:00
Paul Eggert
93dd49ab29 (Yacc Library): New node. Regenerate top menu. 2002-11-30 09:11:30 +00:00
Paul Eggert
38a92d500a Emphasize that yylex and yyerror must be declared before being used.
E.g., one should typically declare them in the prologue.  Use GNU
coding style in examples.  Put "const" consistently after the type it
modifies.  Mention that C99 supports "inline".  Mention that yyerror
traditionally returns "int".
2002-11-30 07:42:37 +00:00
Paul Eggert
feeb0edaf1 (Parser Function, Pure Calling, Error Reporting, Table of Symbols):
%parse-param and %lex-param now take just one argument, the
declaration; the argument name is deduced from the declaration.
2002-11-29 08:43:12 +00:00
Paul Eggert
831d3c996d yyprint -> print_token_value 2002-11-27 18:32:12 +00:00
Akim Demaille
d3c4e709ff * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
space.
From Tim Van Holder.
2002-11-18 09:33:22 +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
9501dc6e69 * tests/atlocal.in (CPPFLAGS): We have config.h.
* tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
New.
* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
* tests/regression.at, tests/torture.at: Use them for all the
grammars that are to be compiled.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
* tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
* doc/bison.texinfo (GLR Parsers): Document `inline'.
2002-11-14 09:58:01 +00:00
Akim Demaille
18b519c0d6 * doc/bison.texinfo: Various formatting changes (alignments in
samples, additional @group/@end group, GCS in samples.
Use @deffn instead of simple @table to define the directives,
macros, variables etc.
2002-11-14 08:32:10 +00:00
Akim Demaille
3df374151b * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
Use it to test the GLR parser.
2002-11-12 09:07:38 +00:00
Akim Demaille
72f889cca3 * doc/bison.texinfo (Destructor Decl): New. 2002-11-12 08:35:00 +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
1c0c3e955d Typo. 2002-11-07 12:54:51 +00:00
Akim Demaille
93724f139a Let yyerror always receive the msg as last argument, so that
yyerror can be variadic.
* data/yacc.c (b4_yyerror_args): New.
Use it when calling yyerror.
* data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
Use it when calling yyerror.
* doc/bison.texinfo (Error Reporting): Adjust.
* tests/calc.at (_AT_DATA_CALC_Y): Adjust.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2002-11-07 12:52:19 +00:00
Paul Eggert
4e0813a6cf Fix minor troff and spelling glitches. 2002-11-07 07:06:29 +00:00
Akim Demaille
2a8d363aab * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
New.
* data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
(b4_parse_param): Remove.
Use b4_identification.
Propagate b4_pure_args where needed to pass them to yyerror.
* data/glr.m4 (b4_parse_param): Remove.
(b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
(b4_lpure_formals): New.
Use b4_identification.
(YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
b4_user_formals and b4_user_args.
(yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
(yyreportAmbiguity): When using a pure parser, also need
the location, and the parse-params.
Adjust callers.
(yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
When using a pure parser, also need the parse-params.
Adjust callers.
* tests/calc.at: Test pure (%pure-parser) and absolutely pure
(%pure-parser + %parse-param) LALR and GLR parsers.
(AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
(_AT_DATA_CALC_Y): Equip for purity of yyerror.
(_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
* tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
* doc/bison.texinfo: Untabify the whole file.
(Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
(Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
(Error Reporting): Adjust to these new directives.
Document %error-verbose, deprecate YYERROR_VERBOSE.
2002-11-03 16:41:57 +00:00
Paul Eggert
2bfc2e2a7d (Grammar Outline): Document // comments.
(Symbols): Document that trigraphs have no special meaning in Bison,
nor is backslash-newline allowed.
(Actions): Document that trigraphs have no special meaning.
2002-11-03 08:40:39 +00:00
Paul Eggert
c827f760f6 Minor spelling and typographical fixes. Use @acronym consistently.
Standardize on "Yacc" instead of "YACC", "Algol" instead of "ALGOL".
Give a bit more history about BNF.
2002-10-23 05:26:32 +00:00
Paul Eggert
b56471a689 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
so that the commands still work even if POSIXLY_CORRECT is set.
2002-10-14 08:43:36 +00:00
Paul Eggert
68449b3ad3 (Calling Convention): Fix strncmp typo. 2002-10-11 21:19:27 +00:00
Paul Eggert
72d2299ca0 Minor spelling, grammar, and white space fixes.
(Symbols): Mention that any negative value returned from yylex
signifies end-of-input.  Warn about negative chars.  Mention
the portable Standard C character set.
2002-10-05 04:45:45 +00:00
Akim Demaille
d1a1114f7f * doc/bison.texinfo (Stack Overflow): xref to Recursion.
(Frequently Asked Questions, Parser Stack Overflow): New.
2002-09-24 12:32:36 +00:00
Paul Eggert
262aa8dd59 (Conditions): Say that the exceptions apply only to C LALR(1) parsers. 2002-09-07 06:33:29 +00:00
Akim Demaille
88bce5a2ef Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
* src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
(endtoken, accept): these.
* src/reader.c (reader): Set endtoken's default tag to "$end".
Set undeftoken's tag to "$undefined" instead of "$undefined.".
* doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
Adjust.
2002-07-29 17:30:33 +00:00
Akim Demaille
3650b4b8dd * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
* doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
* tests/regression.at (Web2c Actions): Adjust.
2002-07-26 06:24:11 +00:00
Akim Demaille
fae437e835 * doc/bison.texinfo: Properly set the ``header'' part.
Use @dircategory ``GNU programming tools'' as per Texinfo's
documentation.
Use @copying.
2002-07-09 17:01:42 +00:00
Paul Hilfinger
676385e29c Initial check-in introducing experimental GLR parsing. See entry in
ChangeLog dated 2002-06-27 from Paul Hilfinger for details.
2002-06-28 02:26:44 +00:00
Akim Demaille
60491a948b * data/bison.simple, data/bison.c++: Rename as...
* data/yacc.c, data/lalr1.cc: these.
* doc/bison.texinfo (Environment Variables): Remove.
2002-06-27 12:08:20 +00:00
Akim Demaille
c732d2c6dc * doc/bison.texinfo: Document ability to have multiple
prologue sections.
2002-06-19 07:46:11 +00:00
Akim Demaille
ec3bc3961d * doc/bison.texinfo (Debugging): Split into...
(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2002-05-25 16:12:40 +00:00
Akim Demaille
b2d52318fa * data/bison.simple (yyparse): Do not implement @$ = @1.
(YYLLOC_DEFAULT): Adjust to do it.
* doc/bison.texinfo (Location Default Action): Fix.
2002-05-02 16:40:54 +00:00
Akim Demaille
fdbcd8e289 Remove the so called hairy (semantic) parsers.
* src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
* src/gram.h, src/gram.c (semantic_parser): Remove.
(rule_t): Remove the guard and guard_line members.
* src/lex.h (token_t): remove tok_guard.
* src/options.c (option_table): Remove %guard and %semantic_parser
support.
* src/output.c, src/output.h (guards_output): Remove.
(prepare): Adjust.
(token_definitions_output): Don't output the `T'
tokens (???).
(output_skeleton): Don't output the guards.
* src/files.c, src/files.c (attrsfile): Remove.
* src/reader.c (symbol_list): Remove the guard and guard_line
members.
Adjust dependencies.
(parse_guard): Remove.
* data/bison.hairy: Remove.
* doc/bison.texinfo (Environment Variables): Remove occurrences of
BISON_HAIRY.
2002-05-02 15:06:46 +00:00
Akim Demaille
5c0a0514da More. 2002-04-23 14:07:56 +00:00
Paul Eggert
08e49d20f0 Replace @var{...(...}} with something else, as Texinfo 4.2 warns
about that construct.
2002-04-22 22:10:22 +00:00
Akim Demaille
23c5a17453 * src/reader.c (token_translations_init): 256 is now the default
value for the error token, i.e., it will be assigned another
number if the user assigned 256 to one of her tokens.
(reader): Don't force 256 to error.
* doc/bison.texinfo (Symbols): Adjust.
* tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
(AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
etc. instead of 10, 20, 30 (which was used to `jump' over error
(256) and undefined (2)).
2002-04-22 08:22:11 +00:00
Akim Demaille
3ded9a63e3 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
as Lex/Flex'.
(Debugging): More details about enabling the debugging features.
(Table of Symbols): Describe $$, $n, @$, and @n.
Suggested by Tim Josling.
2002-04-19 14:04:31 +00:00
Akim Demaille
e0c471a9e6 * doc/bison.texinfo: Remove the uses of the obsolete @refill. 2002-04-19 13:35:08 +00:00
Paul Eggert
e966383bf4 * doc/bison.texinfo: Update copyright date.
(Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
(Symbols): Warn about running Bison in one character set,
but compiling and/or running in an incompatible one.
Warn about character code 256, too.
2002-04-04 21:34:34 +00:00
Paul Eggert
cf3b4b64d0 (AUTOMAKE_OPTIONS): Remove. 2002-03-20 07:02:15 +00:00
Paul Eggert
e4e1a4dcb4 (Bison Parser, Debugging): Remove special mention of C++, as it's
treated like C now.
2002-02-14 20:26:54 +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
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