summaryrefslogtreecommitdiffstats
path: root/contrib/byacc/test/err_syntax7b.y
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/byacc/test/err_syntax7b.y')
-rw-r--r--contrib/byacc/test/err_syntax7b.y31
1 files changed, 31 insertions, 0 deletions
diff --git a/contrib/byacc/test/err_syntax7b.y b/contrib/byacc/test/err_syntax7b.y
new file mode 100644
index 0000000..a3e5e21
--- /dev/null
+++ b/contrib/byacc/test/err_syntax7b.y
@@ -0,0 +1,31 @@
+%{
+int yylex(void);
+static void yyerror(const char *);
+%}
+
+%token <text> '\x.'
+
+%%
+S: error
+%%
+
+#include <stdio.h>
+
+int
+main(void)
+{
+ printf("yyparse() = %d\n", yyparse());
+ return 0;
+}
+
+int
+yylex(void)
+{
+ return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+ printf("%s\n", s);
+}
OpenPOWER on IntegriCloud