@Override public String caseAOptionalType(AOptionalType type) throws AnalysisException { return "[" + type.getType() + "]"; }
@Override public PType caseAOptionalType(AOptionalType type, Context ctxt) throws AnalysisException { return AstFactory.newAOptionalType(type.getLocation(), type.getType().apply(this, ctxt)); }
@Override public PType caseAOptionalType(AOptionalType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } type.setType(af.createPTypeAssistant().typeResolve(type.getType(), question.root, question.rootVisitor, question.question)); if (question.root != null) { question.root.setInfinite(false); // Could be nil } return type; }
public static AOptionalType newAOptionalType(ILexLocation location, PType type) { AOptionalType result = new AOptionalType(); initType(result, location); while (type instanceof AOptionalType) { type = ((AOptionalType) type).getType(); } result.setType(type); return result; }
@Override public void caseAOptionalType(AOptionalType type) throws AnalysisException { if (!type.getResolved()) { return; } else { type.setResolved(false); } // PTypeAssistantTC.unResolve(type.getType()); type.getType().apply(THIS); }
/** * Called by the {@link AOptionalType} node from {@link AOptionalType#apply(IPOFAnalysis)}. * @param node the calling {@link AOptionalType} node */ public void caseAOptionalType(AOptionalType node) throws AnalysisException { _visitedNodes.add(node); inAOptionalType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAOptionalType(node); }
/** * Creates a new complete constructor {@code AOptionalType} 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 type_ the {@link PType} <b>graph</a> node for the {@code type} child of this {@link AOptionalType} node. * <i>The parent of this {@code type } will not be changed by adding it to this node.</i> */ public AOptionalType(ILexLocation location_, Boolean resolved_, List<? extends PDefinition> definitions_, PType type_) { super(location_,resolved_,definitions_); this.setType(type_); }
/** * Returns a deep clone of this {@link AOptionalType} node. * @return a deep clone of this {@link AOptionalType} node */ public AOptionalType clone() { return new AOptionalType( _location, _resolved, _definitions, _type ); }
/** * Called by the {@link AOptionalType} node from {@link AOptionalType#apply(IAnalysis)}. * @param node the calling {@link AOptionalType} node */ public void caseAOptionalType(AOptionalType node) throws AnalysisException { _visitedNodes.add(node); inAOptionalType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outAOptionalType(node); }
/** * Creates a deep clone of this {@link AOptionalType} 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 AOptionalType} node */ public AOptionalType clone(Map<INode,INode> oldToNewMap) { AOptionalType node = new AOptionalType( _location, _resolved, _definitions, _type ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AOptionalType} node from {@link AOptionalType#apply(IAnalysis)}. * @param node the calling {@link AOptionalType} node */ public void caseAOptionalType(AOptionalType node, Q question) throws AnalysisException { _visitedNodes.add(node); inAOptionalType(node, question); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outAOptionalType(node, question); }
@Override public PType caseAOptionalType(AOptionalType type, Newquestion question) throws AnalysisException { return AstFactory.newAOptionalType(type.getLocation(), af.createPTypeAssistant().polymorph(type.getType(), question.pname, question.actualType)); }
@Override public Boolean caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
/** * Called by the {@link AOptionalType} node from {@link AOptionalType#apply(IAnalysis)}. * @param node the calling {@link AOptionalType} node */ public A caseAOptionalType(AOptionalType node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAOptionalType(node)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outAOptionalType(node)); return retVal; }
@Override public SNumericBasicType caseAOptionalType(AOptionalType type) throws AnalysisException { return type.getType().apply(THIS); }
/** * Called by the {@link AOptionalType} node from {@link AOptionalType#apply(IAnalysis)}. * @param node the calling {@link AOptionalType} node */ public A caseAOptionalType(AOptionalType node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAOptionalType(node, question)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } mergeReturns(retVal,outAOptionalType(node, question)); return retVal; }
@Override public PType caseAOptionalType(AOptionalType type, String typename) throws AnalysisException { return type.getType().apply(THIS, typename); }
@Override public Boolean caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); }
@Override public PTypeList caseAOptionalType(AOptionalType node) throws AnalysisException { return node.getType().apply(THIS); }