]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/byacc/test/err_syntax16.y
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / byacc / test / err_syntax16.y
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 }