@Override
 public PExp caseAUnionPattern(AUnionPattern pattern) throws AnalysisException {
   LexToken op = new LexKeywordToken(VDMToken.UNION, pattern.getLocation());
   return AstFactory.newASetUnionBinaryExp(
       af.createPPatternAssistant().getMatchingExpression(pattern.getLeft()),
       op,
       af.createPPatternAssistant().getMatchingExpression(pattern.getRight()));
 }
 @Override
 public PExp caseAConcatenationPattern(AConcatenationPattern pattern) throws AnalysisException {
   LexToken op = new LexKeywordToken(VDMToken.CONCATENATE, pattern.getLocation());
   PExp le = af.createPPatternAssistant().getMatchingExpression(pattern.getLeft());
   PExp re = af.createPPatternAssistant().getMatchingExpression(pattern.getRight());
   return AstFactory.newASeqConcatBinaryExp(le, op, re);
 }
  @Override
  public PExp caseAObjectPattern(AObjectPattern pattern) throws AnalysisException {
    List<PExp> list = new LinkedList<PExp>();

    for (ANamePatternPair npp : pattern.getFields()) {
      list.add(af.createPPatternAssistant().getMatchingExpression(npp.getPattern()));
    }

    ILexNameToken tpName = pattern.getClassname();
    return AstFactory.newANewExp(pattern.getLocation(), tpName, list);
  }
  @Override
  public PExp caseARecordPattern(ARecordPattern pattern) throws AnalysisException {
    List<PExp> list = new LinkedList<PExp>();

    for (PPattern p : pattern.getPlist()) {
      list.add(af.createPPatternAssistant().getMatchingExpression(p));
    }

    ILexNameToken tpName = pattern.getTypename();
    return AstFactory.newAMkTypeExp(tpName.clone(), list);
  }