1 /* $NetBSD: err_syntax15.y,v 1.1.1.1 2015/01/03 22:58:23 christos Exp $ */ 2 3 %% 4 %{ 5 int yylex(void); 6 static void yyerror(const char *); 7 %} 8 9 %start text 10 11 %% 12 S: error 13 %% 14 15 #include <stdio.h> 16 17 int 18 main(void) 19 { 20 printf("yyparse() = %d\n", yyparse()); 21 return 0; 22 } 23 24 int yylex(void)25yylex(void) 26 { 27 return -1; 28 } 29 30 static void yyerror(const char * s)31yyerror(const char* s) 32 { 33 printf("%s\n", s); 34 } 35