From fd51e5ffa20459b0a44e04cf83b09fd1b5e5b5c0 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Fri, 30 Nov 2001 11:23:29 +0000 Subject: [PATCH] * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions before their first uses. (YYBISON, YYPURE): Move to the top of the output. --- ChangeLog | 6 ++++++ src/bison.simple | 47 ++++++++++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index d009c065..07c98156 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-11-30 Akim Demaille + + * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions + before their first uses. + (YYBISON, YYPURE): Move to the top of the output. + 2001-11-30 Akim Demaille * tests/reduce.at (Useless Nonterminals): Fix. diff --git a/src/bison.simple b/src/bison.simple index 5f2921ab..0e6be055 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -31,15 +31,18 @@ It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ +#define YYBISON 1 /* Identify Bison output. */ +#define YYPURE %%pure /* Identify pure parsers. */ + #include /* If name_prefix is specify substitute the variables and functions names. */ #define yyparse %%prefix##parse -#define yylex %%prefix##lex +#define yylex %%prefix##lex #define yyerror %%prefix##error -#define yylval %%prefix##lval -#define yychar %%prefix##char +#define yylval %%prefix##lval +#define yychar %%prefix##char #define yydebug %%prefix##debug #define yynerrs %%prefix##nerrs @@ -111,6 +114,24 @@ # define YYSTACK_FREE(Ptr) free (Ptr) #endif +#line %%input-line "%%filename" +#ifndef YYSTYPE +typedef %%stype yystype; +# define YYSTYPE yystype +#endif + +#ifndef YYLTYPE +typedef struct yyltype +{ + int first_line; + int first_column; + int last_line; + int last_column; +} yyltype; +# define YYLTYPE %%ltype +#endif + +#line %%line "%%skeleton" /* A type that is properly aligned for any stack member. */ union yyalloc { @@ -153,30 +174,10 @@ do \ } \ while (0) -#define YYBISON 1 /* Identify Bison output. */ -#define YYPURE %%pure /* Identify pure parsers. */ - #ifndef YYDEBUG # define YYDEBUG %%debug #endif -#line %%input-line "%%filename" -#ifndef YYSTYPE -typedef %%stype yystype; -# define YYSTYPE yystype -#endif - -#ifndef YYLTYPE -typedef struct yyltype -{ - int first_line; - int first_column; - int last_line; - int last_column; -} yyltype; -# define YYLTYPE %%ltype -#endif - #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE #endif -- 2.47.2