]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/byacc/test/err_syntax25.y
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / byacc / test / err_syntax25.y
1 %{
2 int yylex(void);
3 static void yyerror(const char *);
4 %}
5
6 %union {
7         int ival;
8         double dval;
9 }
10
11 %union {
12         int ival2;
13         double dval2;
14 }
15
16 %start expr
17 %type <tag2> expr
18
19 %token NUMBER
20
21 %%
22
23 expr  :  '(' recur ')'
24       ;
25
26 recur :  NUMBER
27         { $$ = 1; }
28       ;
29
30 %%
31
32 #include <stdio.h>
33
34 int
35 main(void)
36 {
37     printf("yyparse() = %d\n", yyparse());
38     return 0;
39 }
40
41 int
42 yylex(void)
43 {
44     return -1;
45 }
46
47 static void
48 yyerror(const char* s)
49 {
50     printf("%s\n", s);
51 }