From af8709c031d7f0b7d61872536922d3acf16180c5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 24 Aug 2015 06:57:09 -0700 Subject: New --yydebug option. * parser.y (have_yydebug): New global constant. (yydebug_onoff): New function. * parser.h (have_yydebug, yydebug_onof): Declared. (yydebug_onoff): New function. * txr.c (help): List --yydebug option. (txr_main): --yydebug option implemented. --- parser.y | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'parser.y') diff --git a/parser.y b/parser.y index 54cc494b..983b05c9 100644 --- a/parser.y +++ b/parser.y @@ -1039,6 +1039,8 @@ not_a_clause : ALL { $$ = mkexp(all_s, nil, num(parser->lineno)); } %% +const int have_yydebug = YYDEBUG; + int yylex(YYSTYPE *, yyscan_t scanner); /* C99 inline instantiations. */ @@ -1046,6 +1048,13 @@ int yylex(YYSTYPE *, yyscan_t scanner); val rlcp(val to, val from); #endif +void yydebug_onoff(int val) +{ +#if YYDEBUG + yydebug = val; +#endif +} + static val sym_helper(parser_t *parser, wchar_t *lexeme, val meta_allowed) { scanner_t *scnr = parser->scanner; -- cgit v1.2.3