我正在尝试使用JAVACC解析一个简单的输入,我需要前瞻但它没有按预期工作
LOOKAHEAD(LikeExpression())
e=LikeExpression() | e=InExpression()
LikeExpression():
{..
..}
{
<LIKE>
}
InExpression():
{..
..}
{
[<NOT>]
("(")
}
INPUT:“像DELHI一样的城市”
com.sample.ParseException: Encountered " "LIKE" "like "" at line 1, column 35.
Was expecting one of:
"NOT" ...
"(" ...