err_syntax5.y revision 285830
1%{ 2int yylex(void); 3static void yyerror(const char *); 4%} 5 6%union { 7 char *str; 8 int num 9 10%% 11S: error 12%% 13 14#include <stdio.h> 15 16int 17main(void) 18{ 19 printf("yyparse() = %d\n", yyparse()); 20 return 0; 21} 22 23int 24yylex(void) 25{ 26 return -1; 27} 28 29static void 30yyerror(const char* s) 31{ 32 printf("%s\n", s); 33} 34