Home | History | Annotate | Line # | Download | only in test
      1 /*	$NetBSD: err_syntax16.y,v 1.1.1.3 2016/01/09 21:59:45 christos Exp $	*/
      2 
      3 %{
      4 int yylex(void);
      5 static void yyerror(const char *);
      6 %}
      7 
      8 %token second
      9 
     10 %%
     11 
     12 firstx
     13 	: '(' secondx
     14 	;
     15 
     16 second	:
     17 	')'
     18 	;
     19 
     20 S: error
     21 %%
     22 
     23 #include <stdio.h>
     24 
     25 int
     26 main(void)
     27 {
     28     printf("yyparse() = %d\n", yyparse());
     29     return 0;
     30 }
     31 
     32 int
     33 yylex(void)
     34 {
     35     return -1;
     36 }
     37 
     38 static void
     39 yyerror(const char* s)
     40 {
     41     printf("%s\n", s);
     42 }
     43