%{ #include %} %token tok_DIRN tok_IDENT %% exitList : {printf("Starting with an empty list!\n");} exitList : exitList exit {printf("Adding an exit!\n");} exit : tok_DIRN tok_IDENT {printf("Found an exit!\n");} %% #include "lex.yy.c" int yyerror(char *errMessage) { printf("Trouble: %s\n",errMessage); } main() { yyparse(); }