Open DiscreteTom opened 1 year ago
Maybe we can write an algorithm to check if a conflict can be safely resolved by re-parse.
For the above conflict, it can be safely resolved by re-parse without early accept.
Another idea: subset construction (子集构造法) to turn the NFA into DFA?
E.g. when we parsing javascript:
with the following grammar rules:
when we digest
f(({ a
we don't know whether thea
is an object entry or an arrow function param. We have to peek maybe many tokens to judge that.Solution for this issue: