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