/** * Called by the {@link ANotEqualBinaryExp} node from {@link ANotEqualBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ANotEqualBinaryExp} node */ public void caseANotEqualBinaryExp(ANotEqualBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inANotEqualBinaryExp(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); } outANotEqualBinaryExp(node); }
/** * Called by the {@link ANotEqualBinaryExp} node from {@link ANotEqualBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ANotEqualBinaryExp} node */ public void caseANotEqualBinaryExp(ANotEqualBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inANotEqualBinaryExp(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); } outANotEqualBinaryExp(node, question); }
/** * Called by the {@link ANotEqualBinaryExp} node from {@link ANotEqualBinaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link ANotEqualBinaryExp} node */ public void caseANotEqualBinaryExp(ANotEqualBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inANotEqualBinaryExp(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); } outANotEqualBinaryExp(node); }
/** * Called by the {@link ANotEqualBinaryExp} node from {@link ANotEqualBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ANotEqualBinaryExp} node */ public A caseANotEqualBinaryExp(ANotEqualBinaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inANotEqualBinaryExp(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,outANotEqualBinaryExp(node)); return retVal; }
/** * Called by the {@link ANotEqualBinaryExp} node from {@link ANotEqualBinaryExp#apply(IAnalysis)}. * @param node the calling {@link ANotEqualBinaryExp} node */ public A caseANotEqualBinaryExp(ANotEqualBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inANotEqualBinaryExp(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,outANotEqualBinaryExp(node, question)); return retVal; }
@Override public Value caseANotEqualBinaryExp(ANotEqualBinaryExp node, Context ctxt) throws AnalysisException { // breakpoint.check(location, ctxt); node.getLocation().hit(); // Mark as covered Value lv = node.getLeft().apply(VdmRuntime.getExpressionEvaluator(), ctxt); Value rv = node.getRight().apply(VdmRuntime.getExpressionEvaluator(), ctxt); return new BooleanValue(!lv.equals(rv)); }
@Override public PType caseANotEqualBinaryExp(ANotEqualBinaryExp node, TypeCheckInfo question) throws AnalysisException { node.getLeft().apply(THIS, question.newConstraint(null)); node.getRight().apply(THIS, question.newConstraint(null)); if (question.assistantFactory.createPTypeAssistant().isUnion(node.getLeft().getType())) { IQuestion<TypeCheckInfo> mEqC = question.assistantFactory.getMultipleEqualityChecker(); node.getLeft().getType().apply(mEqC,question); } if (question.assistantFactory.createPTypeAssistant().isUnion(node.getRight().getType())) { IQuestion<TypeCheckInfo> mEqC = question.assistantFactory.getMultipleEqualityChecker(); node.getRight().apply(mEqC,question); } if (!question.assistantFactory.getTypeComparator().compatible(node.getLeft().getType(), node.getRight().getType())) { TypeCheckerErrors.report(3136, "Left and right of '<>' different types", node.getLocation(), node); TypeCheckerErrors.detail2("Left", node.getLeft().getType(), "Right", node.getRight().getType()); } node.setType(AstFactory.newABooleanBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }