xref: /netbsd-src/external/bsd/byacc/dist/test/code_error.y (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /*	$NetBSD: code_error.y,v 1.1.1.3 2011/09/10 21:22:09 christos Exp $	*/
2 
3 %%
4 S: error
5 %%
6 
7 #include <stdio.h>
8 
9 #ifdef YYBYACC
10 extern int YYLEX_DECL();
11 static void YYERROR_DECL();
12 #endif
13 
14 int
15 main(void)
16 {
17     printf("yyparse() = %d\n", yyparse());
18     return 0;
19 }
20 
21 int
22 yylex(void)
23 {
24     return -1;
25 }
26 
27 static void
28 yyerror(const char* s)
29 {
30     printf("%s\n", s);
31 }
32