xref: /freebsd/contrib/byacc/test/err_syntax16.y (revision a0ee8cc6)
1 %{
2 int yylex(void);
3 static void yyerror(const char *);
4 %}
5 
6 %token second
7 
8 %%
9 
10 firstx
11 	: '(' secondx
12 	;
13 
14 second	:
15 	')'
16 	;
17 
18 S: error
19 %%
20 
21 #include <stdio.h>
22 
23 int
24 main(void)
25 {
26     printf("yyparse() = %d\n", yyparse());
27     return 0;
28 }
29 
30 int
31 yylex(void)
32 {
33     return -1;
34 }
35 
36 static void
37 yyerror(const char* s)
38 {
39     printf("%s\n", s);
40 }
41