@Override public PExp caseAEqualsDefinition(AEqualsDefinition def, Integer lineno) throws AnalysisException { return af.createPExpAssistant().findExpression(def.getTest(), lineno); }
@Override public LexNameSet caseAEqualsDefinition(AEqualsDefinition node, FreeVarInfo info) throws AnalysisException { FreeVarInfo local = info.set(new FlatEnvironment(af, node.getDefs(), info.env)); return node.getTest().apply(this, local); }
@Override public ValueList caseAEqualsDefinition(AEqualsDefinition def, ObjectContext ctxt) throws AnalysisException { ValueList list = af.createPExpAssistant().getValues(def.getTest(), ctxt); if (def.getSetbind() != null) { list.addAll(af.createPBindAssistant().getBindValues(def.getSetbind(), ctxt, false)); } return list; }
public ValueBindingObligation(PPattern pattern, PType type, PExp exp, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(pattern, POType.VALUE_BINDING, ctxt, pattern.getLocation(), af); AExistsExp existsExp = new AExistsExp(); List<PPattern> patternList = new Vector<PPattern>(); patternList.add(pattern.clone()); ATypeMultipleBind typeBind = new ATypeMultipleBind(); typeBind.setPlist(patternList); typeBind.setType(type.clone()); List<PMultipleBind> bindList = new Vector<PMultipleBind>(); bindList.add(typeBind); existsExp.setBindList(bindList); AEqualsBinaryExp equals = AstExpressionFactory.newAEqualsBinaryExp(patternToExp(pattern.clone()), exp.clone()); existsExp.setPredicate(equals); stitch = existsExp; valuetree.setPredicate(ctxt.getPredWithContext(existsExp)); // valuetree.setContext(ctxt.getContextNodeList()); } }
private AVarDeclIR consLocalVarDecl(AEqualsDefinition equalsDef, IRInfo question) throws AnalysisException { STypeIR type = equalsDef.getExpType().apply(question.getTypeVisitor(), question); SPatternIR pattern = equalsDef.getPattern().apply(question.getPatternVisitor(), question); SExpIR exp = equalsDef.getTest().apply(question.getExpVisitor(), question); return consLocalVarDecl(equalsDef, type, pattern, exp); }
@Override public LexNameList caseAEqualsDefinition(AEqualsDefinition def) throws AnalysisException { LexNameList list = af.createPExpAssistant().getOldNames(def.getTest()); if (def.getSetbind() != null) { list.addAll(def.getSetbind().apply(this)); } else if (def.getSeqbind() != null) { list.addAll(def.getSeqbind().apply(this)); } return list; }
if (!assistantFactory.getTypeComparator().isSubType(question.checkType(node.getTest(), node.getExpType()), compatible)) TypeCompatibilityObligation sto = TypeCompatibilityObligation.newInstance(node.getTest(), compatible, node.getExpType(), question, assistantFactory); if (sto != null) if (!assistantFactory.getTypeComparator().isSubType(question.checkType(node.getTest(), node.getExpType()), node.getDefType())) TypeCompatibilityObligation sto = TypeCompatibilityObligation.newInstance(node.getTest(), node.getDefType(), node.getExpType(), question, assistantFactory); if (sto != null) list.addAll(node.getTest().apply(rootVisitor, question)); return list; } catch (Exception e)
try v = def.getTest().apply(VdmRuntime.getExpressionEvaluator(), initialContext); } catch (AnalysisException e1)
node.setExpType(node.getTest().apply(THIS, question)); PPattern pattern = node.getPattern();