%{ #include %} %% S : C C ; C : 'c' C | 'd' ; %% main() { return yyparse(); } int yylex(void) { int c; while((c = getchar()) == ' '); if (c == '\n') return 0; return c; } void yyerror() {}