[antlr-interest] Question about the antlrv3.g

Gavin Lambert antlr at mirality.co.nz
Mon Aug 3 13:59:50 PDT 2009


At 08:46 4/08/2009, Shaoting Cai wrote:
>Hello,
>
>In the latest ANTLRv3.g 
>(<http://fisheye2.atlassian.com/browse/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g?r=5943#l185>http://fisheye2.atlassian.com/browse/antlr/tool/src/main/antlr3/org/antlr/grammar/v3/ANTLRv3.g?r=5943#l185)
>...
>184     ruleScopeSpec
>185         :    'scope' ACTION -> ^('scope' ACTION)
>186         |    'scope' id (',' id)* ';' -> ^('scope' id+)
>187         |    'scope' ACTION
>188              'scope' id (',' id)* ';'
>189              -> ^('scope' ACTION id+ )
>190         ;
>...
>
>It seems to me that the alternatives are duplicated.  Or is there 
>any purpose that they are here?

They're not duplicated, just poorly indented.  Alt 3 is basically 
Alt 1 + Alt 2, but produces a different AST.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090804/c5c58843/attachment.html 


More information about the antlr-interest mailing list