# Checking GLR Parsing: Regression Tests -*- Autotest -*-
-# Copyright (C) 2002-2003, 2005-2007, 2009-2013 Free Software
+# Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software
# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
return 0;
}
-const char *input = YY_NULL;
+const char *input = YY_NULLPTR;
int
main (int argc, const char* argv[])
}
]AT_YYERROR_DEFINE[
-FILE *input = YY_NULL;
+FILE *input = YY_NULLPTR;
int P[] = { P1, P2 };
int O[] = { O1, O2 };
;
%%
-]AT_YYLEX_DEFINE(["a"])[
]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE(["a"])[
]AT_MAIN_DEFINE[
]])
AT_BISON_OPTION_POPDEFS
int exit_status = yyparse ();
if (parent_rhs_before_value)
{
- fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
+ fprintf (stderr, "'parent_rhs_before' destructor not called.\n");
exit_status = 1;
}
if (merged_value)
{
- fprintf (stderr, "`merged' destructor not called.\n");
+ fprintf (stderr, "'merged' destructor not called.\n");
exit_status = 1;
}
if (parent_rhs_after_value)
{
- fprintf (stderr, "`PARENT_RHS_AFTER' destructor not called.\n");
+ fprintf (stderr, "'PARENT_RHS_AFTER' destructor not called.\n");
exit_status = 1;
}
return exit_status;
int exit_status = yyparse () != 1;
if (parent_rhs_before_value)
{
- fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
+ fprintf (stderr, "'parent_rhs_before' destructor not called.\n");
exit_status = 1;
}
return exit_status;
b: 'b';
d: /* nada. */;
%%
-]AT_YYLEX_DEFINE(["abc"])[
]AT_YYERROR_DEFINE[
+]AT_YYLEX_DEFINE(["abc"])[
]AT_MAIN_DEFINE[
]])
AT_BISON_OPTION_POPDEFS
])
AT_CLEANUP
+
+
+## ----------------------------------------------------------------- ##
+## Predicates. ##
+## ##
+## http://lists.gnu.org/archive/html/bug-bison/2013-10/msg00004.html ##
+## ----------------------------------------------------------------- ##
+
+AT_SETUP([Predicates])
+
+# FIXME: We need genuine test cases with uses of %?.
+
+AT_DATA_GRAMMAR([input.y],
+[[%glr-parser
+%expect-rr 1
+%%
+// Exercise "%?{...}" and "%? {...}".
+widget:
+ %? {new_syntax} "widget" id new_args { $$ = f($3, $4); }
+| %?{!new_syntax} "widget" id old_args { $$ = f($3, $4); }
+;
+id:;
+new_args:;
+old_args:;
+%%
+]])
+
+AT_BISON_CHECK([[input.y]])
+
+AT_CLEANUP