Hi !
I just cannot figure out what is wrong with my grammar.
Here it is:
grammar Test;
scenario :
statement;
statement :
sequenceStatement ;
sequenceStatement
: 'DefSequence' ID WHITESPACE* '{' VALUE '}' ';'? '\n'? ;
ID : LETTER (LETTER | DIGIT | '_' )* ;
fragment DIGIT : '0'..'9';
fragment LETTER : 'a'..'z' | 'A'..'Z';
WHITESPACE : ( '\t' | ' ' | '\n'|'\r')+ {$channel = HIDDEN;} ;
VALUE
: ('\u0041'|'\u0042'|'\u0043') DIGIT DIGIT DIGIT DIGIT | ('-')*
{System.out.println("VALUE detected: ");};
---------------------------------------------------------
I cut my original grammar down to the bare minimum.
DefSequence L { -- } works
DefSequence L { A1200} gives me MismatchedTokenException: line 1:16
mismatched input 'A1200' expecting '\u0006'
Do I have to mention, that I am new to ANTLR ? I don't think so !
regards
Dietmar
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.