/** * Creates a new tree field only constructor {@code ATypeDefinition TAG=type} 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 invPattern_ the {@link PPattern} node for the {@code invPattern} child of this {@link ATypeDefinition} node * @param invExpression_ the {@link PExp} node for the {@code invExpression} child of this {@link ATypeDefinition} node * @param invdef_ the {@link AExplicitFunctionDefinition} node for the {@code invdef} child of this {@link ATypeDefinition} node * @param infinite_ the {@link Boolean} node for the {@code infinite} child of this {@link ATypeDefinition} node * @param ordRelation_ the {@link AOrdRelation} node for the {@code ordRelation} child of this {@link ATypeDefinition} node * @param eqRelation_ the {@link AEqRelation} node for the {@code eqRelation} child of this {@link ATypeDefinition} node */ public ATypeDefinition(ILexLocation location_, NameScope nameScope_, Boolean used_, AAccessSpecifierAccessSpecifier access_, Pass pass_, PPattern invPattern_, PExp invExpression_, AExplicitFunctionDefinition invdef_, Boolean infinite_, AOrdRelation ordRelation_, AEqRelation eqRelation_) { super(location_,null,nameScope_,used_,null,access_,null,pass_); this.setInvPattern(invPattern_); this.setInvExpression(invExpression_); this.setInvdef(invdef_); this.setInfinite(infinite_); this.setOrdRelation(ordRelation_); this.setEqRelation(eqRelation_); }
@Override public PType caseAOptionalType(AOptionalType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } type.setType(af.createPTypeAssistant().typeResolve(type.getType(), question.root, question.rootVisitor, question.question)); if (question.root != null) { question.root.setInfinite(false); // Could be nil } return type; }
@Override public PType defaultSSeqType(SSeqType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } try { type.setSeqof(af.createPTypeAssistant().typeResolve(type.getSeqof(), question.root, question.rootVisitor, question.question)); if (question.root != null) { question.root.setInfinite(false); // Could be empty } return type; } catch (TypeCheckException e) { type.apply(af.getTypeUnresolver()); throw e; } }
question.root.setInfinite(false); question.root.setInfinite(type.getInfinite());
@Override public PType defaultSSetType(SSetType type, Newquestion question) throws AnalysisException { if (type.getResolved()) { return type; } else { type.setResolved(true); } try { type.setSetof(af.createPTypeAssistant().typeResolve(type.getSetof(), question.root, question.rootVisitor, question.question)); if (question.root != null) { question.root.setInfinite(false); // Could be empty } return type; } catch (TypeCheckException e) { type.apply(af.getTypeUnresolver()); throw e; } }
/** * Creates a new complete constructor {@code ATypeDefinition} 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 invType_ the {@link SInvariantType} <b>graph</a> node for the {@code invType} child of this {@link ATypeDefinition} node. * <i>The parent of this {@code invType } will not be changed by adding it to this node.</i> * @param invPattern_ the {@link PPattern} node for the {@code invPattern} child of this {@link ATypeDefinition} node * @param invExpression_ the {@link PExp} node for the {@code invExpression} child of this {@link ATypeDefinition} node * @param invdef_ the {@link AExplicitFunctionDefinition} node for the {@code invdef} child of this {@link ATypeDefinition} node * @param infinite_ the {@link Boolean} node for the {@code infinite} child of this {@link ATypeDefinition} node * @param name_ the {@link ILexNameToken} <b>graph</a> node for the {@code name} child of this {@link ATypeDefinition} node. * <i>The parent of this {@code name } will not be changed by adding it to this node.</i> * @param ordRelation_ the {@link AOrdRelation} node for the {@code ordRelation} child of this {@link ATypeDefinition} node * @param eqRelation_ the {@link AEqRelation} node for the {@code eqRelation} child of this {@link ATypeDefinition} node * @param composeDefinitions_ the {@link GraphNodeList} <b>graph</a> node for the {@code composeDefinitions} child of this {@link ATypeDefinition} node. * <i>The parent of this {@code composeDefinitions } will not be changed by adding it to this node.</i> */ public ATypeDefinition(ILexLocation location_, NameScope nameScope_, Boolean used_, SClassDefinition classDefinition_, AAccessSpecifierAccessSpecifier access_, PType type_, Pass pass_, SInvariantType invType_, PPattern invPattern_, PExp invExpression_, AExplicitFunctionDefinition invdef_, Boolean infinite_, ILexNameToken name_, AOrdRelation ordRelation_, AEqRelation eqRelation_, List<? extends PDefinition> composeDefinitions_) { super(location_,null,nameScope_,used_,classDefinition_,access_,type_,pass_); this.setInvType(invType_); this.setInvPattern(invPattern_); this.setInvExpression(invExpression_); this.setInvdef(invdef_); this.setInfinite(infinite_); this.setName(name_); this.setOrdRelation(ordRelation_); this.setEqRelation(eqRelation_); this.setComposeDefinitions(composeDefinitions_); }
question.root.setInfinite(false); question.root.setInfinite(type.getInfinite());
root.setInfinite(true);
node.setInfinite(false); node.setInvType((SInvariantType) af.createPTypeAssistant().typeResolve((SInvariantType) node.getInvType(), node, question.rootVisitor, question.question));