xref: /netbsd-src/external/bsd/byacc/dist/test/err_syntax5.y (revision 781cc16b73421ffc44afa4f3c196f4c42bce8c5c)
1*781cc16bSchristos /*	$NetBSD: err_syntax5.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 %union {
9428aa3b9Schristos 	char *str;
10428aa3b9Schristos 	int num
11428aa3b9Schristos 
12428aa3b9Schristos %%
13428aa3b9Schristos S: error
14428aa3b9Schristos %%
15428aa3b9Schristos 
16428aa3b9Schristos #include <stdio.h>
17428aa3b9Schristos 
18428aa3b9Schristos int
19428aa3b9Schristos main(void)
20428aa3b9Schristos {
21428aa3b9Schristos     printf("yyparse() = %d\n", yyparse());
22428aa3b9Schristos     return 0;
23428aa3b9Schristos }
24428aa3b9Schristos 
25428aa3b9Schristos int
yylex(void)26428aa3b9Schristos yylex(void)
27428aa3b9Schristos {
28428aa3b9Schristos     return -1;
29428aa3b9Schristos }
30428aa3b9Schristos 
31428aa3b9Schristos static void
yyerror(const char * s)32428aa3b9Schristos yyerror(const char* s)
33428aa3b9Schristos {
34428aa3b9Schristos     printf("%s\n", s);
35428aa3b9Schristos }
36