If I have a simple grammar can't I just parse it with flex? =========================================================== Is your grammar recursive? That's almost always a sign that you're better off using a parser/scanner rather than just trying to use a scanner alone.