/** * Creates a new tree field only constructor {@code AInstanceVariableDefinition TAG=instanceVariable} 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 expression_ the {@link PExp} node for the {@code expression} child of this {@link AInstanceVariableDefinition} node * @param initialized_ the {@link Boolean} node for the {@code initialized} child of this {@link AInstanceVariableDefinition} node * @param oldname_ the {@link ILexNameToken} node for the {@code oldname} child of this {@link AInstanceVariableDefinition} node */ public AInstanceVariableDefinition(ILexLocation location_, NameScope nameScope_, Boolean used_, AAccessSpecifierAccessSpecifier access_, Pass pass_, PExp expression_, Boolean initialized_, ILexNameToken oldname_) { super(location_,null,nameScope_,used_,null,access_,null,pass_); this.setExpression(expression_); this.setInitialized(initialized_); this.setOldname(oldname_); }
/** * Creates a new complete constructor {@code AInstanceVariableDefinition} 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 expression_ the {@link PExp} node for the {@code expression} child of this {@link AInstanceVariableDefinition} node * @param expType_ the {@link PType} <b>graph</a> node for the {@code expType} child of this {@link AInstanceVariableDefinition} node. * <i>The parent of this {@code expType } will not be changed by adding it to this node.</i> * @param initialized_ the {@link Boolean} node for the {@code initialized} child of this {@link AInstanceVariableDefinition} node * @param oldname_ the {@link ILexNameToken} node for the {@code oldname} child of this {@link AInstanceVariableDefinition} node */ public AInstanceVariableDefinition(ILexLocation location_, ILexNameToken name_, NameScope nameScope_, Boolean used_, SClassDefinition classDefinition_, AAccessSpecifierAccessSpecifier access_, PType type_, Pass pass_, PExp expression_, PType expType_, Boolean initialized_, ILexNameToken oldname_) { super(location_,name_,nameScope_,used_,classDefinition_,access_,type_,pass_); this.setExpression(expression_); this.setExpType(expType_); this.setInitialized(initialized_); this.setOldname(oldname_); }
public static AInstanceVariableDefinition newAInstanceVariableDefinition( ILexNameToken name, PType type, PExp expression) { AInstanceVariableDefinition result = new AInstanceVariableDefinition(); // Definition initialization initDefinition(result, Pass.VALUES, name.getLocation(), name, NameScope.VARSANDSTATE); result.setType(type); result.setExpression(expression); if (result.getLocation() != null) { result.getLocation().executable(false); } result.setOldname(name.getOldName()); result.setInitialized(!(expression instanceof AUndefinedExp)); return result; }