At 20:30 2/12/2009, David-Sarah Hopwood wrote:
 >You probably want these to be lexer rules, i.e.
 >
 >  prog     : command+ ;
 >  command  : (Function | Var)+ ;
 >
 >  Function : ('A'..'Z')+ ',' ;
 >  Var      : ('A'..'Z')+ ;
 >  WS       : ( '\t'|' '|'\r'|'\n'|'\u000C' )+ { $channel = 
HIDDEN;
 >} ;

Actually it's probably better to keep function/var out of the 
lexer:

prog : command+ ;
command : (function | var)+ ;
function : ID COMMA ;
var : ID ;

fragment Letter : 'A'..'Z';
COMMA : ',' ;
ID : Letter+ ;
WS : ( '\t'|' '|'\r'|'\n'|'\u000C' )+ { $channel = HIDDEN; }


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