# Path: lang/femtocode/thirdparty/meta/asttools/visitors/symbol_visitor.py
# def get_symbols(node, ctx_types=(ast.Load, ast.Store)):
#     '''
#     Returns all symbols defined in an ast node. 
#     
#     if ctx_types is given, then restrict the symbols to ones with that context.
#     
#     :param node: ast node
#     :param ctx_types: type or tuple of types that may be found assigned to the `ctx` attribute of 
#                       an ast Name node.
#         
#     '''
#     gen = SymbolVisitor(ctx_types)
#     return gen.visit(node)


from . import Visitor, visit_children
from ..visitors.symbol_visitor import get_symbols
from ...utils import py2op
import ast
        for stmnt in node.body:
            gen.visit(stmnt)

        self.update_cond_lhs(gen.cond_lhs)
        self.update_cond_rhs(gen.cond_rhs)

        outputs = gen.stable_lhs
        inputs = gen.stable_rhs

        gen = ConditionalSymbolVisitor()
        for stmnt in node.orelse:
            gen.visit(stmnt)

        self.update_cond_rhs(gen.cond_rhs)
        self.update_cond_lhs(gen.cond_lhs)

        orelse_outputs = gen.stable_lhs
        orelse_inputs = gen.stable_rhs

        self.update_stable_lhs(outputs.intersection(orelse_outputs))
        self.update_stable_rhs(inputs.intersection(orelse_inputs))

        self.update_cond_lhs(outputs.symmetric_difference(orelse_outputs))
        self.update_cond_rhs(inputs.symmetric_difference(orelse_inputs))

    def visitFor(self, node):

        lhs_symbols = get_symbols(node.target, ast.Store)
        self.update_cond_lhs(lhs_symbols)


# Path: lang/femtocode/thirdparty/meta/asttools/visitors/symbol_visitor.py
# def get_symbols(node, ctx_types=(ast.Load, ast.Store)):
#     '''
#     Returns all symbols defined in an ast node. 
#     
#     if ctx_types is given, then restrict the symbols to ones with that context.
#     
#     :param node: ast node
#     :param ctx_types: type or tuple of types that may be found assigned to the `ctx` attribute of 
#                       an ast Name node.
#         
#     '''
#     gen = SymbolVisitor(ctx_types)
#     return gen.visit(node)


# Path: lang/femtocode/thirdparty/meta/asttools/visitors/cond_symbol_visitor.py
from . import Visitor, visit_children
from ..visitors.symbol_visitor import get_symbols
from ...utils import py2op
import ast

        for stmnt in node.body:
            gen.visit(stmnt)

        self.update_cond_lhs(gen.cond_lhs)
        self.update_cond_rhs(gen.cond_rhs)

        outputs = gen.stable_lhs
        inputs = gen.stable_rhs

        gen = ConditionalSymbolVisitor()
        for stmnt in node.orelse:
            gen.visit(stmnt)

        self.update_cond_rhs(gen.cond_rhs)
        self.update_cond_lhs(gen.cond_lhs)

        orelse_outputs = gen.stable_lhs
        orelse_inputs = gen.stable_rhs

        self.update_stable_lhs(outputs.intersection(orelse_outputs))
        self.update_stable_rhs(inputs.intersection(orelse_inputs))

        self.update_cond_lhs(outputs.symmetric_difference(orelse_outputs))
        self.update_cond_rhs(inputs.symmetric_difference(orelse_inputs))

    def visitFor(self, node):

        lhs_symbols = get_symbols(node.target, ast.Store)
        self.update_cond_lhs(lhs_symbols)


        rhs_symbols = get_symbols(node.iter, ast.Load)