i am writing a grammar in ANTLR and i want to make a question about return values. I have this rule:
mainParser returns [int test]
:
triple EOF
{
$test = 0;
}
;
When i call it from generated java code i can't take back the test value, because it returns me a "parser object":
How to make it to return Integer, String etc. ?