summaryrefslogtreecommitdiffstats
path: root/parser.y
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-24 06:57:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-24 06:57:09 -0700
commitaf8709c031d7f0b7d61872536922d3acf16180c5 (patch)
treec61a1d5c4eb7fdf06c024303b77fd174ac033b11 /parser.y
parent4e3e4e1ccc60331ff8ff4c1c139e9da3c95e2272 (diff)
downloadtxr-af8709c031d7f0b7d61872536922d3acf16180c5.tar.gz
txr-af8709c031d7f0b7d61872536922d3acf16180c5.tar.bz2
txr-af8709c031d7f0b7d61872536922d3acf16180c5.zip
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.
Diffstat (limited to 'parser.y')
-rw-r--r--parser.y9
1 files changed, 9 insertions, 0 deletions
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;