@Override public Value caseALetDefExp(ALetDefExp node, Context ctxt) throws AnalysisException { return evalLet(node, node.getLocation(), node.getLocalDefs(), node.getExpression(), "expression", ctxt); }
/** * 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(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) 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(); }
@Override public ValueList caseALetDefExp(ALetDefExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = af.createPDefinitionListAssistant().getValues(exp.getLocalDefs(), ctxt); list.addAll(exp.getExpression().apply(THIS, ctxt)); return list; }
/** * 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 PExp caseALetDefExp(ALetDefExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } found = af.createPDefinitionListAssistant().findExpression(exp.getLocalDefs(), lineno); if (found != null) { return found; } return exp.getExpression().apply(THIS, lineno); }
public LexNameList caseALetDefExp(ALetDefExp expression) throws org.overture.ast.analysis.AnalysisException { LexNameList list = af.createPDefinitionListAssistant().getOldNames(expression.getLocalDefs()); list.addAll(af.createPExpAssistant().getOldNames(expression.getExpression())); return list; }
@Override public void caseALetDefExp(ALetDefExp node) throws AnalysisException { if (!proceed(node)) { return; } DefinitionInfo defInfo = new DefinitionInfo(node.getLocalDefs(), af); visitDefs(defInfo.getNodeDefs()); openScope(defInfo, node); node.getExpression().apply(this); endScope(defInfo); }
@Override public LexNameSet caseALetDefExp(ALetDefExp node, FreeVarInfo info) throws AnalysisException { FreeVarInfo local = info; LexNameSet names = new LexNameSet(); for (PDefinition d : node.getLocalDefs()) { if (d instanceof AExplicitFunctionDefinition) { // ignore } else { local = info.set(new FlatEnvironment(af, d, local.env)); names.addAll(d.apply(this, local)); } } names.addAll(node.getExpression().apply(this, local)); return names; }
@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; }
@Override // RWL see [1] pg. public IProofObligationList caseALetDefExp(ALetDefExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); for (PDefinition def : node.getLocalDefs()) { question.push(new PONameContext(aF.createPDefinitionAssistant().getVariableNames(def))); obligations.addAll(def.apply(rootVisitor, question)); question.pop(); } question.push(new POLetDefContext(node)); obligations.addAll(node.getExpression().apply(mainVisitor, question)); question.pop(); return obligations; }