org.extendj.ast
node type VariableDecl

General Info

Production
VariableDecl : ASTNode ::= <ID:String> Dims* [Init:Expr];
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by org.extendj.ast.ASTNode<ASTNode>
          extended by org.extendj.ast.VariableDecl
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, org.jastadd.util.PrettyPrintable

Description

Source
Declared in /home/jesper/git/extendj/java4/grammar/Java.ast at line 82

Member Filters

API level:

Aspect:

Constructors

public VariableDecl()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public VariableDecl(java.lang.String p0,
                    List<Dims> p1,
                    Opt<Expr> p2)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 15
public VariableDecl(beaver.Symbol p0,
                    List<Dims> p1,
                    Opt<Expr> p2)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 20

Attributes

@ASTNodeAnnotation.Attribute
syn java.lang.String name()
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 105
Aspect
Variables

Methods

public void prettyPrint(org.jastadd.util.PrettyPrinter out)
Specified by:prettyPrint in interface org.jastadd.util.PrettyPrintableOverrides:prettyPrint in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd at line 58
Aspect
Java4PrettyPrint
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 173
Aspect
VariableDeclarationTransformation
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 188
Aspect
VariableDeclarationTransformation
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 10
protected int numChildren()
Overrides:numChildren in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 28
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 34
public void flushAttrCache()
Overrides:flushAttrCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 40
public void flushCollectionCache()
Overrides:flushCollectionCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 46
public void flushRewriteCache()
Overrides:flushRewriteCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 52
public VariableDecl clone()
                   throws java.lang.CloneNotSupportedException
Overrides:clone in class ASTNode<ASTNode>
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 58
public VariableDecl copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 65
@Deprecated
public VariableDecl fullCopy()
Deprecated. Please use treeCopy or treeCopyNoTransform instead

Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.

Overrides:fullCopy in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 84
public VariableDecl treeCopyNoTransform()
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Overrides:treeCopyNoTransform in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 94
public VariableDecl treeCopy()
Create a deep copy of the AST subtree at this node. The subtree of this node is traversed to trigger rewrites before copy. The copy is dangling, i.e. has no parent.
Overrides:treeCopy in class ASTNode<ASTNode>
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 114
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 121
public void setID(java.lang.String value)
Replaces the lexeme ID.
Parameters:
value - The new value for the lexeme ID.
public void setID(beaver.Symbol symbol)
JastAdd-internal setter for lexeme ID using the Beaver parser.
Parameters:
symbol - Symbol containing the new value for the lexeme ID
@ASTNodeAnnotation.Token(name="ID")
public java.lang.String getID()
Retrieves the value for the lexeme ID.
Returns:
The value for the lexeme ID.
public void setDimsList(List<Dims> list)
Replaces the Dims list.
Parameters:
list - The new list node to be used as the Dims list.
public int getNumDims()
Retrieves the number of children in the Dims list.
Returns:
Number of children in the Dims list.
Retrieves the number of children in the Dims list. Calling this method will not trigger rewrites.
Returns:
Number of children in the Dims list.
public Dims getDims(int i)
Retrieves the element at index i in the Dims list.
Parameters:
i - Index of the element to return.
Returns:
The element at position i in the Dims list.
public boolean hasDims()
Check whether the Dims list has any children.
Returns:
true if it has at least one child, false otherwise.
public void addDims(Dims node)
Append an element to the Dims list.
Parameters:
node - The element to append to the Dims list.
public void addDimsNoTransform(Dims node)
public void setDims(Dims node,
                    int i)
Replaces the Dims list element at index i with the new node node.
Parameters:
node - The new node to replace the old list element.
i - The list index of the node to be replaced.
Retrieves the Dims list.
Returns:
The node representing the Dims list.
Retrieves the Dims list.

This method does not invoke AST transformations.

Returns:
The node representing the Dims list.
public List<Dims> getDimss()
Retrieves the Dims list.
Returns:
The node representing the Dims list.
Retrieves the Dims list.

This method does not invoke AST transformations.

Returns:
The node representing the Dims list.
public void setInitOpt(Opt<Expr> opt)
Replaces the optional node for the Init child. This is the Opt node containing the child Init, not the actual child!
Parameters:
opt - The new node to be used as the optional node for the Init child.
public void setInit(Expr node)
Replaces the (optional) Init child.
Parameters:
node - The new node to be used as the Init child.
public boolean hasInit()
Check whether the optional Init child exists.
Returns:
true if the optional Init child exists, false if it does not.
public Expr getInit()
Retrieves the (optional) Init child.
Returns:
The Init child, if it exists. Returns null otherwise.
Retrieves the optional node for the Init child. This is the Opt node containing the child Init, not the actual child!
Returns:
The optional node for child the Init child.
Retrieves the optional node for child Init. This is the Opt node containing the child Init, not the actual child!

This method does not invoke AST transformations.

Returns:
The optional node for child Init.
public boolean Define_isSource(ASTNode caller,
                               ASTNode child)
Overrides:Define_isSource in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 47
protected boolean canDefine_isSource(ASTNode caller,
                                     ASTNode child)
Overrides:Define_expectedType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/backend/InnerClasses.jrag at line 93
protected boolean canDefine_expectedType(ASTNode caller,
                                         ASTNode child)
public boolean Define_assignmentContext(ASTNode caller,
                                        ASTNode child)
Overrides:Define_assignmentContext in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 196
protected boolean canDefine_assignmentContext(ASTNode caller,
                                              ASTNode child)
public boolean Define_invocationContext(ASTNode caller,
                                        ASTNode child)
Overrides:Define_invocationContext in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 197
protected boolean canDefine_invocationContext(ASTNode caller,
                                              ASTNode child)
public boolean Define_castContext(ASTNode caller,
                                  ASTNode child)
Overrides:Define_castContext in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 198
protected boolean canDefine_castContext(ASTNode caller,
                                        ASTNode child)
public boolean Define_stringContext(ASTNode caller,
                                    ASTNode child)
Overrides:Define_stringContext in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 199
protected boolean canDefine_stringContext(ASTNode caller,
                                          ASTNode child)
public boolean Define_numericContext(ASTNode caller,
                                     ASTNode child)
Overrides:Define_numericContext in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 200
protected boolean canDefine_numericContext(ASTNode caller,
                                           ASTNode child)
Overrides:rewriteTo in class ASTNode<ASTNode>

Fields

protected java.lang.String tokenString_ID
public int IDstart
public int IDend

Inherited Members

Attributes inherited from org.extendj.ast.ASTNode

Methods inherited from class org.extendj.ast.ASTNode

Methods inherited from class beaver.Symbol

getColumn
getEnd
getId
getLine
getStart
makePosition

Methods inherited from class java.lang.Object

equals
finalize
getClass
hashCode
notify
notifyAll
wait
wait
wait

Fields inherited from org.extendj.ast.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value