@Override public PExp caseAMapEnumMapExp(AMapEnumMapExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } for (AMapletExp m : exp.getMembers()) { found = m.apply(THIS, lineno); if (found != null) { return found; } } return null; }
@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 LexNameSet caseAMapEnumMapExp(AMapEnumMapExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); for (AMapletExp maplet: node.getMembers()) { names.addAll(maplet.apply(this, info)); } return names; }
@Override public ValueList caseAMapEnumMapExp(AMapEnumMapExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = new ValueList(); for (AMapletExp maplet : exp.getMembers()) { list.addAll(maplet.apply(THIS, ctxt)); } return list; }
@Override public IProofObligationList caseAMapEnumMapExp(AMapEnumMapExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); List<AMapletExp> members = node.getMembers(); for (AMapletExp maplet : members) { obligations.addAll(maplet.apply(mainVisitor, question)); } if (members.size() > 1) { obligations.add(new MapInjectivityEnum(node, question, aF)); } return obligations; }
e.apply(this);
e.apply(this);
e.apply(this, question);
@Override public PExp caseAMapCompMapExp(AMapCompMapExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } found = exp.getFirst().apply(THIS, lineno); if (found != null) { return found; } return exp.getPredicate() == null ? null : exp.getPredicate().apply(THIS, lineno); }
node.getFirst().apply(this, question);
node.getFirst().apply(this);
node.getFirst().apply(this);
mergeReturns(retVal,e.apply(this));
mergeReturns(retVal,node.getFirst().apply(this, question));
mergeReturns(retVal,node.getFirst().apply(this));
@Override public ValueList caseAMapCompMapExp(AMapCompMapExp exp, ObjectContext ctxt) throws AnalysisException { ValueList list = exp.getFirst().apply(THIS, ctxt); for (PMultipleBind mb : exp.getBindings()) { list.addAll(ctxt.assistantFactory.createPMultipleBindAssistant().getValues(mb, ctxt)); } if (exp.getPredicate() != null) { list.addAll(exp.getPredicate().apply(THIS, ctxt)); } return list; }
SExpIR firstCg = first.apply(question.getExpVisitor(), question); SExpIR predicateCg = predicate != null ? predicate.apply(question.getExpVisitor(), question) : null;
@Override public PType caseAMapEnumMapExp(AMapEnumMapExp node, TypeCheckInfo question) throws AnalysisException { node.setDomTypes(new Vector<PType>()); node.setRngTypes(new Vector<PType>()); if (node.getMembers().isEmpty()) { node.setType(AstFactory.newAMapMapType(node.getLocation())); return node.getType(); } PTypeSet dom = new PTypeSet(question.assistantFactory); PTypeSet rng = new PTypeSet(question.assistantFactory); for (AMapletExp ex : node.getMembers()) { PType mt = ex.apply(THIS, question); if (!question.assistantFactory.createPTypeAssistant().isMap(mt)) { TypeCheckerErrors.report(3121, "Element is not of maplet type", node.getLocation(), node); } else { SMapType maplet = question.assistantFactory.createPTypeAssistant().getMap(mt); dom.add(maplet.getFrom()); node.getDomTypes().add(maplet.getFrom()); rng.add(maplet.getTo()); node.getRngTypes().add(maplet.getTo()); } } node.setType(AstFactory.newAMapMapType(node.getLocation(), dom.getType(node.getLocation()), rng.getType(node.getLocation()))); return question.assistantFactory.createPTypeAssistant().possibleConstraint(question.constraint, node.getType(), node.getLocation()); }
@Override public PType caseAMapCompMapExp(AMapCompMapExp node, TypeCheckInfo question) throws AnalysisException { PDefinition def = AstFactory.newAMultiBindListDefinition(node.getLocation(), node.getBindings()); def.apply(THIS, question.newConstraint(null)); Environment local = new FlatCheckedEnvironment(question.assistantFactory, def, question.env, question.scope); PExp predicate = node.getPredicate(); TypeCheckInfo pquestion = new TypeCheckInfo(question.assistantFactory, local, question.scope, null, AstFactory.newABooleanBasicType(node.getLocation()), null); if (predicate != null && !question.assistantFactory.createPTypeAssistant().isType(predicate.apply(THIS, pquestion), ABooleanBasicType.class)) { TypeCheckerErrors.report(3118, "Predicate is not boolean", predicate.getLocation(), predicate); } node.setType(node.getFirst().apply(THIS, question.newInfo(local))); local.unusedCheck(); return node.getType(); }
obligations.addAll(node.getFirst().apply(mainVisitor, question)); question.pop();