public static ASeqEnumSeqExp newASeqEnumSeqExp(ILexLocation start, List<PExp> members) { ASeqEnumSeqExp result = new ASeqEnumSeqExp(); initExpression(result, start); result.setMembers(members); return result; }
/** * Creates a new complete constructor {@code ASeqEnumSeqExp} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param members_ the {@link NodeList} node for the {@code members} child of this {@link ASeqEnumSeqExp} node * @param types_ the {@link GraphNodeList} <b>graph</a> node for the {@code types} child of this {@link ASeqEnumSeqExp} node. * <i>The parent of this {@code types } will not be changed by adding it to this node.</i> */ public ASeqEnumSeqExp(PType type_, ILexLocation location_, List<? extends PExp> members_, List<? extends PType> types_) { super(type_,location_); this.setMembers(members_); this.setTypes(types_); }
/** * Returns a deep clone of this {@link ASeqEnumSeqExp} node. * @return a deep clone of this {@link ASeqEnumSeqExp} node */ public ASeqEnumSeqExp clone() { return new ASeqEnumSeqExp( _type, _location, cloneList(_members), _types ); }
inASeqEnumSeqExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); List<PExp> copy = new ArrayList<PExp>(node.getMembers()); for( PExp e : copy) List<PType> copy = new ArrayList<PType>(node.getTypes()); for( PType e : copy)
@Override public PType caseASeqEnumSeqExp(ASeqEnumSeqExp node, TypeCheckInfo question) throws AnalysisException { PTypeSet ts = new PTypeSet(question.assistantFactory); node.setTypes(new LinkedList<PType>()); List<PType> types = node.getTypes(); TypeCheckInfo elemConstraint = question; if (question.constraint != null && question.assistantFactory.createPTypeAssistant().isSeq(question.constraint)) { PType stype = question.assistantFactory.createPTypeAssistant().getSeq(question.constraint).getSeqof(); elemConstraint = question.newConstraint(stype); } for (PExp ex : node.getMembers()) { question.qualifiers = null; PType mt = ex.apply(THIS, elemConstraint); ts.add(mt); types.add(mt); } node.setType(ts.isEmpty() ? AstFactory.newASeqSeqType(node.getLocation()) : AstFactory.newASeq1SeqType(node.getLocation(), ts.getType(node.getLocation()))); return question.assistantFactory.createPTypeAssistant().possibleConstraint(question.constraint, node.getType(), node.getLocation()); }
ne.setLeft(exp); ne.setOp(new LexKeywordToken(VDMToken.NE, exp.getLocation())); ASeqEnumSeqExp empty = new ASeqEnumSeqExp(); empty.setMembers(new Vector<PExp>()); ne.setRight(empty); Iterator<PType> it = seq.getTypes().iterator(); for (PExp m : seq.getMembers())
@Override public LexNameList caseASeqEnumSeqExp(ASeqEnumSeqExp expression) throws AnalysisException { return af.createPExpAssistant().getOldNames(expression.getMembers()); }
@Override public SExpIR caseASeqEnumSeqExp(ASeqEnumSeqExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); AEnumSeqExpIR enumSeq = new AEnumSeqExpIR(); if (type instanceof SSeqType) { STypeIR typeCg = type.apply(question.getTypeVisitor(), question); enumSeq.setType(typeCg); } else { question.addUnsupportedNode(node, "Unexpected sequence type for sequence enumeration expression: " + type.getClass().getName()); return null; } LinkedList<PExp> members = node.getMembers(); for (PExp member : members) { SExpIR memberCg = member.apply(question.getExpVisitor(), question); if (memberCg != null) { enumSeq.getMembers().add(memberCg); } else { return null; } } return enumSeq; }
@Override public Value caseASeqEnumSeqExp(ASeqEnumSeqExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); ValueList values = new ValueList(); for (PExp e : node.getMembers()) { values.add(e.apply(VdmRuntime.getExpressionEvaluator(), ctxt)); } return new SeqValue(values); }
public NonEmptySeqObligation(PExp exp, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(exp, POType.NON_EMPTY_SEQ, ctxt, exp.getLocation(), af); // exp <> [] ASeqEnumSeqExp seqExp = new ASeqEnumSeqExp(); seqExp.setMembers(new LinkedList<PExp>()); // empty list seqExp.setType(AstFactory.newASeqSeqType(null, new AUnknownType())); ANotEqualBinaryExp notEqualsExp = AstExpressionFactory.newANotEqualBinaryExp(exp.clone(), seqExp); stitch = notEqualsExp; valuetree.setPredicate(ctxt.getPredWithContext(notEqualsExp)); } }
/** * Creates a new tree field only constructor {@code ASeqEnumSeqExp TAG=seqEnum} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param members_ the {@link NodeList} node for the {@code members} child of this {@link ASeqEnumSeqExp} node */ public ASeqEnumSeqExp(ILexLocation location_, List<? extends PExp> members_) { super(null,location_); this.setMembers(members_); }
inASeqEnumSeqExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this, question); List<PExp> copy = new ArrayList<PExp>(node.getMembers()); for( PExp e : copy) List<PType> copy = new ArrayList<PType>(node.getTypes()); for( PType e : copy)
@Override public ValueList caseASeqEnumSeqExp(ASeqEnumSeqExp exp, ObjectContext ctxt) throws AnalysisException { return af.createPExpAssistant().getValues(exp.getMembers(), ctxt); }
/** * Creates a deep clone of this {@link ASeqEnumSeqExp} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ASeqEnumSeqExp} node */ public ASeqEnumSeqExp clone(Map<INode,INode> oldToNewMap) { ASeqEnumSeqExp node = new ASeqEnumSeqExp( _type, _location, cloneList(_members, oldToNewMap), _types ); oldToNewMap.put(this, node); return node; }
inASeqEnumSeqExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); List<PExp> copy = new ArrayList<PExp>(node.getMembers()); for( PExp e : copy) List<PType> copy = new ArrayList<PType>(node.getTypes()); for( PType e : copy)
@Override public IProofObligationList caseASeqEnumSeqExp(ASeqEnumSeqExp node, IPOContextStack question) throws AnalysisException { IProofObligationList obligations = new ProofObligationList(); for (PExp e : node.getMembers()) { obligations.addAll(e.apply(mainVisitor, question)); } return obligations; }
public static ASeqEnumSeqExp newASeqEnumSeqExp(ILexLocation start) { ASeqEnumSeqExp result = new ASeqEnumSeqExp(); initExpression(result, start); result.setMembers(new Vector<PExp>()); return result; }
mergeReturns(retVal,inASeqEnumSeqExp(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this)); List<PExp> copy = new ArrayList<PExp>(node.getMembers()); for( PExp e : copy) List<PType> copy = new ArrayList<PType>(node.getTypes()); for( PType e : copy)
@Override public PExp caseASeqEnumSeqExp(ASeqEnumSeqExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } return af.createPExpAssistant().findExpression(exp.getMembers(), lineno); }
public PExp caseASeqPattern(ASeqPattern node) throws AnalysisException { ASeqEnumSeqExp seq = new ASeqEnumSeqExp(); List<PExp> values = new Vector<PExp>(); for (PPattern p : node.getPlist()) { values.add(p.apply(this).clone()); } seq.setMembers(values); return addPossibleType(seq, node); }