@Override public IProofObligationList caseAUnaryMinusUnaryExp( AUnaryMinusUnaryExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
/** * Called by the {@link AUnaryMinusUnaryExp} node from {@link AUnaryMinusUnaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AUnaryMinusUnaryExp} node */ public void caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAUnaryMinusUnaryExp(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); } outAUnaryMinusUnaryExp(node); }
/** * Called by the {@link AUnaryMinusUnaryExp} node from {@link AUnaryMinusUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AUnaryMinusUnaryExp} node */ public void caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node) throws AnalysisException { _visitedNodes.add(node); inAUnaryMinusUnaryExp(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); } outAUnaryMinusUnaryExp(node); }
/** * Called by the {@link AUnaryMinusUnaryExp} node from {@link AUnaryMinusUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AUnaryMinusUnaryExp} node */ public void caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAUnaryMinusUnaryExp(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); } outAUnaryMinusUnaryExp(node, question); }
/** * Called by the {@link AUnaryMinusUnaryExp} node from {@link AUnaryMinusUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AUnaryMinusUnaryExp} node */ public A caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAUnaryMinusUnaryExp(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,outAUnaryMinusUnaryExp(node)); return retVal; }
/** * Called by the {@link AUnaryMinusUnaryExp} node from {@link AUnaryMinusUnaryExp#apply(IAnalysis)}. * @param node the calling {@link AUnaryMinusUnaryExp} node */ public A caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAUnaryMinusUnaryExp(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,outAUnaryMinusUnaryExp(node, question)); return retVal; }
@Override public PType caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node, TypeCheckInfo question) throws AnalysisException { question.qualifiers = null; PType t = node.getExp().apply(THIS, question); if (t instanceof ANatNumericBasicType || t instanceof ANatOneNumericBasicType) { t = AstFactory.newAIntNumericBasicType(node.getLocation()); question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, t, node.getLocation()); } node.setType(t); return t; }
@Override public Value caseAUnaryMinusUnaryExp(AUnaryMinusUnaryExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { double v = node.getExp().apply(VdmRuntime.getExpressionEvaluator(), ctxt).realValue(ctxt); return NumericValue.valueOf(-v, ctxt); } catch (ValueException e) { return VdmRuntimeError.abort(node.getLocation(), e); } }