I'm trying to compile a grammar and get it works in ANTLR4. The grammar was written for ANTLR3 and I'm getting a lot of compilation errors. Here is one of them:
syntax error: '->' came as a complete surprise to me while looking for rule element
This is the rule causing the error
tokens {
ZONE;
ZONE_OFFSET;
}
time_zone_abbreviation
: UTC -> ZONE["UTC"]
| EST -> ZONE["America/New_York"]
| CST -> ZONE["America/Chicago"]
| PST -> ZONE["America/Los_Angeles"]
| MST -> ZONE["America/Denver"]
| AKST -> ZONE["America/Anchorage"]
| HAST -> ZONE["Pacific/Honolulu"]
;
I know the ->
operator can be used to specify lexer command in ANTLR4. But what does the operator mean in ANTLR3?