/** * Returns a deep clone of this {@link AUntypedDefinition} node. * @return a deep clone of this {@link AUntypedDefinition} node */ public AUntypedDefinition clone() { return new AUntypedDefinition( _location, _name, _nameScope, _used, _classDefinition, cloneNode(_access), _type, _pass ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AUntypedDefinition) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AUntypedDefinition} node from {@link AUntypedDefinition#apply(IAnalysis)}. * @param node the calling {@link AUntypedDefinition} node */ public void caseAUntypedDefinition(AUntypedDefinition node, Q question) throws AnalysisException { _visitedNodes.add(node); inAUntypedDefinition(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); } outAUntypedDefinition(node, question); }
@Override public Collection<? extends PDefinition> caseAValueExport(AValueExport exp, LinkedList<PDefinition> actualDefs) throws AnalysisException { List<PDefinition> list = new Vector<PDefinition>(); for (ILexNameToken name : exp.getNameList()) { PDefinition def = af.createPDefinitionListAssistant().findName(actualDefs, name, NameScope.NAMES); PType type = exp.getExportType().clone(); if (def != null) { if (def instanceof AUntypedDefinition) { AUntypedDefinition untyped = (AUntypedDefinition) def; list.add(AstFactory.newALocalDefinition(untyped.getLocation(), untyped.getName(), NameScope.GLOBAL, type)); // new ALocalDefinition(untyped.getLocation(), NameScope.GLOBAL, // false,null,PAccessSpecifierAssistant.getDefault(),type, false,untyped.getName())); } else { list.add(def); } } } return list; }
@Override public LexNameList caseAUntypedDefinition(AUntypedDefinition node) throws AnalysisException { return new LexNameList(node.getName()); }
public static PDefinition newAUntypedDefinition(ILexLocation location, ILexNameToken name, NameScope scope) { AUntypedDefinition result = new AUntypedDefinition(); // Definition initialization initDefinition(result, Pass.DEFS, location, name, scope); return result; }
@Override public PType caseAUntypedDefinition(AUntypedDefinition node) throws AnalysisException { return AstFactory.newAUnknownType(node.getLocation()); }
/** * Called by the {@link AUntypedDefinition} node from {@link AUntypedDefinition#apply(IPOFAnalysis)}. * @param node the calling {@link AUntypedDefinition} node */ public void caseAUntypedDefinition(AUntypedDefinition node) throws AnalysisException { _visitedNodes.add(node); inAUntypedDefinition(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); } outAUntypedDefinition(node); }
/** * Called by the {@link AUntypedDefinition} node from {@link AUntypedDefinition#apply(IAnalysis)}. * @param node the calling {@link AUntypedDefinition} node */ public void caseAUntypedDefinition(AUntypedDefinition node) throws AnalysisException { _visitedNodes.add(node); inAUntypedDefinition(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); } outAUntypedDefinition(node); }
/** * Creates a deep clone of this {@link AUntypedDefinition} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AUntypedDefinition} node */ public AUntypedDefinition clone(Map<INode,INode> oldToNewMap) { AUntypedDefinition node = new AUntypedDefinition( _location, _name, _nameScope, _used, _classDefinition, cloneNode(_access, oldToNewMap), _type, _pass ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AUntypedDefinition} node from {@link AUntypedDefinition#apply(IAnalysis)}. * @param node the calling {@link AUntypedDefinition} node */ public A caseAUntypedDefinition(AUntypedDefinition node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAUntypedDefinition(node)); if(node.getName() != null ) { mergeReturns(retVal,node.getName().apply(this)); } if(node.getClassDefinition() != null && !_visitedNodes.contains(node.getClassDefinition())) { mergeReturns(retVal,node.getClassDefinition().apply(this)); } if(node.getAccess() != null && !_visitedNodes.contains(node.getAccess())) { mergeReturns(retVal,node.getAccess().apply(this)); } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outAUntypedDefinition(node)); return retVal; }
/** * Called by the {@link AUntypedDefinition} node from {@link AUntypedDefinition#apply(IAnalysis)}. * @param node the calling {@link AUntypedDefinition} node */ public A caseAUntypedDefinition(AUntypedDefinition node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAUntypedDefinition(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)); } mergeReturns(retVal,outAUntypedDefinition(node, question)); return retVal; }