Keyword clashing with terminal rule [message #1858872] |
Thu, 27 April 2023 08:58  |
Eclipse User |
|
|
|
I have a data rule containing the keyword '/':
MultiplicativeOperation returns Expression:
BinaryOperation ( =>({ArithmeticOperation.left=current} operator=('*'|'/')) right=RosettaCalcBinary)*
;
Now I wanted to add support for JavaScript like regular expressions, e.g., `/[a-b]+/`. I added the following terminal rule for it:
terminal PATTERN returns Pattern:
'/' ( '\\' . | !('\\'|'/') )* '/'
;
(given `type Pattern wraps Pattern` in Xcore)
However, now the `MultiplicativeOperation` rule doesn't work anymore. Any occurences of a division "a / b" results in a syntax error "mismatched character '<EOF>' expecting '/'".
Is there a way around this?
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06325 seconds