def p_morerules(p):
 if (len(p) == 2):
  p[0] = [[]]
 elif (len(p) == 3):
  p[0] = [p[2]]
 else:
  p[0] = p[1]
  p[0].append(p[3])

def p_morerules ( p ) : if ( len ( p ) == 2 ) : p [ 0 ] = [ [ ] ] elif ( len ( p ) == 3 ) : p [ 0 ] = [ p [ 2 ] ] else : p [ 0 ] = p [ 1 ] p [ 0 ] . append ( p [ 3 ] )
morerules : morerules | rulelist | | rulelist .