'What's wrong with this antlr grammar? wildcard problem?
the grammar is simple enough:
expression: signal logic_op right_op;
signal: .+?;
right_op: .+?;
logic_op: GT|GTE|LT|LTE|NOT|EQ;
GT: '>';
GTE: '>=';
LT: '<';
LTE: '<=';
NOT: 'NOT';
EQ: '=';
WS : [ \t\r\n]+ -> skip ;
but I tested it with 'a > b', it gives me this error:
line 1:0 token recognition error at: 'a'
line 1:4 token recognition error at: 'b'
line 1:5 mismatched input '<EOF>' expecting {'>', '>=', '<', '<=', 'NOT', '=', WS}
Why?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
