Re: Getting bison to ignore tokens... sometimes!

2011-05-31 Thread Evan Lavelle
If your parser knows that it's dealing with a statement, you could try lexical feedback (look up "lexical tie-ins" in the bison docs, and google "scanner feedback" or "lexical feedback"). The parser sets a flag to tell the lexer that it's inside a statement, and the lexer then returns the NL wh

Getting bison to ignore tokens... sometimes!

2011-05-31 Thread Paulo J. Matos
Hi, I am pretty sure bison cannot simply ignore tokens. However, I don't know what's the usual flex/bison pattern to solve this issue. I am implementing a parser for a language that terminates statements with a newline, however, the newline doesn't always terminate statements... only after a s