[prog] Yacc - double errors (EOF detection)

Jimen Ching jching at flex.com
Tue Feb 10 14:36:57 EST 2004


On Tue, 10 Feb 2004, Sue Stones wrote:
>My Yacc program keeps on trying to process things after it gets an end of
>file.  It even processes the EOF but just doesn't stop.

This is a common problem.  Most of the books I've read didn't have a
portable solution.  The solution I used is in the lexer.  The flex lexer
contains a special token <<EOF>> that you can detect.  I don't think
there's anything in yacc that will help here.

If you find a portable solution that consistently works, let me know.
Thanks.

--jc
-- 
Jimen Ching (WH6BRR)      jching at flex.com     wh6brr at uhm.ampr.org


More information about the Programming mailing list