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 AST.ASTNode<ASTNode>
          extended by AST.VariableDecl
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>

Description

Source
Declared in Java1.4Frontend/java.ast at line 85

Member Filters

API level:

Aspect:

Constructors

public VariableDecl()
 
public VariableDecl(java.lang.String p0,
                    List<Dims> p1,
                    Opt<Expr> p2)
 
public VariableDecl(beaver.Symbol p0,
                    List<Dims> p1,
                    Opt<Expr> p2)
 

Attributes

syn java.lang.String name()
Source
Declared in Java1.4Frontend/VariableDeclaration.jrag at line 84
Aspect
Variables

Methods

public void flushCache()
Overrides:flushCache in class ASTNode<ASTNode>
public void flushCollectionCache()
Overrides:flushCollectionCache in class ASTNode<ASTNode>
public VariableDecl clone()
                   throws java.lang.CloneNotSupportedException
Overrides:clone in class ASTNode<ASTNode>
Throws:
java.lang.CloneNotSupportedException
Overrides:copy in class ASTNode<ASTNode>
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 Java1.4Frontend/VariableDeclaration.jrag at line 182
Aspect
VariableDeclarationTransformation
Source
Declared in Java1.4Frontend/VariableDeclaration.jrag at line 196
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>
protected int numChildren()
Overrides:numChildren in class ASTNode<ASTNode>
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class ASTNode<ASTNode>
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.
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 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.
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.
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 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.
public void setInit(Expr node)
Replaces the (optional) Init child.
Parameters:
node - The new node to be used as the Init child.
public Opt<Expr> getInitOpt()
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_boolean_isSource(ASTNode caller,
                                       ASTNode child)
Overrides:Define_boolean_isSource in class ASTNode<ASTNode>
Source
Declared in Java1.4Frontend/DefiniteAssignment.jrag at line 41
Overrides:Define_TypeDecl_expectedType in class ASTNode<ASTNode>
Source
Declared in Java1.4Backend/InnerClasses.jrag at line 69
Overrides:rewriteTo in class ASTNode<ASTNode>

Fields

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

Inherited Members

Attributes inherited from AST.ASTNode

Methods inherited from class 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 AST.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value