@Override public PTypeSet caseAForIndexStm(AForIndexStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@Override public PStm caseAForIndexStm(AForIndexStm 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); }
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this);
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this);
if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) node.getStatement().apply(this, question);
@Override public void caseAForIndexStm(AForIndexStm node) throws AnalysisException { if (!proceed(node)) { return; } if (node.getFrom() != null) { node.getFrom().apply(this); } if (node.getTo() != null) { node.getTo().apply(this); } if (node.getBy() != null) { node.getBy().apply(this); } ILexNameToken var = node.getVar(); openLoop(var, null, node.getStatement()); node.getStatement().apply(this); localDefsInScope.remove(var); }
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 PExp caseAForIndexStm(AForIndexStm stm, Integer lineno) throws AnalysisException { PExp found = af.createPExpAssistant().findExpression(stm.getFrom(), lineno); if (found != null) { return found; } found = stm.getTo().apply(THIS, lineno); if (found != null) { return found; } found = af.createPExpAssistant().findExpression(stm.getBy(), lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno); }
@Override public IProofObligationList caseAForIndexStm(AForIndexStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = node.getFrom().apply(rootVisitor, question); obligations.addAll(node.getTo().apply(rootVisitor, question)); if (node.getBy() != null) { obligations.addAll(node.getBy().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 SStmIR caseAForIndexStm(AForIndexStm node, IRInfo question) throws AnalysisException { ILexNameToken var = node.getVar(); PExp from = node.getFrom(); PExp to = node.getTo(); PExp by = node.getBy(); PStm stm = node.getStatement(); String varCg = var.getName(); SExpIR fromCg = from.apply(question.getExpVisitor(), question); SExpIR toCg = to.apply(question.getExpVisitor(), question); SExpIR byCg = by != null ? by.apply(question.getExpVisitor(), question) : null; SStmIR bodyCg = stm.apply(question.getStmVisitor(), question); AForIndexStmIR forStm = new AForIndexStmIR(); forStm.setVar(varCg); forStm.setFrom(fromCg); forStm.setTo(toCg); forStm.setBy(byCg); forStm.setBody(bodyCg); return forStm; }
@Override public PType caseAForIndexStm(AForIndexStm node, TypeCheckInfo question) throws AnalysisException { PType ft = node.getFrom().apply(THIS, question); PType tt = node.getTo().apply(THIS, question); if (!question.assistantFactory.createPTypeAssistant().isNumeric(ft)) { TypeCheckerErrors.report(3220, "From type is not numeric", node.getLocation(), node); } if (!question.assistantFactory.createPTypeAssistant().isNumeric(tt)) { TypeCheckerErrors.report(3221, "To type is not numeric", node.getLocation(), node); } if (node.getBy() != null) { PType bt = node.getBy().apply(THIS, question); if (!question.assistantFactory.createPTypeAssistant().isNumeric(bt)) { TypeCheckerErrors.report(3222, "By type is not numeric", node.getLocation(), node); } } PDefinition vardef = AstFactory.newALocalDefinition(node.getVar().getLocation(), node.getVar(), NameScope.LOCAL, ft); Environment local = new FlatCheckedEnvironment(question.assistantFactory, vardef, question.env, question.scope); PType rt = node.getStatement().apply(THIS, new TypeCheckInfo(question.assistantFactory, local, question.scope)); local.unusedCheck(); node.setType(rt); return rt; }
Value rv = node.getStatement().apply(VdmRuntime.getStatementEvaluator(), evalContext);