[antlr-interest] a quick question from a novice

Terence Parr parrt at cs.usfca.edu
Thu Apr 16 04:06:52 PDT 2009


Hi Yi, that's v2 format not v3.

We use = not : now for labels in v3.  And we'd use $i not #i

Ter
On Apr 16, 2009, at 12:10 PM, Yi Huang wrote:

>
>
>
> Hi folks,
>
> I am new to ANTLR and I have a problem in understanding an ANTLR
> grammar fragment developed by others. I skimmed "The Definitive ANTLR
> Reference" but could not find an answer immediate. I hope somebody  
> here
> could help me out.
>
> The question is how to interpret "i:" and "#i" in the following  
> fragment. I
> know ':' represents rule definition, but what does it mean here?  
> Also, I cannot
> find the meaning of the symbol '#' anywhere in the book. Any hint  
> or reference
> to useful materials would be appreciated.
>
> token
>     :
>         i:"keyword"^ anotherToken {#i.func(IMPORT_DEF);}
>     ;
>
> Thanks in advance,
>
> --Yi
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/ 
> your-email-address



More information about the antlr-interest mailing list