xref: /netbsd-src/external/bsd/byacc/dist/test/code_debug.y (revision 781cc16b73421ffc44afa4f3c196f4c42bce8c5c)
1*781cc16bSchristos /*	$NetBSD: code_debug.y,v 1.1.1.3 2016/01/09 21:59:45 christos Exp $	*/
2*781cc16bSchristos 
3428aa3b9Schristos %{
4428aa3b9Schristos 
5428aa3b9Schristos #ifdef YYBISON
6428aa3b9Schristos int yylex(void);
7428aa3b9Schristos static void yyerror(const char *);
8428aa3b9Schristos #endif
9428aa3b9Schristos 
10428aa3b9Schristos %}
11428aa3b9Schristos %%
12428aa3b9Schristos S: error
13428aa3b9Schristos %%
14428aa3b9Schristos 
15428aa3b9Schristos #include <stdio.h>
16428aa3b9Schristos 
17428aa3b9Schristos #ifdef YYBYACC
18428aa3b9Schristos extern int YYLEX_DECL();
19428aa3b9Schristos #endif
20428aa3b9Schristos 
21428aa3b9Schristos int
main(void)22428aa3b9Schristos main(void)
23428aa3b9Schristos {
24428aa3b9Schristos     printf("yyparse() = %d\n", yyparse());
25428aa3b9Schristos     return 0;
26428aa3b9Schristos }
27428aa3b9Schristos 
28428aa3b9Schristos int
yylex(void)29428aa3b9Schristos yylex(void)
30428aa3b9Schristos {
31428aa3b9Schristos     return -1;
32428aa3b9Schristos }
33428aa3b9Schristos 
34428aa3b9Schristos static void
yyerror(const char * s)35428aa3b9Schristos yyerror(const char* s)
36428aa3b9Schristos {
37428aa3b9Schristos     printf("%s\n", s);
38428aa3b9Schristos }
39