“该决定无法区分替代方案1,2对于输入......”

时间:2017-03-06 11:15:46

标签: java antlr natty

我正在修改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)?)
  ;

任何人都可以为我解释错误并指出正确的方向吗?

提前致谢

0 个答案:

没有答案