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