Esempio n. 1
0
def p_instance(p):
    '''instance : NEW ID'''
    global current_scope
    node = ASTNode('INSTANCE', leaf=p[2])
    node.scope = current_scope
    p[0] = node
Esempio n. 2
0
def p_call(p):
    '''call : ID paren_expr_list
            | ID paren_empty_list'''
    node = ASTNode('CALL', children=[p[1], p[2]])
    node.scope = current_scope
    p[0] = node