Allow associativity to be specified in rules w/o precedence
This commit is contained in:
parent
4b817dc07c
commit
9959fe35b0
17 changed files with 78 additions and 56 deletions
|
|
@ -14,7 +14,7 @@ using rules::Symbol;
|
|||
ParseAction::ParseAction(ParseActionType type, ParseStateId state_index,
|
||||
Symbol symbol, size_t consumed_symbol_count,
|
||||
PrecedenceRange precedence_range,
|
||||
Associativity associativity, int production_id)
|
||||
rules::Associativity associativity, int production_id)
|
||||
: type(type),
|
||||
symbol(symbol),
|
||||
state_index(state_index),
|
||||
|
|
@ -28,7 +28,7 @@ ParseAction::ParseAction()
|
|||
symbol(Symbol(-1)),
|
||||
state_index(-1),
|
||||
consumed_symbol_count(0),
|
||||
associativity(AssociativityNone) {}
|
||||
associativity(rules::AssociativityNone) {}
|
||||
|
||||
ParseAction ParseAction::Error() {
|
||||
return ParseAction();
|
||||
|
|
@ -43,7 +43,7 @@ ParseAction ParseAction::Accept() {
|
|||
ParseAction ParseAction::Shift(ParseStateId state_index,
|
||||
PrecedenceRange precedence_range) {
|
||||
return ParseAction(ParseActionTypeShift, state_index, Symbol(-1), 0,
|
||||
precedence_range, AssociativityNone, -1);
|
||||
precedence_range, rules::AssociativityNone, -1);
|
||||
}
|
||||
|
||||
ParseAction ParseAction::ShiftExtra() {
|
||||
|
|
@ -60,7 +60,8 @@ ParseAction ParseAction::ReduceExtra(Symbol symbol) {
|
|||
}
|
||||
|
||||
ParseAction ParseAction::Reduce(Symbol symbol, size_t consumed_symbol_count,
|
||||
int precedence, Associativity associativity,
|
||||
int precedence,
|
||||
rules::Associativity associativity,
|
||||
unsigned int production_id) {
|
||||
return ParseAction(ParseActionTypeReduce, 0, symbol, consumed_symbol_count,
|
||||
{ precedence, precedence }, associativity, production_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue