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