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

RE: Parser tools: How to make the lexer context sensitive?

> Is there somewhere else, I can set the flag?
> How does one obtain information in the lexer from the parser?
> How can one tell which terminal the parser is handling?
> The yacc approach is to use yytext - is there an equivalent 
> in the parser tools?
> Any suggestions are welcome (Even the obvious ones; 
> perhaps I missed something simple).
> Yours, 
> -- 
> Jens Axel Sgaard

Currently there is no way for the lexer to get useful information about
the state of the parser.  I suggest that you use a token
TYPENAME-OR-IDENTIFIER in all places where you would have used
either.  The only thing that could go wrong with this solution is the
introduction of a conflict in the parser.  In this case I suspect that
looking into the state of the parser would not help much either.

-Scott Owens