Use YYABORT instead of exit() to break out of yyparse().