Home | History | Annotate | Download | only in tests
      1 grammar t039labels;
      2 options {
      3   language = Python;
      4 }
      5 
      6 a returns [l]
      7     : ids+=A ( ',' ids+=(A|B) )* C D w=. ids+=. F EOF
      8         { l = ($ids, $w) }
      9     ;
     10 
     11 A: 'a'..'z';
     12 B: '0'..'9';
     13 C: a='A' { print $a };
     14 D: a='FOOBAR' { print $a };
     15 E: 'GNU' a=. { print $a };
     16 F: 'BLARZ' a=EOF { print $a };
     17 
     18 WS: ' '+  { $channel = HIDDEN };
     19