xref: /netbsd/external/bsd/byacc/dist/test/pure_error.y (revision 6550d01e)
1 /*	$NetBSD: pure_error.y,v 1.1.1.1 2010/12/23 23:36:27 christos Exp $	*/
2 
3 %%
4 S: error
5 %%
6 
7 #include <stdio.h>
8 
9 int
10 main(void)
11 {
12     printf("yyparse() = %d\n", yyparse());
13     return 0;
14 }
15 
16 int
17 yylex(YYSTYPE *value)
18 {
19     return value ? 0 : -1;
20 }
21 
22 static void
23 yyerror(const char* s)
24 {
25     printf("%s\n", s);
26 }
27