diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-08-05 07:01:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-08-05 07:01:08 -0700 |
commit | cfef6286fa1beaf2072dfb3240e40539250dc527 (patch) | |
tree | 0e9125ee7ccb62fdda0ab2a6aace4791f5099b52 | |
parent | 894c655f0214531ad7eff3d68d72792ae18d40cd (diff) | |
download | txr-cfef6286fa1beaf2072dfb3240e40539250dc527.tar.gz txr-cfef6286fa1beaf2072dfb3240e40539250dc527.tar.bz2 txr-cfef6286fa1beaf2072dfb3240e40539250dc527.zip |
* parser.y: Back port from Berkeley Yacc to GNU Bison.
We need a prototype of yylex that is in scope of the grammar,
but YYSTYPE is not defined there.
* parser.l: Bison 3 declares yyparse in y.tab.h, so we have to
reorder some #includes.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | parser.l | 2 | ||||
-rw-r--r-- | parser.y | 5 |
3 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2014-08-05 Kaz Kylheku <kaz@kylheku.com> + + * parser.y: Back port from Berkeley Yacc to GNU Bison. + We need a prototype of yylex that is in scope of the grammar, + but YYSTYPE is not defined there. + + * parser.l: Bison 3 declares yyparse in y.tab.h, so we have to + reorder some #includes. + 2014-08-02 Kaz Kylheku <kaz@kylheku.com> Big switch to reentrant lexing and parsing. @@ -41,7 +41,6 @@ #include <unistd.h> #endif #include "lib.h" -#include "y.tab.h" #include "gc.h" #include "stream.h" #include "utf8.h" @@ -49,6 +48,7 @@ #include "unwind.h" #include "hash.h" #include "parser.h" +#include "y.tab.h" #define YY_INPUT(buf, result, max_size) \ do { \ @@ -59,6 +59,11 @@ static val rlrec(parser_t *, val form, val line); static wchar_t char_from_name(const wchar_t *name); static val make_expr(parser_t *, val sym, val rest, val lineno); +#if YYBISON +union YYSTYPE; +int yylex(union YYSTYPE *, void *scanner); +#endif + #define rl(form, line) rlrec(parser, form, line) #define mkexp(sym, rest, lineno) make_expr(parser, sym, rest, lineno) #define symhlpr(lexeme, meta_allowed) sym_helper(scnr, lexeme, meta_allowed) |