public static ASetEnumSetExp newASetEnumSetExp(ILexLocation start, List<PExp> members) { ASetEnumSetExp result = new ASetEnumSetExp(); initExpression(result, start); result.setMembers(members); return result; }
/** * Creates a new complete constructor {@code ASetEnumSetExp} 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 ASetEnumSetExp} node * @param types_ the {@link GraphNodeList} <b>graph</a> node for the {@code types} child of this {@link ASetEnumSetExp} node. * <i>The parent of this {@code types } will not be changed by adding it to this node.</i> */ public ASetEnumSetExp(PType type_, ILexLocation location_, SSetType setType_, List<? extends PExp> members_, List<? extends PType> types_) { super(type_,location_,setType_); this.setMembers(members_); this.setTypes(types_); }
/** * Returns a deep clone of this {@link ASetEnumSetExp} node. * @return a deep clone of this {@link ASetEnumSetExp} node */ public ASetEnumSetExp clone() { return new ASetEnumSetExp( _type, _location, _setType, cloneList(_members), _types ); }
inASetEnumSetExp(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this, question); if(node.getSetType() != null && !_visitedNodes.contains(node.getSetType())) node.getSetType().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 PType caseASetEnumSetExp(ASetEnumSetExp 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().isSet(question.constraint)) { PType setType = question.assistantFactory.createPTypeAssistant().getSet(question.constraint).getSetof(); elemConstraint = question.newConstraint(setType); } 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.newASetSetType(node.getLocation()) : AstFactory.newASet1SetType(node.getLocation(), ts.getType(node.getLocation()))); return question.assistantFactory.createPTypeAssistant().possibleConstraint(question.constraint, node.getType(), node.getLocation()); }
@Override public SExpIR caseASetEnumSetExp(ASetEnumSetExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); if (!(type instanceof SSetType)) { log.error("Unexpected set type for set enumeration expression: " + type.getClass().getName() + " at " + node.getLocation()); } LinkedList<PExp> members = node.getMembers(); AEnumSetExpIR enumSet = new AEnumSetExpIR(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); enumSet.setType(typeCg); LinkedList<SExpIR> membersCg = enumSet.getMembers(); for (PExp member : members) { SExpIR memberCg = member.apply(question.getExpVisitor(), question); if (memberCg != null) { membersCg.add(memberCg); } else { return null; } } return enumSet; }
ne.setLeft(exp); ne.setOp(new LexKeywordToken(VDMToken.NE, exp.getLocation())); ASetEnumSetExp empty = new ASetEnumSetExp(); empty.setMembers(new Vector<PExp>()); ne.setRight(empty); Iterator<PType> it = set.getTypes().iterator(); for (PExp m : set.getMembers())
@Override public ValueList caseASetEnumSetExp(ASetEnumSetExp exp, ObjectContext ctxt) throws AnalysisException { return af.createPExpAssistant().getValues(exp.getMembers(), ctxt); }
@Override public Value caseASetEnumSetExp(ASetEnumSetExp node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); ValueSet values = new ValueSet(); for (PExp e : node.getMembers()) { values.add(e.apply(VdmRuntime.getExpressionEvaluator(), ctxt)); } return new SetValue(values); }
ILexNameToken m2 = getUnique("m"); ASetEnumSetExp setOfMaplets = new ASetEnumSetExp(); SSetType somType = new ASetSetType(); somType.setSetof(mapEnumExp.getType().clone()); setOfMaplets.setType(somType); setOfMaplets.setMembers(singleMaplets); List<PMultipleBind> m1m2binding = getMultipleSetBindList(setOfMaplets, m1, m2);
/** * Creates a new tree field only constructor {@code ASetEnumSetExp TAG=setEnum} 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 ASetEnumSetExp} node */ public ASetEnumSetExp(ILexLocation location_, List<? extends PExp> members_) { super(null,location_,null); this.setMembers(members_); }
inASetEnumSetExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getSetType() != null && !_visitedNodes.contains(node.getSetType())) node.getSetType().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 LexNameList caseASetEnumSetExp(ASetEnumSetExp expression) throws AnalysisException { return af.createPExpAssistant().getOldNames(expression.getMembers()); }
/** * Creates a deep clone of this {@link ASetEnumSetExp} 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 ASetEnumSetExp} node */ public ASetEnumSetExp clone(Map<INode,INode> oldToNewMap) { ASetEnumSetExp node = new ASetEnumSetExp( _type, _location, _setType, cloneList(_members, oldToNewMap), _types ); oldToNewMap.put(this, node); return node; }
inASetEnumSetExp(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) node.getType().apply(this); if(node.getSetType() != null && !_visitedNodes.contains(node.getSetType())) node.getSetType().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 LexNameSet caseASetEnumSetExp(ASetEnumSetExp node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); for (PExp exp: node.getMembers()) { names.addAll(exp.apply(this, info)); } return names; }
public static ASetEnumSetExp newASetEnumSetExp(ILexLocation start) { ASetEnumSetExp result = new ASetEnumSetExp(); initExpression(result, start); result.setMembers(new Vector<PExp>()); return result; }
mergeReturns(retVal,inASetEnumSetExp(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) mergeReturns(retVal,node.getType().apply(this, question)); if(node.getSetType() != null && !_visitedNodes.contains(node.getSetType())) mergeReturns(retVal,node.getSetType().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 PExp caseASetEnumSetExp(ASetEnumSetExp exp, Integer lineno) throws AnalysisException { PExp found = findExpressionBaseCase(exp, lineno); if (found != null) { return found; } return af.createPExpAssistant().findExpression(exp.getMembers(), lineno); }
public PExp caseASetPattern(ASetPattern node) throws AnalysisException { ASetEnumSetExp set = new ASetEnumSetExp(); List<PExp> values = new Vector<PExp>(); for (PPattern p : node.getPlist()) { values.add(p.apply(this).clone()); } set.setMembers(values); return addPossibleType(set, node); }