[antlr-interest] Fwd: imaginary nodes

Johannes Luber jaluber at gmx.de
Tue Oct 9 07:28:33 PDT 2007


Austin Hastings wrote:
> Johannes,
> 
> Are "orphaned" rules considered imaginary? Is this true if they are part
> of an orphaned tree, or only if they are unreferenced and empty?
> 
Not sure if those tokens can't be generated, even if there are other
references, but then they aren't imaginary tokens. If you refer to the
situation that the lexer rule isn't empty then I don't know if that is
causing the use of imaginary token to fail. But in my understanding
imaginary tokens have no children of their own, unless they are used in
rewrite rules.

> Does this have any impact on the generated code? Will functions for
> those node still be emitted?

I suppose that there will be extraneous code emitted in the empty rule
case but that shouldn't have any negative impact per se.

Best regards,
Johannes Luber


More information about the antlr-interest mailing list