If i use [] with a lexer rule it accepts but not with a parser rule why ?
I have a parser rule called "var" and i will like to test the value if declared by doing something like this:
-> ^(DECLARATION type var[Main.symbols.test_declared($var.text)] expression?);
but i get :
unexpected token: Main.symbols.test_declared($var.text)
is there a way to get around this ?
Most tutorials i have seen, only LEXER rules are used, but i can't based on my grammar,IDENTIFIER is a part of var.