/** * Called by the {@link ARangeResToBinaryExp} node from {@link ARangeResToBinaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link ARangeResToBinaryExp} node */ public void caseARangeResToBinaryExp(ARangeResToBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inARangeResToBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outARangeResToBinaryExp(node); }
/** * Returns a deep clone of this {@link ARangeResToBinaryExp} node. * @return a deep clone of this {@link ARangeResToBinaryExp} node */ public ARangeResToBinaryExp clone() { return new ARangeResToBinaryExp( _type, _location, cloneNode(_left), cloneNode(_op), cloneNode(_right) ); }
rngConstraint = question.newConstraint(AstFactory.newASetSetType(node.getLocation(), stype)); node.getLeft().apply(THIS, question); node.getRight().apply(THIS, rngConstraint); PType ltype = node.getLeft().getType(); PType rtype = node.getRight().getType(); TypeCheckerErrors.report(3151, "Left of ':>' is not a map", node.getLocation(), node); } else if (!question.assistantFactory.createPTypeAssistant().isSet(rtype)) TypeCheckerErrors.report(3152, "Right of ':>' is not a set", node.getLocation(), node); } else + map.getTo(), node.getLocation(), node); node.setType(ltype); return ltype;
@Override public Value caseARangeResToBinaryExp(ARangeResToBinaryExp node, Context ctxt) throws AnalysisException { // breakpoint.check(location, ctxt); node.getLocation().hit(); // Mark as covered ValueSet set = null; ValueMap map = null; try { set = node.getRight().apply(VdmRuntime.getExpressionEvaluator(), ctxt).setValue(ctxt); map = node.getLeft().apply(VdmRuntime.getExpressionEvaluator(), ctxt).mapValue(ctxt); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } ValueMap modified = new ValueMap(map); for (Value k : map.keySet()) { if (!set.contains(map.get(k))) { modified.remove(k); } } return new MapValue(modified); }
public static ARangeResToBinaryExp newARangeResToBinaryExp(PExp left, LexToken op, PExp right) { ARangeResToBinaryExp result = new ARangeResToBinaryExp(); initExpressionBinary(result, left, op, right); return result; }
/** * Called by the {@link ARangeResToBinaryExp} node from {@link ARangeResToBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ARangeResToBinaryExp} node */ public void caseARangeResToBinaryExp(ARangeResToBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inARangeResToBinaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getOp() != null ) { node.getOp().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outARangeResToBinaryExp(node); }
/** * Creates a deep clone of this {@link ARangeResToBinaryExp} 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 ARangeResToBinaryExp} node */ public ARangeResToBinaryExp clone(Map<INode,INode> oldToNewMap) { ARangeResToBinaryExp node = new ARangeResToBinaryExp( _type, _location, cloneNode(_left, oldToNewMap), cloneNode(_op, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ARangeResToBinaryExp} node from {@link ARangeResToBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ARangeResToBinaryExp} node */ public void caseARangeResToBinaryExp(ARangeResToBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inARangeResToBinaryExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getOp() != null ) { node.getOp().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outARangeResToBinaryExp(node, question); }
/** * Called by the {@link ARangeResToBinaryExp} node from {@link ARangeResToBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ARangeResToBinaryExp} node */ public A caseARangeResToBinaryExp(ARangeResToBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inARangeResToBinaryExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getOp() != null ) { mergeReturns(retVal,node.getOp().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outARangeResToBinaryExp(node, question)); return retVal; }
/** * Called by the {@link ARangeResToBinaryExp} node from {@link ARangeResToBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ARangeResToBinaryExp} node */ public A caseARangeResToBinaryExp(ARangeResToBinaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inARangeResToBinaryExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getOp() != null ) { mergeReturns(retVal,node.getOp().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outARangeResToBinaryExp(node)); return retVal; }