Remove precedence and associativity methods from ParseAction

This commit is contained in:
Max Brunsfeld 2017-07-13 13:41:56 -07:00
parent d646889922
commit 561821d011
3 changed files with 4 additions and 31 deletions

View file

@ -64,30 +64,6 @@ ParseAction ParseAction::Reduce(Symbol symbol, size_t consumed_symbol_count,
return result;
}
int ParseAction::precedence() const {
if (consumed_symbol_count >= production->size()) {
if (production->empty()) {
return 0;
} else {
return production->back().precedence;
}
} else {
return production->at(consumed_symbol_count).precedence;
}
}
rules::Associativity ParseAction::associativity() const {
if (consumed_symbol_count >= production->size()) {
if (production->empty()) {
return rules::AssociativityNone;
} else {
return production->back().associativity;
}
} else {
return production->at(consumed_symbol_count).associativity;
}
}
bool ParseAction::operator==(const ParseAction &other) const {
return (type == other.type && extra == other.extra &&
fragile == other.fragile && symbol == other.symbol &&