%{ #include int yyerror (char const *message) { // fprintf(stderr,"<%s>\n", message); return 0; } /* analyse lexicale minimale : utilise uniquement les */ /* tokens implicites de bisons sur 1 car. ASCII */ int yylex(){ return(getchar()); } int nb_OK=0; %} %error-verbose %token 'a' 'b' 'c' '\n' %% Axiome : | Axiome S '\n'{nb_OK++;} | Axiome error '\n' ; S : T | 'a' S 'c' ; T : | 'b' T 'c' ; %% int main(void) { yyparse(); printf("nb_OK=%d\n",nb_OK);}