/** * Called by the {@link ALetDefExp} node from {@link ALetDefExp#apply(IPOFAnalysis)}. * @param node the calling {@link ALetDefExp} node */ public void caseALetDefExp(ALetDefExp node) throws AnalysisException { _visitedNodes.add(node); inALetDefExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getLocalDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getExpression() != null && !_visitedNodes.contains(node.getExpression())) { node.getExpression().apply(this); } outALetDefExp(node); }
/** * Called by the {@link ALetDefExp} node from {@link ALetDefExp#apply(IAnalysis)}. * @param node the calling {@link ALetDefExp} node */ public void caseALetDefExp(ALetDefExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inALetDefExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getLocalDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getExpression() != null && !_visitedNodes.contains(node.getExpression())) { node.getExpression().apply(this, question); } outALetDefExp(node, question); }
/** * Called by the {@link ALetDefExp} node from {@link ALetDefExp#apply(IAnalysis)}. * @param node the calling {@link ALetDefExp} node */ public void caseALetDefExp(ALetDefExp node) throws AnalysisException { _visitedNodes.add(node); inALetDefExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getLocalDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getExpression() != null && !_visitedNodes.contains(node.getExpression())) { node.getExpression().apply(this); } outALetDefExp(node); }
@Override public PType caseALetDefExp(ALetDefExp node, TypeCheckInfo question) throws AnalysisException { node.setType(typeCheckLet(node, node.getLocalDefs(), node.getExpression(), question)); return node.getType(); }
/** * Called by the {@link ALetDefExp} node from {@link ALetDefExp#apply(IAnalysis)}. * @param node the calling {@link ALetDefExp} node */ public A caseALetDefExp(ALetDefExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inALetDefExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getLocalDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getExpression() != null && !_visitedNodes.contains(node.getExpression())) { mergeReturns(retVal,node.getExpression().apply(this)); } mergeReturns(retVal,outALetDefExp(node)); return retVal; }
/** * Called by the {@link ALetDefExp} node from {@link ALetDefExp#apply(IAnalysis)}. * @param node the calling {@link ALetDefExp} node */ public A caseALetDefExp(ALetDefExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inALetDefExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } { List<PDefinition> copy = new ArrayList<PDefinition>(node.getLocalDefs()); for( PDefinition e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getExpression() != null && !_visitedNodes.contains(node.getExpression())) { mergeReturns(retVal,node.getExpression().apply(this, question)); } mergeReturns(retVal,outALetDefExp(node, question)); return retVal; }
@Override public SExpIR caseALetDefExp(ALetDefExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); PExp exp = node.getExpression(); ALetDefExpIR letDefExp = new ALetDefExpIR(); question.getDeclAssistant().setFinalLocalDefs(node.getLocalDefs(), letDefExp.getLocalDefs(), question); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); letDefExp.setType(typeCg); SExpIR expCg = exp.apply(question.getExpVisitor(), question); letDefExp.setExp(expCg); return letDefExp; }