[antlr-interest] partial tree rewrites

Gavin Lambert antlr at mirality.co.nz
Thu Jul 16 13:58:37 PDT 2009


At 08:30 17/07/2009, Benoit Fouletier wrote:
>BTW, should I mark these kind of subrule as fragments? I don't 
>really get when to use fragment.

No, fragment applies only to lexer rules (with an initial 
capital); it makes them non-toplevel rules.  To put it another 
way, every lexer rule that does *not* use fragment is a candidate 
output token.  (And in general, a non-fragment lexer rule should 
not call another non-fragment lexer rule, as that suggests 
ambiguity.)



More information about the antlr-interest mailing list