/** * 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); }
/** * Returns a deep clone of this {@link ANotEqualBinaryExp} node. * @return a deep clone of this {@link ANotEqualBinaryExp} node */ public ANotEqualBinaryExp clone() { return new ANotEqualBinaryExp( _type, _location, cloneNode(_left), cloneNode(_op), cloneNode(_right) ); }
@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()); }
@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)); }
public static ANotEqualBinaryExp newANotEqualBinaryExp(PExp left, PExp right) { ANotEqualBinaryExp result = new ANotEqualBinaryExp(); ILexToken op = new LexToken(null, VDMToken.NE); initExpressionBinary(result, left, op, right); result.setType(new ABooleanBasicType()); return result; }
ANotEqualBinaryExp ne = new ANotEqualBinaryExp(); ne.setLeft(exp); ne.setOp(new LexKeywordToken(VDMToken.NE, exp.getLocation())); ASeqEnumSeqExp empty = new ASeqEnumSeqExp(); empty.setMembers(new Vector<PExp>()); ne.setRight(empty); ANotEqualBinaryExp ne = new ANotEqualBinaryExp(); ne.setLeft(exp); ne.setOp(new LexKeywordToken(VDMToken.NE, exp.getLocation())); ASetEnumSetExp empty = new ASetEnumSetExp(); empty.setMembers(new Vector<PExp>()); ne.setRight(empty);
public static ANotEqualBinaryExp newANotEqualBinaryExp(PExp left, LexToken op, PExp right) { ANotEqualBinaryExp result = new ANotEqualBinaryExp(); initExpressionBinary(result, left, op, right); return result; }
/** * 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); }
/** * Creates a deep clone of this {@link ANotEqualBinaryExp} 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 ANotEqualBinaryExp} node */ public ANotEqualBinaryExp clone(Map<INode,INode> oldToNewMap) { ANotEqualBinaryExp node = new ANotEqualBinaryExp( _type, _location, cloneNode(_left, oldToNewMap), cloneNode(_op, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * 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 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; }