[antlr-interest] simple grammar question
mike at 7f.com
Fri Mar 2 18:37:05 PST 2012
I'm in the process of learning antlr (I just ordered Terrance's books), but
there something I am missing here. The below compiles fine using
AntlrWorks, but when I feed it:
I get a a MissingTokenException (see attached bitmap), after it's matched
an identifier and a /.
compilationUnit : relativePath;
identifier : IdentifierStart IdentifierPart* ;
relativePath : identifier (SLASH identifier)* ;
SLASH : '/';
'a'..'z' | 'A'..'Z' | '_' | '0'..'9'
'a'..'z' | 'A'..'Z' | '_'
My expectation there was that identifier would match an alphanumeric
string, and that the rule for relativePath would let me string such
identifiers together with / in between. However, I'm clearly missing
something obvious. Thanks in advance.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8172 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20120302/44d8a1cc/attachment.jpg
More information about the antlr-interest