这些ANTLR警告意味着什么

时间:2012-12-07 17:37:42

标签: java parsing antlr antlr3

我的语法似乎有效,但会产生大量警告。 这些警告有多严重,有人可以就如何解决它们提供一些指导吗?

Warning 200
Decision can match input such as "LCURLY LPAREN" using multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input

Warning 200:
Decision can match input such as "LCURLY PLUS" using multiple alternatives: 1, 2

As a result, alternative(s) 2 were disabled for that input
Semantic predicates were present but were hidden by actions.

Warning 203
Input such as "Date" is insufficiently covered with predicates at locations: alt 1: line 346: at Date, al
t 2: line 346: at Date

对于警告(200),禁用替代方案会产生什么影响?我认为主要的是潜在的AST可能会有不同的形状,具体取决于哪种替代方案被禁用。

我不确定警告的含义(203)。

1 个答案:

答案 0 :(得分:1)

你的语法可能含糊不清,因为替代路径可以解析相同的输入字符串。所以解析器不会知道哪个是正确的'办法。你应该纠正语法或语义谓词,以防止歧义。