/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(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.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outASameClassExp(node); }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(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.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outASameClassExp(node, question); }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IPOFAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public void caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); inASameClassExp(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.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outASameClassExp(node); }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public A caseASameClassExp(ASameClassExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inASameClassExp(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.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outASameClassExp(node)); return retVal; }
/** * Called by the {@link ASameClassExp} node from {@link ASameClassExp#apply(IAnalysis)}. * @param node the calling {@link ASameClassExp} node */ public A caseASameClassExp(ASameClassExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inASameClassExp(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.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outASameClassExp(node, question)); return retVal; }
@Override public PType caseASameClassExp(ASameClassExp node, TypeCheckInfo question) throws AnalysisException { PExp left = node.getLeft(); PExp right = node.getRight(); question.qualifiers = null; PType lt = left.apply(THIS, question.newConstraint(null)); if (!question.assistantFactory.createPTypeAssistant().isClass(lt, question.env)) { TypeCheckerErrors.report(3266, "Argument is not an object", left.getLocation(), left); } question.qualifiers = null; PType rt = right.apply(THIS, question.newConstraint(null)); if (!question.assistantFactory.createPTypeAssistant().isClass(rt, question.env)) { TypeCheckerErrors.report(3266, "Argument is not an object", right.getLocation(), right); } node.setType(AstFactory.newABooleanBasicType(node.getLocation())); return question.assistantFactory.createPTypeAssistant().checkConstraint(question.constraint, node.getType(), node.getLocation()); }