/** * Called by the {@link AProperSubsetBinaryExp} node from {@link AProperSubsetBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AProperSubsetBinaryExp} node */ public void caseAProperSubsetBinaryExp(AProperSubsetBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAProperSubsetBinaryExp(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); } outAProperSubsetBinaryExp(node, question); }
/** * Called by the {@link AProperSubsetBinaryExp} node from {@link AProperSubsetBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AProperSubsetBinaryExp} node */ public void caseAProperSubsetBinaryExp(AProperSubsetBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inAProperSubsetBinaryExp(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); } outAProperSubsetBinaryExp(node); }
/** * Called by the {@link AProperSubsetBinaryExp} node from {@link AProperSubsetBinaryExp#apply(IPOFAnalysis)}. * @param node the calling {@link AProperSubsetBinaryExp} node */ public void caseAProperSubsetBinaryExp(AProperSubsetBinaryExp node) throws AnalysisException { _visitedNodes.add(node); inAProperSubsetBinaryExp(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); } outAProperSubsetBinaryExp(node); }
/** * Called by the {@link AProperSubsetBinaryExp} node from {@link AProperSubsetBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AProperSubsetBinaryExp} node */ public A caseAProperSubsetBinaryExp(AProperSubsetBinaryExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAProperSubsetBinaryExp(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,outAProperSubsetBinaryExp(node, question)); return retVal; }
/** * Called by the {@link AProperSubsetBinaryExp} node from {@link AProperSubsetBinaryExp#apply(IAnalysis)}. * @param node the calling {@link AProperSubsetBinaryExp} node */ public A caseAProperSubsetBinaryExp(AProperSubsetBinaryExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAProperSubsetBinaryExp(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,outAProperSubsetBinaryExp(node)); return retVal; }
@Override public PType caseAProperSubsetBinaryExp( AProperSubsetBinaryExp node, TypeCheckInfo question) throws AnalysisException { TypeCheckInfo noConstraint = question.newConstraint(null); node.getLeft().apply(THIS, noConstraint); node.getRight().apply(THIS, noConstraint); PType ltype = node.getLeft().getType(); PType rtype = node.getRight().getType(); if (question.assistantFactory.createPTypeAssistant().isSet(ltype) && question.assistantFactory.createPTypeAssistant().isSet(rtype) && !question.assistantFactory.getTypeComparator().compatible(ltype, rtype)) { TypeCheckerErrors.report(3335, "Subset will only be true if the LHS set is empty", node.getLocation(), node); TypeCheckerErrors.detail("Left", ltype); TypeCheckerErrors.detail("Right", rtype); } if (!question.assistantFactory.createPTypeAssistant().isSet(ltype)) { TypeCheckerErrors.report(3146, "Left hand of " + node.getOp() + " is not a set", node.getLocation(), node); } if (!question.assistantFactory.createPTypeAssistant().isSet(rtype)) { TypeCheckerErrors.report(3147, "Right hand of " + node.getOp() + " is not a set", node.getLocation(), node); } node.setType(AstFactory.newABooleanBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }