/** * 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_); }
@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()); }