@Override public PType caseATypeMultipleBind(ATypeMultipleBind mb) throws AnalysisException { return af.createPPatternListAssistant().getPossibleType(mb.getPlist(), mb.getLocation()); }
/** * Called by the {@link ATypeMultipleBind} node from {@link ATypeMultipleBind#apply(IPOFAnalysis)}. * @param node the calling {@link ATypeMultipleBind} node */ public void caseATypeMultipleBind(ATypeMultipleBind node) throws AnalysisException { _visitedNodes.add(node); inATypeMultipleBind(node); { List<PPattern> copy = new ArrayList<PPattern>(node.getPlist()); for( PPattern e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outATypeMultipleBind(node); }
/** * Called by the {@link ATypeMultipleBind} node from {@link ATypeMultipleBind#apply(IAnalysis)}. * @param node the calling {@link ATypeMultipleBind} node */ public void caseATypeMultipleBind(ATypeMultipleBind node, Q question) throws AnalysisException { _visitedNodes.add(node); inATypeMultipleBind(node, question); { List<PPattern> copy = new ArrayList<PPattern>(node.getPlist()); for( PPattern e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } outATypeMultipleBind(node, question); }
/** * Called by the {@link ATypeMultipleBind} node from {@link ATypeMultipleBind#apply(IAnalysis)}. * @param node the calling {@link ATypeMultipleBind} node */ public void caseATypeMultipleBind(ATypeMultipleBind node) throws AnalysisException { _visitedNodes.add(node); inATypeMultipleBind(node); { List<PPattern> copy = new ArrayList<PPattern>(node.getPlist()); for( PPattern e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } outATypeMultipleBind(node); }
@Override public SMultipleBindIR caseATypeMultipleBind(ATypeMultipleBind node, IRInfo question) throws AnalysisException { List<PPattern> patterns = node.getPlist(); PType boundType = node.getType(); List<SPatternIR> patternsCg = new LinkedList<SPatternIR>(); for (PPattern pattern : patterns) { SPatternIR patternTempCg = pattern.apply(question.getPatternVisitor(), question); if (patternTempCg != null) { patternsCg.add(patternTempCg); } else { return null; } } STypeIR boundTypeCg = boundType.apply(question.getTypeVisitor(), question); ATypeMultipleBindIR multipleSetBind = new ATypeMultipleBindIR(); multipleSetBind.setPatterns(patternsCg); multipleSetBind.setType(boundTypeCg); return multipleSetBind; }
/** * Called by the {@link ATypeMultipleBind} node from {@link ATypeMultipleBind#apply(IAnalysis)}. * @param node the calling {@link ATypeMultipleBind} node */ public A caseATypeMultipleBind(ATypeMultipleBind node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inATypeMultipleBind(node, question)); { List<PPattern> copy = new ArrayList<PPattern>(node.getPlist()); for( PPattern e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } mergeReturns(retVal,outATypeMultipleBind(node, question)); return retVal; }
/** * Called by the {@link ATypeMultipleBind} node from {@link ATypeMultipleBind#apply(IAnalysis)}. * @param node the calling {@link ATypeMultipleBind} node */ public A caseATypeMultipleBind(ATypeMultipleBind node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inATypeMultipleBind(node)); { List<PPattern> copy = new ArrayList<PPattern>(node.getPlist()); for( PPattern e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } mergeReturns(retVal,outATypeMultipleBind(node)); return retVal; }
@Override public PType caseATypeMultipleBind(ATypeMultipleBind node, TypeCheckInfo question) throws AnalysisException { question.assistantFactory.createPPatternListAssistant().typeResolve(node.getPlist(), THIS, question); PType type = question.assistantFactory.createPTypeAssistant().typeResolve(node.getType(), null, THIS, question); PType ptype = question.assistantFactory.createPPatternListAssistant().getPossibleType(node.getPlist(), node.getLocation()); if (!question.assistantFactory.getTypeComparator().compatible(ptype, type)) { TypeCheckerErrors.report(3265, "At least one bind cannot match this type", type.getLocation(), type); TypeCheckerErrors.detail2("Binds", ptype, "Type", type); } node.setType(type); return type; }