Use different types for advance and accept-token actions
Unlike with parse actions, lexical actions of different types never appear in the same places in the table
This commit is contained in:
parent
1ec39abe6a
commit
6401a065ae
13 changed files with 147 additions and 185 deletions
|
|
@ -128,10 +128,11 @@ set<Symbol> ParseState::expected_inputs() const {
|
|||
return result;
|
||||
}
|
||||
|
||||
void ParseState::each_action(function<void(ParseAction *)> fn) {
|
||||
void ParseState::each_advance_action(function<void(ParseAction *)> fn) {
|
||||
for (auto &entry : actions)
|
||||
for (ParseAction &action : entry.second)
|
||||
fn(&action);
|
||||
if (action.type == ParseActionTypeShift)
|
||||
fn(&action);
|
||||
}
|
||||
|
||||
bool ParseState::operator==(const ParseState &other) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue