Commit Graph

50 Commits

Author SHA1 Message Date
Marc Autret
ca96bc2d17 * src/bison.simple (YYLLOC_DEFAULT): Update.
(yyparse): Adjust.
2001-08-09 19:59:29 +00:00
Akim Demaille
3419715d61 * src/bison.simple (yyparse): Suppress warning `comparaison
between signed and unsigned'.
2001-07-18 10:07:45 +00:00
Akim Demaille
573c1d9ff8 * src/system.h (obstack_grow_literal_string): Rename as...
(obstack_grow_string): this.
* src/output.c (output_parser): Recognize `%% actions' instead of
`$'.
* src/bison.s1: s/$/%% actions/.
* src/bison.hairy: Likewise.
2000-12-19 14:51:24 +00:00
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
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
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
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
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
5a35a6cb71 Test also --verbose', --defines' and `--name-prefix'. Testing
the latter demonstrates a flaw in the handling of non debugging
parsers introduced by myself on 2000-03-16: `#define yydebug 0'
was used in order to simplify:
#if YYDEBUG
if (yydebug)
{
...
}
#endif
into
if (yydebug)
{
...
}
unfortunately this leads to a CPP conflict when
`--name-prefix=foo' is used since it produces `#define yydebug
foodebug'.
* src/bison.s1 [!YYDEBUG]: Do not define yydebug.
(YYDPRINTF): New macro.
Spread its use.
* tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
the bison options.
Also test `--verbose', `--defines' and `--name-prefix'.
2000-10-02 09:04:40 +00:00
Akim Demaille
71da9eeacc Improve the readability of the produced parsers.
* src/bison.s1: Formatting changes.
Improve the comment related to the `$' mark.
(yydefault): Don't fall through to `yyresume': `goto' there.
* src/output.c (output_parser): When the `$' is met, skip the end
of its line.
New variable, `number_of_dollar_signs', to check there's exactly
one `$' in the parser skeleton.
2000-10-02 09:03:20 +00:00
Akim Demaille
0d533154e4 First set of tests: use the `calc' example from the documentation.
* src/bison.s1 (yyparse): Condition the code using `yytname' which
is defined only when YYDEBUG is.
* m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
* src/files.c (tryopen, tryclose): Formatting changes.
Move to the top and be static.
* src/reader.c (read_signed_integer): Likewise.
* tests/calc.m4: New file.
* Makefile.am, suite.m4: Adjust.
* m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
2000-09-18 13:18:26 +00:00
Akim Demaille
75bbe78d87 On syntax errors, report the token on which we choked.
* bison.s1 (yyparse): In the label yyerrlab, when YYERROR_VERBOSE,
add yychar in msg.
2000-03-17 13:17:09 +00:00
Akim Demaille
6666f98f4f Change the handling of @s so that they behave exactly like $s.
There is now a pseudo variable @$ (readble and writable), location
of the lhs of the rule (by default ranging from the location of
the first symbol of the rhs, to the location of the last symbol,
or, if the rhs is empty, YYLLOC).

* src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
yyval.
(yyparse): When providing a default semantic action, provide a
default location action.
(after the $): No longer change `*YYLSP', just stack YYLOC the
same way you stack YYVAL.
* src/reader.c (read_declarations): Use warns.
(copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
(copy_action, case '@'): Likewise.
Use a standard error message, to save useless work from
translators.
2000-03-17 11:30:24 +00:00
Akim Demaille
41aca2e038 * bison.s1: Formatting and cosmetics changes.
* reader.c: Likewise.
Update the Copyright notice.
2000-03-17 11:28:47 +00:00
Akim Demaille
dc08c1d53b * bison.s1 (#line): All set to `#line' only, since the Makefile
now handles them.
2000-03-17 11:27:17 +00:00
Akim Demaille
0de741ca66 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
One `#if YYDEBUG' remains, since it uses variables which are
defined only if `YYDEBUG != 0'.
2000-03-16 16:02:16 +00:00
Akim Demaille
bb10be5408 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
and related variables so that the similarities are highlighted.
2000-03-16 16:00:07 +00:00
Akim Demaille
b07b484a41 * src/bison.s1: Properly indent CPP directives. 2000-03-16 15:58:56 +00:00
Akim Demaille
361f60b34e * src/bison.s1: Properly indent the `alloca' CPP section. 2000-03-16 15:56:57 +00:00
Jesse Thilo
ca1d9e53ce Fixed #line numbers. 1999-03-22 16:30:00 +00:00
Jesse Thilo
c49a8e71ce Update FSF address. 1999-01-14 14:58:38 +00:00
Richard M. Stallman
7d369561eb Add a Bison version comment. 1997-06-28 19:41:24 +00:00
Richard M. Stallman
70ddf8972a Use malloc, if using alloca is troublesome.
(YYSTACK_USE_ALLOCA): New flag macro.
Define it for some systems and compilers.
(YYSTACK_ALLOC): New macro.
(yyparse): Use YYSTACK_ALLOC to allocate stack.
If it was malloc'd, free it.
1997-05-17 18:44:24 +00:00
Richard M. Stallman
3054a9cdfb (alloca) [__hpux]: Always define as __builtin_alloca. 1997-04-23 18:01:25 +00:00
Richard M. Stallman
009b94d421 [__hpux]: Include alloca.h (right for HPUX 10)
instead of declaring alloca (right for HPUX 9).
1997-04-22 22:23:48 +00:00
Richard M. Stallman
5e02f2ada1 (__yy_memcpy): Declare arg `count' as unsigned int.
(yyparse): Cast third arg to __yy_memcpy to unsigned int.
1997-04-22 22:19:12 +00:00
Paul Eggert
1b1816515e (yyparse): If __GNUC__ and YYPARSE_PARAM are both defined,
declare yyparse to have a void * argument.
1996-12-18 02:18:10 +00:00
Richard M. Stallman
32d5c018d8 Test _MSDOS as well as _MSDOS_. 1996-08-12 22:17:15 +00:00
Richard M. Stallman
b6287af6f6 [__sun && __i386]: Include alloca.h. 1996-07-31 19:18:57 +00:00
Richard M. Stallman
444fbf65fb Comment change. 1996-07-30 04:37:37 +00:00
Richard M. Stallman
db245ba812 Test _MSDOS_, not MSDOS. 1996-07-30 04:37:16 +00:00
Richard M. Stallman
4cf401b28e (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t. 1996-05-12 22:17:15 +00:00
Richard M. Stallman
c245d0d38d (__yy_memcpy): Really reorder the args, as was supposedly done on Feb 14 1995.
(yyparse): Calls changed accordingly.
1996-05-11 19:19:55 +00:00
Richard M. Stallman
a8a7082ea6 Fix line numbers in #line commands. 1995-12-29 04:29:18 +00:00
Richard M. Stallman
30f5b1ccd3 (YYPARSE_PARAM_DECL): In C++, make it always null.
(YYPARSE_PARAM_ARG): New macro.
(yyparse): Use YYPARSE_PARAM_ARG.
1995-12-27 12:43:49 +00:00
Richard M. Stallman
cfeaeb52f5 Comment change. 1995-05-06 05:35:44 +00:00
Richard M. Stallman
c71f8bbaa3 Change distribution terms. 1995-05-03 07:13:20 +00:00
Jim Meyering
ba39f603a6 (__yy_memcpy): Renamed from __yy_bcopy to avoid
confusion.  Reverse FROM and TO arguments to be consistent with
those of memcpy.
1995-02-14 16:49:32 +00:00
Richard M. Stallman
21b14802aa Update copyright notice and GPL version. 1994-09-15 21:39:22 +00:00
Richard M. Stallman
cc90caacec entered into RCS 1994-03-26 20:33:04 +00:00
Richard M. Stallman
e425e87207 *** empty log message *** 1993-11-21 10:25:13 +00:00
Richard M. Stallman
21b3ea1545 *** empty log message *** 1993-10-19 03:55:14 +00:00
Richard M. Stallman
b658bf92ac *** empty log message *** 1993-10-14 16:19:10 +00:00
Richard M. Stallman
c6c88451a7 *** empty log message *** 1993-07-24 08:00:44 +00:00
Richard M. Stallman
fb75fa822d *** empty log message *** 1993-07-04 20:07:28 +00:00
Richard M. Stallman
be4bf8770a *** empty log message *** 1993-06-16 21:02:31 +00:00
Richard M. Stallman
10fa2066c9 Initial revision 1993-06-03 17:07:14 +00:00