0

我目前正在修改 Natty 并为我自己的日期格式创建一些规则。Natty 使用 ANTLR v3.5.2

当我编译代码时,我收到了这个错误:

com\joestelmach\natty\generated\DateParser.g:295:46:该决定无法区分替代输入 1,2,例如“WHITE_SPACE INT_10 TH WHITE_SPACE JANUARY COMMA WHITE_SPACE INT_00 INT_00 WHITE_SPACE INT_00 INT_00 EOF”

如果我看一下以下规则在第 295 行:

relaxed_day_of_week
  : (prefix WHITE_SPACE)? day_of_week COMMA? WHITE_SPACE? -> day_of_week
  ;

我查看了 ANTLR 文档并搜索了 Stack Overflow,但找不到有关此类错误的太多信息。我假设这是由于另一个使用“relaxed_day_of_week”的规则存在歧义?

调用上述规则的规则是:

custom_date
  : relaxed_day_of_week WHITE_SPACE relaxed_day_of_month WHITE_SPACE relaxed_month (date_time_separator explicit_time_custom)? relaxed_year 
       -> ^(EXPLICIT_DATE relaxed_day_of_week relaxed_day_of_month relaxed_month relaxed_year (date_time_separator explicit_time_custom)?)
  ;

谁能为我解释错误并指出正确的方向?

提前致谢

4

0 回答 0