flex states vs. bison lookahead

bemmelen@iwma08.wt.tno.nl (Paul van Bemmelen)
27 Aug 1999 12:32:22 -0400

          From comp.compilers

Related articles
flex states vs. bison lookahead bemmelen@iwma08.wt.tno.nl (1999-08-27)
Re: flex states vs. bison lookahead webid@asi.fr (Armel) (1999-09-05)
| List of all articles for this month |
From: bemmelen@iwma08.wt.tno.nl (Paul van Bemmelen)
Newsgroups: comp.compilers
Date: 27 Aug 1999 12:32:22 -0400
Organization: TNO
Keywords: lex, yacc, question, comment

I have a flex scanner that contains a number of states, and action
code in the bison parser that can trigger a flex state change.


How can I know that when bison reads a lookahead token, it is the
correct one? Because of bison action code, that may trigger a flex
state change, the scanner may not be in the correct state for the
lookahead...!?


Note:
I don't want to know about lookahead... but it looks like
changing flex state in bison action code requires me to understand
all about lookahead.


Paul.
--
---------------------------------------------------------------------------
Paul van Bemmelen | phone : +31 15 2697431
Crash Safety Centre | fax : +31 15 2624321
TNO Automotive | e-mail: bemmelen@wt.tno.nl
P.O. Box 6033
2600 JA Delft
The Netherlands
[The unfortunate answer is that you can't tell when the parser will look
ahead other than by looking at the state tables in y.output. But in
practice, this technique works well because it's rare to want to change
state in a context that needs lookahead. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.