@Override public List<PExp> caseAApplyExp(AApplyExp exp) throws AnalysisException { List<PExp> subs = new Vector<PExp>(); subs.addAll(exp.getRoot().apply(THIS)); subs.add(exp); return subs; }
@Override public ValueList caseAFieldNumberExp(AFieldNumberExp exp, ObjectContext ctxt) throws AnalysisException { return exp.getTuple().apply(THIS, ctxt); }
@Override public ValueList caseAFuncInstatiationExp(AFuncInstatiationExp exp, ObjectContext ctxt) throws AnalysisException { return exp.getFunction().apply(THIS, ctxt); }
@Override public ValueList caseAIsOfClassExp(AIsOfClassExp exp, ObjectContext ctxt) throws AnalysisException { return exp.getExp().apply(THIS, ctxt); }
public ILexNameToken getPreName(PExp expression) { try { return expression.apply(aF.getPreNameFinder()); } catch (AnalysisException e) { return null; } }
@Override public PExp caseAExists1Exp(AExists1Exp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } return exp.getPredicate().apply(THIS, lineno);// PExpAssistantInterpreter.findExpression(exp.getPredicate(), // lineno); }
@Override public SExpIR caseAStateInitExp(AStateInitExp node, IRInfo question) throws AnalysisException { return node.getState().getInitExpression().apply(question.getExpVisitor(), question); }
@Override public ValueList caseAMapletExp(AMapletExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.apply(THIS, ctxt); list.addAll(exp.getRight().apply(THIS, ctxt)); return list; }
@Override public IProofObligationList caseATupleExp(ATupleExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); for (PExp exp : node.getArgs()) { obligations.addAll(exp.apply(mainVisitor, question)); } return obligations; }
@Override public SExpIR caseASameBaseClassExp(ASameBaseClassExp node, IRInfo question) throws AnalysisException { PExp left = node.getLeft(); PExp right = node.getRight(); SExpIR leftCg = left.apply(question.getExpVisitor(), question); SExpIR rightCg = right.apply(question.getExpVisitor(), question); ASameBaseClassExpIR sameBaseClassExp = new ASameBaseClassExpIR(); sameBaseClassExp.setLeft(leftCg); sameBaseClassExp.setRight(rightCg); return sameBaseClassExp; }
@Override public IProofObligationList caseAMapInverseUnaryExp( AMapInverseUnaryExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = node.getExp().apply(mainVisitor, question); if (!node.getMapType().getEmpty()) { obligations.add(new org.overture.pog.obligation.MapInverseObligation(node, question, aF)); } return obligations; }
@Override public SExpIR caseAIsOfBaseClassExp(AIsOfBaseClassExp node, IRInfo question) throws AnalysisException { String baseClass = node.getBaseClass().getName(); PExp exp = node.getExp(); SExpIR expCg = exp.apply(question.getExpVisitor(), question); AIsOfBaseClassExpIR isOfBaseClassExp = new AIsOfBaseClassExpIR(); isOfBaseClassExp.setBaseClass(baseClass); isOfBaseClassExp.setExp(expCg); return isOfBaseClassExp; }
@Override public ValueList caseAForAllExp(AForAllExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = new ValueList(); for (PMultipleBind mb : exp.getBindList()) { list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt)); } list.addAll(exp.getPredicate().apply(THIS, ctxt)); return list; }
@Override public void caseAInstanceVariableDefinition( AInstanceVariableDefinition node) throws AnalysisException { handleNameToken(node, node.getName()); handleNameToken(node, node.getOldname()); node.getExpression().apply(this); node.getType().apply(this); }
@Override public IProofObligationList caseADefExp(ADefExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = aF.createPDefinitionAssistant().getProofObligations(node.getLocalDefs(), rootVisitor, question); question.push(new PODefContext(node)); obligations.addAll(node.getExpression().apply(mainVisitor, question)); question.pop(); return obligations; }
private AVarDeclIR consLocalVarDecl(AValueDefinition valueDef, IRInfo question) throws AnalysisException { STypeIR type = valueDef.getType().apply(question.getTypeVisitor(), question); SPatternIR pattern = valueDef.getPattern().apply(question.getPatternVisitor(), question); SExpIR exp = valueDef.getExpression().apply(question.getExpVisitor(), question); return consLocalVarDecl(valueDef, type, pattern, exp); }