Troubles with returns declaration on the first parser rule in an ANTLR4 grammar
问题 I am using returns for my parser rules which works for all parser rules except the first one. If the first parser rule in my grammer uses the returns declaration ANTLR4 complains as follows: expecting ARG_ACTION while matching a rule If I add another parser rule above which does not use "returns" ANTLR does not complain. Here you have a grammar reduced to the problem: grammar FirstParserRuleReturnIssue; ID : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*; aRule returns [String s]: