ANTLR tokenizing works with space, but not without
I'm trying to figure out this bug. Currently, when I supply a few
different inputs, I get either the correct result, or the ANTLRWorks
debugger loops infinitely.
1) {v0, p1} = Infinite loop or mismatched token exception
2) {v0..v1} Works!
3) {v0,p1} Works? Why?! Notice the lack of space?
If anyone could help me understand why this is ambiguous, I'd really
appreciate it. I've tried changing operator precedence, and still, I
cannot get it to work the way I think it should. Thank you!
WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ { $channel =
HIDDEN; };
LEFTCURL : '{';
RIGHTCURL : '}';
REGISTER : ('v'|'p') NUMBER+;
REGISTERLIST : LEFTCURL REGISTER (',' REGISTER)* RIGHTCURL;
REGISTERANGE : LEFTCURL REGISTER '..' REGISTER RIGHTCURL;
No comments:
Post a Comment