From cfef6286fa1beaf2072dfb3240e40539250dc527 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 5 Aug 2014 07:01:08 -0700 Subject: * 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. --- parser.y | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'parser.y') diff --git a/parser.y b/parser.y index e1510091..65a7b55b 100644 --- a/parser.y +++ b/parser.y @@ -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) -- cgit v1.2.3