[antlr-interest] V2->v3 help

Gavin Lambert antlr at mirality.co.nz
Sat Mar 14 12:24:22 PDT 2009


At 11:47 14/03/2009, Des Hartman wrote:
>Can anyone help me with this conversion? I need to convert this 
>section of the code from V2 to V3. I have figured out the changes 
>from V2 import lexer to lexer, the protected to fragment and 
>setType to $Type=, but the part I am stumped on is how the code 
>in ALPHABETICAL sets the definitions for FUNCTION and CELL_REF.

Do you mean how those symbols themselves are defined?  Simply 
define an empty fragment rule:

fragment FUNCTION; ;

And incidentally, it's $type = FUNCTION, not $Type.  (ANTLR is 
case sensitive.)



More information about the antlr-interest mailing list