def p_type_list(self, p):
        '''type_list : type_list type_def
                     | empty'''
        if p[1] is None:
            p[0] = []
        else:
            p[1].append(p[2])
            p[0] = p[1]
def p_type_list ( self , p ) : if p [ 1 ] is None : p [ 0 ] = [ ] else : p [ 1 ] . append ( p [ 2 ] ) p [ 0 ] = p [ 1 ]
type_list : type_list type_def
                     | empty