/** * Returns a deep clone of this {@link AUnaryMinusUnaryExp} node. * @return a deep clone of this {@link AUnaryMinusUnaryExp} node */ public AUnaryMinusUnaryExp clone() { return new AUnaryMinusUnaryExp( _type, _location, cloneNode(_exp) ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AUnaryMinusUnaryExp) { return toString().equals(o.toString()); } return false; }
/** * 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); }
@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); } }
@Override public IProofObligationList caseAUnaryMinusUnaryExp( AUnaryMinusUnaryExp node, IPOContextStack question) throws AnalysisException { return node.getExp().apply(mainVisitor, question); }
public static AUnaryMinusUnaryExp newAUnaryMinusUnaryExp( ILexLocation location, PExp exp) { AUnaryMinusUnaryExp result = new AUnaryMinusUnaryExp(); initExpressionUnary(result, location, exp); return result; }
/** * 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); }
/** * Creates a deep clone of this {@link AUnaryMinusUnaryExp} 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 AUnaryMinusUnaryExp} node */ public AUnaryMinusUnaryExp clone(Map<INode,INode> oldToNewMap) { AUnaryMinusUnaryExp node = new AUnaryMinusUnaryExp( _type, _location, cloneNode(_exp, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * 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; }