Ejemplo n.º 1
0
def p_constructor_header(p):
    'constructor_header : mod ID'
    global current_context, current_vartable
    current_context = 'method'
    (v, s) = current_modifiers
    c = ast.Constructor(p[2], v)
    # note: 's' is ignored.  should we signal error for s?
    current_class.add_constructor(c)
    current_vartable = c.vars
    p[0] = c
Ejemplo n.º 2
0
def p_factor_07(t):
    '''factor : type LPAR actual_parameters_list RPAR'''
    t[0] = ast.Constructor(t[1], t[3])