1# ----------------------------------------------------------------------------- 2# yacc_rr_unused.py 3# 4# A grammar with reduce/reduce conflicts and a rule that never 5# gets reduced. 6# ----------------------------------------------------------------------------- 7import sys 8 9if ".." not in sys.path: sys.path.insert(0,"..") 10import ply.yacc as yacc 11 12tokens = ('A', 'B', 'C') 13 14def p_grammar(p): 15 ''' 16 rule1 : rule2 B 17 | rule2 C 18 19 rule2 : rule3 B 20 | rule4 21 | rule5 22 23 rule3 : A 24 25 rule4 : A 26 27 rule5 : A 28 ''' 29 30yacc.yacc() 31