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