help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison & flex on start conditions


From: Evan Lavelle
Subject: Re: Bison & flex on start conditions
Date: Mon, 16 Jan 2006 08:56:38 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Henrik Sorensen wrote:

For the pl1 problem, I cheated a bit with flex, and when certain conditions are met I simply save all the token met, and then change them to what I need before returning the tokens to bison. If you are interested in more feel free to contact me, or better look at the code (pl1gcc.sourceforge.net).

This is great if you can do it, but it means that you're doing the parsing in lex ('when certain conditions are met'). If your analysis is so complex that you can't do it in lex, then you really need to do it in bison, where you run into the potential look-ahead problem. What makes the problem even worse is that you're not even guaranteed that there *is* a look-ahead token: sometimes there is, sometimes there isn't.

Evan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]