-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-parse for unresolved conflict? #19
Comments
However, after enabling re-parse and don't resolve conflicts, the parser will usually use the wrong grammar rule to reduce. For those conflicts that can't be resolved by next grammar, developers can use a function as the resolver's accetper, which can use the lexer to get more following tokens to resolve the conflict. .resolveRR(
reducerRule,
anotherRule,
{
next: "*",
accept: ({ lexer }) => {
lexer.clone().lex();
return true;
},
},
); |
In LR(1) we only check the next grammar to resolve the conflict but sometimes it's not enough.
Maybe we can add something like re-parse to rollback the parser, just like re-lex?
This may impact the performance, consider add a new build option
reParse: boolean
.The text was updated successfully, but these errors were encountered: