@Override public List<PExp> caseAElseIfExp(AElseIfExp exp) throws AnalysisException { List<PExp> subs = exp.getElseIf().apply(THIS); subs.addAll(exp.getThen().apply(THIS)); subs.add(exp); return subs; }
@Override public Value caseAElseIfExp(AElseIfExp node, Context ctxt) throws AnalysisException { return evalElseIf(node, node.getLocation(), node.getElseIf(), node.getThen(), ctxt); }
/** * Called by the {@link AElseIfExp} node from {@link AElseIfExp#apply(IPOFAnalysis)}. * @param node the calling {@link AElseIfExp} node */ public void caseAElseIfExp(AElseIfExp node) throws AnalysisException { _visitedNodes.add(node); inAElseIfExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getElseIf() != null && !_visitedNodes.contains(node.getElseIf())) { node.getElseIf().apply(this); } if(node.getThen() != null && !_visitedNodes.contains(node.getThen())) { node.getThen().apply(this); } outAElseIfExp(node); }
/** * Called by the {@link AElseIfExp} node from {@link AElseIfExp#apply(IAnalysis)}. * @param node the calling {@link AElseIfExp} node */ public void caseAElseIfExp(AElseIfExp node) throws AnalysisException { _visitedNodes.add(node); inAElseIfExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getElseIf() != null && !_visitedNodes.contains(node.getElseIf())) { node.getElseIf().apply(this); } if(node.getThen() != null && !_visitedNodes.contains(node.getThen())) { node.getThen().apply(this); } outAElseIfExp(node); }
/** * Called by the {@link AElseIfExp} node from {@link AElseIfExp#apply(IAnalysis)}. * @param node the calling {@link AElseIfExp} node */ public void caseAElseIfExp(AElseIfExp node, Q question) throws AnalysisException { _visitedNodes.add(node); inAElseIfExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getElseIf() != null && !_visitedNodes.contains(node.getElseIf())) { node.getElseIf().apply(this, question); } if(node.getThen() != null && !_visitedNodes.contains(node.getThen())) { node.getThen().apply(this, question); } outAElseIfExp(node, question); }
@Override public ValueList caseAElseIfExp(AElseIfExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.getElseIf().apply(THIS, ctxt); list.addAll(exp.getThen().apply(THIS, ctxt)); return list; }
@Override public PType caseAElseIfExp(AElseIfExp node, TypeCheckInfo question) throws AnalysisException { node.setType(typeCheckAElseIf(node, node.getLocation(), node.getElseIf(), node.getThen(), question)); return node.getType(); }
/** * Called by the {@link AElseIfExp} node from {@link AElseIfExp#apply(IAnalysis)}. * @param node the calling {@link AElseIfExp} node */ public A caseAElseIfExp(AElseIfExp node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAElseIfExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getElseIf() != null && !_visitedNodes.contains(node.getElseIf())) { mergeReturns(retVal,node.getElseIf().apply(this)); } if(node.getThen() != null && !_visitedNodes.contains(node.getThen())) { mergeReturns(retVal,node.getThen().apply(this)); } mergeReturns(retVal,outAElseIfExp(node)); return retVal; }
/** * Called by the {@link AElseIfExp} node from {@link AElseIfExp#apply(IAnalysis)}. * @param node the calling {@link AElseIfExp} node */ public A caseAElseIfExp(AElseIfExp node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAElseIfExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getElseIf() != null && !_visitedNodes.contains(node.getElseIf())) { mergeReturns(retVal,node.getElseIf().apply(this, question)); } if(node.getThen() != null && !_visitedNodes.contains(node.getThen())) { mergeReturns(retVal,node.getThen().apply(this, question)); } mergeReturns(retVal,outAElseIfExp(node, question)); return retVal; }
public LexNameList caseAElseIfExp(AElseIfExp expression) throws org.overture.ast.analysis.AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(expression.getElseIf()); list.addAll(af.createPExpAssistant().getOldNames(expression.getThen())); return list; }
@Override public IProofObligationList caseAElseIfExp(AElseIfExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); question.push(new POImpliesContext(node.getElseIf())); obligations.addAll(node.getThen().apply(mainVisitor, question)); question.pop(); return obligations; }
@Override public IProofObligationList caseAIfExp(AIfExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = node.getTest().apply(mainVisitor, question); question.push(new POImpliesContext(node.getTest())); obligations.addAll(node.getThen().apply(mainVisitor, question)); question.pop(); question.push(new PONotImpliesContext(node.getTest())); for (AElseIfExp e : node.getElseList()) { obligations.addAll(e.apply(mainVisitor, question)); question.push(new PONotImpliesContext(e.getElseIf())); } int sizeBefore = question.size(); obligations.addAll(node.getElse().apply(mainVisitor, question)); assert sizeBefore <= question.size(); for (int i = 0; i < node.getElseList().size(); i++) { question.pop(); } question.pop(); return obligations; }
testExp = currentElseExp.getElseIf().apply(question.getExpVisitor(), question); thenExp = currentElseExp.getThen().apply(question.getExpVisitor(), question); expectedType = currentElseExp.getType().apply(question.getTypeVisitor(), question);