[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Including files
Hendrik Boom wrote:
> Not if the language has specific syntactic positions in which the
> #include statements can occor.
In which case, I think that a Customized lexer could play the trick.
But you must be careful as the Parser is ALWAYS 1 token ahead!
The trick, in the custom lexer, is to provide a custom "PushbackReader"
to the constructor of the Lexer class, and change the "feed" to the
Reader when required.
Am I making sense to you?
Etienne
--
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc. e-mail: egagnon@j-meg.com
Author of SableCC: http://www.sable.mcgill.ca/sablecc/
----------------------------------------------------------------------