Record in parse table which actions can hide splits
Suppose a parse state S has multiple actions for a terminal lookahead symbol A. Then during incremental parsing, while in state S, the parser should not reuse a non-terminal lookahead B where FIRST(B) contains A, because reusing B might prematurely discard one of the possible actions that a batch parser would have attempted in state S, upon seeing A as a lookahead.
This commit is contained in:
parent
7fbb628c78
commit
c495076adb
19 changed files with 58613 additions and 60661 deletions
|
|
@ -74,11 +74,6 @@ ostream &operator<<(ostream &stream, const ParseAction &action) {
|
|||
case ParseActionTypeShift:
|
||||
return stream << string("#<shift state:") << to_string(action.state_index) <<
|
||||
string(" precedence:") << action.precedence_range << ">";
|
||||
case ParseActionTypeShiftExtra:
|
||||
return stream << string("#<shift_extra");
|
||||
case ParseActionTypeReduceExtra:
|
||||
return stream << "#<reduce_extra sym:" << action.symbol <<
|
||||
string(" precedence:") << to_string(action.precedence_range.min) << ">";
|
||||
case ParseActionTypeReduce:
|
||||
return stream << ("#<reduce sym" + to_string(action.symbol.index) + " " +
|
||||
to_string(action.consumed_symbol_count) + ">");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue