@Override public PTypeSet caseALetBeStStm(ALetBeStStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@Override public PStm caseALetBeStStm(ALetBeStStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getStatement(), // lineno); }
@Override public Value caseALetBeStStm(ALetBeStStm node, Context ctxt) throws AnalysisException { return evalLetBeSt(node, node.getLocation(), node.getDef(), node.getSuchThat(), node.getStatement(), 4040, "statement", ctxt); }
@Override public PType caseALetBeStStm(ALetBeStStm node, TypeCheckInfo question) throws AnalysisException { Entry<PType, AMultiBindListDefinition> res = typecheckLetBeSt(node, node.getLocation(), node.getBind(), node.getSuchThat(), node.getStatement(), question); node.setDef(res.getValue()); node.setType(res.getKey()); return node.getType(); }
@Override public PExp caseALetBeStStm(ALetBeStStm stm, Integer lineno) throws AnalysisException { if (stm.getSuchThat() != null) { PExp found = af.createPExpAssistant().findExpression(stm.getSuchThat(), lineno); if (found != null) { return found; } } return stm.getStatement().apply(THIS, lineno); }
/** * Called by the {@link ALetBeStStm} node from {@link ALetBeStStm#apply(IAnalysis)}. * @param node the calling {@link ALetBeStStm} node */ public void caseALetBeStStm(ALetBeStStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inALetBeStStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this, question); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this, question); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this, question); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this, question); } outALetBeStStm(node, question); }
/** * Called by the {@link ALetBeStStm} node from {@link ALetBeStStm#apply(IPOFAnalysis)}. * @param node the calling {@link ALetBeStStm} node */ public void caseALetBeStStm(ALetBeStStm node) throws AnalysisException { _visitedNodes.add(node); inALetBeStStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this); } outALetBeStStm(node); }
/** * Called by the {@link ALetBeStStm} node from {@link ALetBeStStm#apply(IAnalysis)}. * @param node the calling {@link ALetBeStStm} node */ public void caseALetBeStStm(ALetBeStStm node) throws AnalysisException { _visitedNodes.add(node); inALetBeStStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getBind() != null && !_visitedNodes.contains(node.getBind())) { node.getBind().apply(this); } if(node.getSuchThat() != null && !_visitedNodes.contains(node.getSuchThat())) { node.getSuchThat().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } if(node.getDef() != null && !_visitedNodes.contains(node.getDef())) { node.getDef().apply(this); } outALetBeStStm(node); }
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) mergeReturns(retVal,node.getStatement().apply(this, question));
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) mergeReturns(retVal,node.getStatement().apply(this));
@Override public void caseALetBeStStm(ALetBeStStm node) throws AnalysisException { if (!proceed(node)) { return; } node.getDef().apply(this); DefinitionInfo defInfo = new DefinitionInfo(node.getDef().getDefs(), af); openScope(defInfo, node); if (node.getSuchThat() != null) { node.getSuchThat().apply(this); } node.getStatement().apply(this); endScope(defInfo); }
@Override public SStmIR caseALetBeStStm(ALetBeStStm node, IRInfo question) throws AnalysisException { PMultipleBind multipleBind = node.getBind(); SMultipleBindIR multipleBindCg = multipleBind.apply(question.getMultipleBindVisitor(), question); PExp suchThat = node.getSuchThat(); PStm stm = node.getStatement(); SExpIR suchThatCg = suchThat != null ? suchThat.apply(question.getExpVisitor(), question) : null; SStmIR stmCg = stm.apply(question.getStmVisitor(), question); ALetBeStStmIR letBeSt = new ALetBeStStmIR(); AHeaderLetBeStIR header = question.getExpAssistant().consHeader(multipleBindCg, suchThatCg); letBeSt.setHeader(header); letBeSt.setStatement(stmCg); return letBeSt; }
@Override public IProofObligationList caseALetBeStStm(ALetBeStStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); obligations.add(new LetBeExistsObligation(node, question, aF)); obligations.addAll(node.getBind().apply(rootVisitor, question)); if (node.getSuchThat() != null) { obligations.addAll(node.getSuchThat().apply(rootVisitor, question)); } question.push(new POScopeContext()); obligations.addAll(node.getStatement().apply(mainVisitor, question)); question.pop(); return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
@Override public LexNameSet caseALetBeStStm(ALetBeStStm node, FreeVarInfo info) throws AnalysisException { PDefinition def = AstFactory.newAMultiBindListDefinition(node.getLocation(), af.createPMultipleBindAssistant().getMultipleBindList(node.getBind())); FreeVarInfo local = info.set(new FlatEnvironment(af, def, info.env)); LexNameSet names = node.getBind().apply(this, local); if (node.getSuchThat() != null) { names.addAll(node.getSuchThat().apply(this, local)); } names.addAll(node.getStatement().apply(this, local)); return names; }