With v2.7.7, the AST has all the expected nodes, but with v3.3, the
limit_val nodes get dropped.  Am I overlooking some obvious mistake here?

 

Regards,

--Mike

 

Here's my input:

----------------------

mm-T_minute:bbc-xyzzy

 

And the v3.3 output:

------------------------

(FIELD mm (var T_minute) limits)

 

Here's the grammar

---------------------------

grammar sfield;

 

options

{

  output=AST;

  ASTLabelType=CommonTree;

}

 

tokens

{

  NAME;

  FIELD;

}

               

sfield

               :              field_name '-' var qualifier*          ->
^(FIELD field_name var qualifier*)

               ;              

 

field_name

               :              ID

               ;

 

var

               :              ID           -> ^(NAME["var"] ID)

               ;

               

qualifier

               :              ':' limits ->           ^(limits)

               ;

 

limits

               :              limit_val '-' limit_val         ->
^(NAME["limits"] limit_val+)

               ;

 

limit_val

               :                 ID -> ID

               ;

 

 

ID: (LETTER|'_')(LETTER|'_'|DIGIT)*;

 

fragment LETTER: LOWER | UPPER;

fragment LOWER: 'a'..'z';

fragment UPPER: 'A'..'Z';

fragment DIGIT: '0'..'9';

fragment SPACE: ' ' | '\t';

fragment SIGN: '+' | '-';

NEWLINE: ('\r'? '\n')+ { $channel = HIDDEN; };

WHITESPACE: SPACE+ { $channel = HIDDEN; };

 

OTHER : . ;

 


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to