/** * Returns a deep clone of this {@link AFloorUnaryExp} node. * @return a deep clone of this {@link AFloorUnaryExp} node */ public AFloorUnaryExp clone() { return new AFloorUnaryExp( _type, _location, cloneNode(_exp) ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AFloorUnaryExp) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AFloorUnaryExp} node from {@link AFloorUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AFloorUnaryExp} node */ public void caseAFloorUnaryExp(AFloorUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAFloorUnaryExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outAFloorUnaryExp(node, question); }
@Override public PType caseAFloorUnaryExp(AFloorUnaryExp node, TypeCheckInfo question) throws AnalysisException { PExp exp = node.getExp(); question.qualifiers = null; if (!question.assistantFactory.createPTypeAssistant().isNumeric(exp.apply(THIS, question.newConstraint(null)))) { TypeCheckerErrors.report(3096, "Argument to floor is not numeric", node.getLocation(), node); } node.setType(AstFactory.newAIntNumericBasicType(node.getLocation())); return node.getType(); }
@Override public Value caseAFloorUnaryExp(AFloorUnaryExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { return NumericValue.valueOf(Math.floor(node.getExp().apply(VdmRuntime.getExpressionEvaluator(), ctxt).realValue(ctxt)), ctxt); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }
@Override public IProofObligationList caseAFloorUnaryExp(AFloorUnaryExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
public static AFloorUnaryExp newAFloorUnaryExp(ILexLocation location, PExp exp) { AFloorUnaryExp result = new AFloorUnaryExp(); initExpressionUnary(result, location, exp); return result; }
/** * Called by the {@link AFloorUnaryExp} node from {@link AFloorUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AFloorUnaryExp} node */ public void caseAFloorUnaryExp(AFloorUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAFloorUnaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAFloorUnaryExp(node); }
/** * Called by the {@link AFloorUnaryExp} node from {@link AFloorUnaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AFloorUnaryExp} node */ public void caseAFloorUnaryExp(AFloorUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAFloorUnaryExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAFloorUnaryExp(node); }
/** * Creates a deep clone of this {@link AFloorUnaryExp} 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 AFloorUnaryExp} node */ public AFloorUnaryExp clone(Map<INode,INode> oldToNewMap) { AFloorUnaryExp node = new AFloorUnaryExp( _type, _location, cloneNode(_exp, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AFloorUnaryExp} node from {@link AFloorUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AFloorUnaryExp} node */ public A caseAFloorUnaryExp(AFloorUnaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAFloorUnaryExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outAFloorUnaryExp(node)); return retVal; }
/** * Called by the {@link AFloorUnaryExp} node from {@link AFloorUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AFloorUnaryExp} node */ public A caseAFloorUnaryExp(AFloorUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAFloorUnaryExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outAFloorUnaryExp(node, question)); return retVal; }