Mark reductions as fragile based on their final properties

We previously maintained a set of individual productions that were
involved in conflicts, but that was subtly incorrect because
we don't compare productions themselves when comparing parse items;
we only compare the parse items properties that could affect the
final reduce actions.
This commit is contained in:
Max Brunsfeld 2017-07-21 09:54:22 -07:00
parent 7d9d8bce79
commit cbdfd89675
6 changed files with 165 additions and 137 deletions

View file

@ -28,20 +28,23 @@ struct ParseAction {
static ParseAction Error();
static ParseAction Shift(ParseStateId state_index);
static ParseAction Recover(ParseStateId state_index);
static ParseAction Reduce(rules::Symbol symbol, size_t child_count, const Production &);
static ParseAction Reduce(rules::Symbol symbol, size_t child_count,
int precedence, int dynamic_precedence, rules::Associativity,
unsigned rename_sequence_id);
static ParseAction ShiftExtra();
bool operator==(const ParseAction &) const;
bool operator<(const ParseAction &) const;
const Production *production;
size_t consumed_symbol_count;
rules::Symbol symbol;
int dynamic_precedence;
ParseActionType type;
bool extra;
bool fragile;
ParseStateId state_index;
rules::Symbol symbol;
unsigned consumed_symbol_count;
int precedence;
int dynamic_precedence;
rules::Associativity associativity;
unsigned rename_sequence_id;
bool fragile;
bool extra;
};
struct ParseTableEntry {