TODO. Conflict error reporting.
@@ -72,6 +72,10 @@ class Parser(object):
# would call for reduction but only for terminals
# from the FOLLOW set of the production LHS non-terminal.
for t in self.follow_sets[i.production.symbol]:
+ if t in actions:
+ # TODO: REDUCE/REDUCE conflict
+ assert False
+ else:
actions[t] = Action(REDUCE, prod=i.production)
# For each group symbol we create new state and form its kernel
@@ -101,8 +105,8 @@ class Parser(object):
goto[symbol] = target_state
else:
if symbol in actions:
- raise Exception('SHIFT/REDUCE conflict!')
-
+ # TODO: SHIFT/REDUCE conflict
+ assert False
actions[symbol] = Action(SHIFT, state=target_state)
if self.debug:
