Beispiel #1
0
def _project_all(context_):
    for _, module_ in context_.get_modules().items():
        clone = context_.set_current_module(module_get_full_name(module_))
        clone = build_visibility(clone, module_)
        
        # FIXME: aliased member imports (visibility not working)
        #for (proto, gpd) in clone.get_visible_globals().items():
        for gpd in module_get_globalprotocoldecl_children(module_):  # OK to check only module's protos? cf. above
            proto = globalprotocoldecl_get_full_name(gpd)
            full_global_name = globalprotocoldecl_get_full_name(gpd)
            rdl = globalprotocoldecl_get_roledecllist_child(gpd)
            #rolemap = roledecllist_get_rolemap(rdl) 
            #for role_ in globalprotocoldecl_get_role_names(gpd):
            for rd in roledecllist_get_roledecl_children(rdl):
                dname = roledecl_get_declaration_name(rd)
                role_ = roledecl_get_role_name(rd)
                full_local_name = globaldo_get_projected_member_name(
                                      full_global_name, role_)
                                      #full_global_name, rolemap[role_])
                if context_.has_projection(full_local_name):
                    break
                projector = Projector()
                lpd = projector.project_globalprotocoldecl(clone, gpd, dname)#, rolemap)
                #full_name = lpd.get_full_name(clone)
                context_ = context_.add_projection(full_local_name, lpd)
                
                #print "Projected", full_global_name, "for", role_ + ":\n", \
                #      lpd.pretty_print()
    return context_
Beispiel #2
0
def _get_self_visibility(context, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        context = context.add_visible_payload(n, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        context = context.add_visible_global(n, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        context = context.add_visible_local(n, lpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        util.report_error("TODO: member import: " + im)
        # FIXME: members
    return context
def _get_self_visibility(context, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        context = context.add_visible_payload(n, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        context = context.add_visible_global(n, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        context = context.add_visible_local(n, lpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        util.report_error("TODO: member import: " + im)
        # FIXME: members
    return context
def _add_all_members(context_, fmn, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        f = fmn + '.' + n
        context_ = context_.add_member(f, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        f = fmn + '.' + n
        context_ = context_.add_member(f, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        f = fmn + '.' + n
        context_ = context_.add_member(f, lpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        # TODO: members
        util.report_error("TODO member import: " + im)
    return context_
def _add_all_members(context_, fmn, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        f = fmn + "." + n
        context_ = context_.add_member(f, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        f = fmn + "." + n
        context_ = context_.add_member(f, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        f = fmn + "." + n
        context_ = context_.add_member(f, lpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        # TODO: members
        util.report_error("TODO member import: " + im)
    return context_
Beispiel #6
0
def _get_module_members(context, dn, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        f = dn + '.' + n
        context = context.add_visible_payload(f, ptd)
        #context = context.add_visible_payload(n, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        f = dn + '.' + n
        context = context.add_visible_global(f, gpd)
        #context = context.add_visible_global(n, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        f = dn + '.' + n
        context = context.add_visible_local(f, lpd)
        #context = context.add_visible_local(n, gpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        util.report_error("TODO member import: " + im)
        # TODO: members
    return context
def _get_module_members(context, dn, module_):
    for ptd in module_get_payloadtypedecl_children(module_):
        n = payloadtypedecl_get_declaration_name(ptd)
        f = dn + '.' + n
        context = context.add_visible_payload(f, ptd)
        #context = context.add_visible_payload(n, ptd)
    for gpd in module_get_globalprotocoldecl_children(module_):
        n = globalprotocoldecl_get_name(gpd)
        f = dn + '.' + n
        context = context.add_visible_global(f, gpd)
        #context = context.add_visible_global(n, gpd)
    for lpd in module_get_localprotocoldecl_children(module_):
        n = localprotocoldecl_get_name(lpd)
        f = dn + '.' + n
        context = context.add_visible_local(f, lpd)
        #context = context.add_visible_local(n, gpd)
    importmembers = module_get_importmember_children(module_)
    for im in importmembers:
        util.report_error("TODO member import: " + im)
        # TODO: members
    return context