2

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

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)的含义。

4

1 回答 1

1

您的语法可能不明确,因为不止替代路径可以解析相同的输入字符串。所以解析器将不知道哪个是“正确”的方式。您应该更正语法或语义谓词以防止歧义。

于 2014-06-09T12:19:22.330 回答