I am converting from antlr3 to 4. I have stripped out all the syntactic predicates, but now I am struggling finding the equivalent of something like this in antlr4
relaxed_date_month_first
: relaxed_day_of_week? relaxed_month COMMA? WHITE_SPACE relaxed_day_of_month (relaxed_year_prefix relaxed_year)?
-> ^(EXPLICIT_DATE relaxed_day_of_month relaxed_month relaxed_day_of_week? relaxed_year?)
I get an error at input "->" and "^". It says, "{EXPECTING TOKEN_REF, RULE_REF...ACTION}". How can I rewrite that grammar rule to so as to be antlrV4 compliant?