/** * 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_); }
public static ATypeDefinition newATypeDefinition(ILexNameToken name, SInvariantType type, PPattern invPattern, PExp invExpression, AEqRelation eqRelation, AOrdRelation ordRelation) { ATypeDefinition result = new ATypeDefinition(); initDefinition(result, Pass.TYPES, name.getLocation(), name, NameScope.TYPENAME); // Force all type defs (invs) to be static. There is no guarantee that // this will say here but is should result.getAccess().setStatic(new TStatic()); result.setInvType(type); result.setInvPattern(invPattern); result.setInvExpression(invExpression); result.setEqRelation(eqRelation); result.setOrdRelation(ordRelation); result.setType(type); if (type != null) { if (type.getDefinitions() == null) { type.setDefinitions(new LinkedList<PDefinition>()); } type.getDefinitions().add(result); } return result; }
/** * 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_); }