func (r *ScopeReference) GetNode(srg *srg.SRG, tg *typegraph.TypeGraph) compilergraph.GraphNode { nodeId := compilergraph.GraphNodeId(r.GetReferencedNode()) if r.GetIsSRGNode() { return srg.GetNode(nodeId) } else { return tg.GetNode(nodeId) } }
func (t *ScopeInfo) TargetedNode(srg *srg.SRG) (compilergraph.GraphNode, bool) { if t.TargetedReference == nil { return compilergraph.GraphNode{}, false } nodeId := compilergraph.GraphNodeId(t.TargetedReference.GetReferencedNode()) if t.TargetedReference.GetIsSRGNode() { return srg.GetNode(nodeId), true } else { panic("Cannot have a non-SRG targeted node") } }
// getParentContainer returns the parent type member, module member or property getter/setter // under which we are scoping, if any. func (sc scopeContext) getParentContainer(g *srg.SRG) (srg.SRGImplementable, bool) { return g.AsImplementable(sc.rootNode) }