inAInheritedDefinition(node, question); if(node.getName() != null ) node.getName().apply(this, question); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this, question); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this, question); if(node.getSuperdef() != null && !_visitedNodes.contains(node.getSuperdef())) node.getSuperdef().apply(this, question); if(node.getOldname() != null ) node.getOldname().apply(this, question);
public static void checkSuperDefinition(AInheritedDefinition d) { // This is used to get over the case where an inherited definition // is a ValueDefinition that has since been replaced with a new // LocalDefinition. It would be better to somehow list the // inherited definitions that refer to a LocalDefinition and update // them... if (d.getSuperdef() instanceof AUntypedDefinition) { if (d.getClassDefinition() != null) { d.setSuperdef(af.createPDefinitionAssistant().findName(d.getClassDefinition(), d.getSuperdef().getName(), d.getNameScope())); } } }
@Override public PType caseAInheritedDefinition(AInheritedDefinition node, TypeCheckInfo question) throws AnalysisException { node.setType(node.getSuperdef().apply(THIS, question)); return node.getType(); }
/** * Creates a new complete constructor {@code AInheritedDefinition} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param superdef_ the {@link PDefinition} <b>graph</a> node for the {@code superdef} child of this {@link AInheritedDefinition} node. * <i>The parent of this {@code superdef } will not be changed by adding it to this node.</i> * @param oldname_ the {@link ILexNameToken} node for the {@code oldname} child of this {@link AInheritedDefinition} node */ public AInheritedDefinition(ILexLocation location_, ILexNameToken name_, NameScope nameScope_, Boolean used_, SClassDefinition classDefinition_, AAccessSpecifierAccessSpecifier access_, PType type_, Pass pass_, PDefinition superdef_, ILexNameToken oldname_) { super(location_,name_,nameScope_,used_,classDefinition_,access_,type_,pass_); this.setSuperdef(superdef_); this.setOldname(oldname_); }
@Override public PDefinition caseAInheritedDefinition(AInheritedDefinition node, Newquestion question) throws AnalysisException { if (node.getSuperdef() instanceof ATypeDefinition && question.sought.equals(node.getName())) { return node; } return null; }
@Override public Boolean caseAInheritedDefinition(AInheritedDefinition node) throws AnalysisException { return node.getSuperdef().apply(THIS); }
@Override public PDefinition caseAInheritedDefinition(AInheritedDefinition node, Newquestion question) throws AnalysisException { // The problem is, when the InheritedDefinition is created, we // don't know its fully qualified name. if (node.getSuperdef() instanceof AInheritedDefinition) { node.getSuperdef().apply(this, question); } ILexNameToken name = node.getName(); name.setTypeQualifier(node.getSuperdef().getName().getTypeQualifier()); if (af.getLexNameTokenAssistant().isEqual(name, question.sought)) { return node; } else if (question.scope.matches(NameScope.OLDSTATE) && node.getOldname().equals(question.sought)) { return node; } return null; }
public static AInheritedDefinition newAInheritedDefinition( ILexNameToken localname, PDefinition d) { AInheritedDefinition result = new AInheritedDefinition(); initDefinition(result, d.getPass(), d.getLocation(), localname, d.getNameScope()); result.setSuperdef(d); result.setOldname(localname.getOldName()); result.setType(d.getType()); af.createPDefinitionAssistant().setClassDefinition(result, d.getClassDefinition()); result.setAccess(d.getAccess().clone()); return result; }
@Override public void caseAInheritedDefinition(AInheritedDefinition node) throws AnalysisException { node.setUsed(true); node.getSuperdef().apply(THIS); }
@Override public Boolean caseAInheritedDefinition(AInheritedDefinition node) throws AnalysisException { return node.getSuperdef().apply(THIS); }
@Override public LexNameList caseAInheritedDefinition(AInheritedDefinition node) throws AnalysisException { // return AInheritedDefinitionAssistantTC.getVariableNames((AInheritedDefinition) node); LexNameList names = new LexNameList(); // TODO:What About Here, how to I need to handle it. like I have it or Bring the method to this class? DefinitionTypeFinder.checkSuperDefinition(node); for (ILexNameToken vn : node.getSuperdef().apply(THIS)) { names.add(vn.getModifiedName(node.getName().getModule())); } return names; }
inAInheritedDefinition(node); if(node.getName() != null ) node.getName().apply(this); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getSuperdef() != null && !_visitedNodes.contains(node.getSuperdef())) node.getSuperdef().apply(this); if(node.getOldname() != null ) node.getOldname().apply(this);
@Override public List<PDefinition> caseAInheritedDefinition(AInheritedDefinition node) throws AnalysisException { return node.getSuperdef().apply(THIS); }
@Override public NameValuePairList caseAInheritedDefinition(AInheritedDefinition def, Context initialContext) throws AnalysisException { NameValuePairList renamed = new NameValuePairList(); if (def.getSuperdef() instanceof AUntypedDefinition) { if (def.getClassDefinition() != null) { def.setSuperdef(af.createPDefinitionAssistant().findName(def.getClassDefinition(), def.getSuperdef().getName(), def.getNameScope())); } } for (NameValuePair nv : af.createPDefinitionAssistant().getNamedValues(def.getSuperdef(), initialContext)) { renamed.add(new NameValuePair(nv.name.getModifiedName(def.getName().getModule()), nv.value)); } return renamed; }
List<PType> q = indef.getSuperdef().getName().getTypeQualifier(); indef.getName().setTypeQualifier(q);
inAInheritedDefinition(node); if(node.getName() != null ) node.getName().apply(this); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) node.getClassDefinition().apply(this); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) node.getAccess().apply(this); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getSuperdef() != null && !_visitedNodes.contains(node.getSuperdef())) node.getSuperdef().apply(this); if(node.getOldname() != null ) node.getOldname().apply(this);
@Override public Boolean caseAInheritedDefinition(AInheritedDefinition def) throws AnalysisException { return def.getSuperdef().apply(THIS); }
List<PType> q = indef2.getSuperdef().getName().getTypeQualifier(); indef2.getName().setTypeQualifier(q);
mergeReturns(retVal,inAInheritedDefinition(node, question)); if(node.getName() != null ) mergeReturns(retVal,node.getName().apply(this, question)); if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) mergeReturns(retVal,node.getClassDefinition().apply(this, question)); if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) mergeReturns(retVal,node.getAccess().apply(this, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this, question)); if(node.getSuperdef() != null && !_visitedNodes.contains(node.getSuperdef())) mergeReturns(retVal,node.getSuperdef().apply(this, question)); if(node.getOldname() != null ) mergeReturns(retVal,node.getOldname().apply(this, question));
@Override public Boolean caseAInheritedDefinition(AInheritedDefinition def) throws AnalysisException { return def.getSuperdef().apply(THIS); }