(p)
statements : statements statement
statements : statements statement
statements : statements statement
def p_statements(p):
    '''statements : statements statement'''
    p[0] = p[1]
    if p[2] != None:
        p[0].append(p[2])
def p_statements ( p ) : p [ 0 ] = p [ 1 ] if p [ 2 ] != None : p [ 0 ] . append ( p [ 2 ] )