3
我想編譯一個語法,並讓它在ANTLR4中有效。這個語法是爲ANTLR3編寫的,我收到了很多編譯錯誤。這裏是其中的一個:ANTLR3中的 - >運算符是什麼意思?
syntax error: '->' came as a complete surprise to me while looking for rule element
這是導致錯誤
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"]
;
我知道->
操作可用於ANTLR4指定詞法命令規則。但是運營商在ANTLR3中意味着什麼?