I have the following production in my ANTLR grammar:
rich_newick_string
: str=(.*';') { stack.pushRichNewickString($str.text); };
I expected some string match to be passed to my pushRichNewickString method, but instead I’m getting null. What am I doing wrong?
Thanks.
You can’t put more than one lexer/parser rule inside parenthesis and then assign a label to it:
Try this instead:
Also, do you really have a
.*inside your parser rule? Are you aware this does not match zero or more characters, but zero or more tokens instead?