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