public static AInMapMapType newAInMapMapType(ILexLocation location, PType from, PType to) { AInMapMapType result = new AInMapMapType(); initType(result, location); result.setFrom(from); result.setTo(to); result.setEmpty(false); return result; }
/** * Called by the {@link AInMapMapType} node from {@link AInMapMapType#apply(IAnalysis)}. * @param node the calling {@link AInMapMapType} node */ public void caseAInMapMapType(AInMapMapType node, Q question) throws AnalysisException { _visitedNodes.add(node); inAInMapMapType(node, question); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getFrom() != null && !_visitedNodes.contains(node.getFrom())) { node.getFrom().apply(this, question); } if(node.getTo() != null && !_visitedNodes.contains(node.getTo())) { node.getTo().apply(this, question); } outAInMapMapType(node, question); }
/** * is_(exp, inmap expFromType to expToType) * * @param exp * @param ctxt * @param af * @throws AnalysisException */ public MapInverseObligation(AMapInverseUnaryExp exp, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(exp, POType.MAP_INVERSE, ctxt, exp.getLocation(), af); AIsExp is_Exp = new AIsExp(); is_Exp.setTest(exp.getExp().clone()); AInMapMapType inMap_type = new AInMapMapType(); inMap_type.setFrom(exp.getMapType().getFrom().clone()); inMap_type.setTo(exp.getMapType().getTo().clone()); is_Exp.setBasicType(inMap_type); stitch = is_Exp; valuetree.setPredicate(ctxt.getPredWithContext(is_Exp)); }
/** * Returns a deep clone of this {@link AInMapMapType} node. * @return a deep clone of this {@link AInMapMapType} node */ public AInMapMapType clone() { return new AInMapMapType( _location, _resolved, _definitions, _from, _to, _empty ); }
/** * Called by the {@link AInMapMapType} node from {@link AInMapMapType#apply(IPOFAnalysis)}. * @param node the calling {@link AInMapMapType} node */ public void caseAInMapMapType(AInMapMapType node) throws AnalysisException { _visitedNodes.add(node); inAInMapMapType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getFrom() != null && !_visitedNodes.contains(node.getFrom())) { node.getFrom().apply(this); } if(node.getTo() != null && !_visitedNodes.contains(node.getTo())) { node.getTo().apply(this); } outAInMapMapType(node); }
/** * Creates a deep clone of this {@link AInMapMapType} 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 AInMapMapType} node */ public AInMapMapType clone(Map<INode,INode> oldToNewMap) { AInMapMapType node = new AInMapMapType( _location, _resolved, _definitions, _from, _to, _empty ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AInMapMapType} node from {@link AInMapMapType#apply(IAnalysis)}. * @param node the calling {@link AInMapMapType} node */ public void caseAInMapMapType(AInMapMapType node) throws AnalysisException { _visitedNodes.add(node); inAInMapMapType(node); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getFrom() != null && !_visitedNodes.contains(node.getFrom())) { node.getFrom().apply(this); } if(node.getTo() != null && !_visitedNodes.contains(node.getTo())) { node.getTo().apply(this); } outAInMapMapType(node); }
/** * Called by the {@link AInMapMapType} node from {@link AInMapMapType#apply(IAnalysis)}. * @param node the calling {@link AInMapMapType} node */ public A caseAInMapMapType(AInMapMapType node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAInMapMapType(node)); { List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinitions()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getFrom() != null && !_visitedNodes.contains(node.getFrom())) { mergeReturns(retVal,node.getFrom().apply(this)); } if(node.getTo() != null && !_visitedNodes.contains(node.getTo())) { mergeReturns(retVal,node.getTo().apply(this)); } mergeReturns(retVal,outAInMapMapType(node)); return retVal; }
/** * Called by the {@link AInMapMapType} node from {@link AInMapMapType#apply(IAnalysis)}. * @param node the calling {@link AInMapMapType} node */ public A caseAInMapMapType(AInMapMapType node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAInMapMapType(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.getFrom() != null && !_visitedNodes.contains(node.getFrom())) { mergeReturns(retVal,node.getFrom().apply(this, question)); } if(node.getTo() != null && !_visitedNodes.contains(node.getTo())) { mergeReturns(retVal,node.getTo().apply(this, question)); } mergeReturns(retVal,outAInMapMapType(node, question)); return retVal; }