0
时,我有一个简单的规则,像这样:ANTLR - 句点字符不匹配匹配 “任何东西”
ifClause: 'if' '(' condition ')' '{' (structField)+ '}' ;
condition: .*?;
这适用于解析:
if (abc == def) {
<something>
}
但在错误的:
if (abc.xyz == def) {
<something>
}
与错误:
line NN:MM token recognition error at: '.'
匹配时.*?
I am using Antlr 4.5.3 and Python output.
我将“条件”更改为“COND:。*?”,现在我遇到了与模糊不同的问题,这些问题与问题无关。谢谢! – shikhanshu