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