[antlr-interest] Return types on lexer rules do not seem to work.

Johannes Luber jaluber at gmx.de
Wed Jul 18 13:11:56 PDT 2007


Randall R Schulz wrote:
> On Wednesday 18 July 2007 10:31, Johannes Luber wrote:
>> ...
>>
>> Only tree and parser rules may include return values. The book states
>> this on page 86. ...
>>
>> But it should be possible to use scopes for this purpose instead.
> 
> How is that? Lexical analysis is all done before parsing begins.

I didn't use scopes to transfer information between parser and lexer
rules, so I don't know of this would be possible or not. But within the
lexer the appropriate code was generated - although untested yet. Every
time I seem to get closer to finish my side project, a new problem turns
up... At least I need only to rework the data storage side and only the
string templates before I can turn my attention back to the C# grammar.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list