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:
Max Brunsfeld 2016-01-22 22:16:47 -07:00
parent 1ec39abe6a
commit 6401a065ae
13 changed files with 147 additions and 185 deletions

View file

@ -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 {