]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/byacc/test/code_error.y
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / byacc / test / code_error.y
1 %{
2
3 #ifdef YYBISON
4 int yylex(void);
5 static void yyerror(const char *);
6 #endif
7
8 %}
9 %%
10 S: error
11 %%
12
13 #include <stdio.h>
14
15 #ifdef YYBYACC
16 extern int YYLEX_DECL();
17 #endif
18
19 int
20 main(void)
21 {
22     printf("yyparse() = %d\n", yyparse());
23     return 0;
24 }
25
26 int
27 yylex(void)
28 {
29     return -1;
30 }
31
32 static void
33 yyerror(const char* s)
34 {
35     printf("%s\n", s);
36 }