简体   繁体   English

这些ANTLR警告是什么意思

[英]What do these ANTLR warnings mean

I have a grammar that appears to be working but generates a ton of warnings. 我有一个语法似乎在起作用,但是会产生大量警告。 How serious are these warnings and can someone give some guidance on how to fix them? 这些警告有多严重?有人可以提供一些有关如何纠正它们的指导吗?

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

For the warning(200), what impact would disabling an alternative? 对于警告(200),禁用替代品会产生什么影响? The main thing I think would be that the potential AST could have different shape depending on which alternative was disabled. 我认为最主要的是,潜在的AST可能会根据禁用的替代项而具有不同的形状。

I'm not sure the implications of warning(203). 我不确定警告的含义(203)。

Your grammar is probably ambiguous in that more than alternative path can parse the same input string. 您的语法可能含糊不清,因为替代路径无法解析相同的输入字符串。 So the parser will not know which is the 'right' way. 因此,解析器将不知道哪种方法是正确的。 You should correct the grammar or the semantic predicates to prevent ambiguity. 您应该纠正语法或语义谓词以防止歧义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM