我正在为我的语法开发一个解析器。我的目标是让它毫无前瞻,而这正是我真正努力的目标。
这是一个缩小的例子,我相信这足以证明我遇到的问题。
void main() : {}
{
(A())* (B())*
}
void A() : {}
{
C() <ID>
}
void B() : {}
{
<ID> Z()
}
void C() : {}
{
<bah>
| <bha>
| <ID>
}
这是输出警告(我想删除它)
Warning: Choice conflict in (...)* construct at line 200, column 23.
Expansion nested within construct and expansion following construct
have common prefixes, one of which is: <ID>
Consider using a lookahead of 2 or more for nested expansion.