1 /* $NetBSD: err_syntax16.y,v 1.1.1.1 2015/01/03 22:58:23 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 yylex(void)33yylex(void) 34 { 35 return -1; 36 } 37 38 static void yyerror(const char * s)39yyerror(const char* s) 40 { 41 printf("%s\n", s); 42 } 43