can someone help me here, i am in stuck with this:
primaryExprList ('|'^ primaryExprList)*
I want to make it instead of ‘|’ to use BOOLEANOR
comment for Vojislav Stojkovic:
I have tried it but it wont work correctly when i use a|b|c it should be like this
BOOLEANOR
| \
BOOLEANOR c
| |
a b
and your soultion is like this:
BOOLEANOR
/ | \
a b c
which is not coorect.
I don’t really see the need. If you define a
BOOLEANORtoken (lexer rule):then the type of the root with be
BOOLEANORand its inner text is"|".But, to answer your question (or propose a solution), the way to really change the root, is by using a rewrite rule like this:
which will parse the input: “a|b|c” into the following AST: