org.extendj.ast
node type VariableDeclaration

General Info

Production
VariableDeclaration : ASTNode ::= Modifiers TypeAccess:Access <ID:String> [Init:Expr];
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by org.extendj.ast.ASTNode<ASTNode>
          extended by org.extendj.ast.VariableDeclaration
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, java.util.Iterator, org.jastadd.util.PrettyPrintable
Direct Known Subclasses:
ResourceDeclaration
static class SimpleSet.SimpleSetImpl
           

Description

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

Member Filters

API level:

Aspect:

Constructors

public VariableDeclaration(Access type,
                           java.lang.String name,
                           Expr init)
 
Source
Declared in /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag at line 85
Aspect
NodeConstructors
public VariableDeclaration(Access type,
                           java.lang.String name)
 
Source
Declared in /home/jesper/git/extendj/java4/frontend/NodeConstructors.jrag at line 89
Aspect
NodeConstructors
public VariableDeclaration()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public VariableDeclaration(Modifiers p0,
                           Access p1,
                           java.lang.String p2,
                           Opt<Expr> p3)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 14
public VariableDeclaration(Modifiers p0,
                           Access p1,
                           beaver.Symbol p2,
                           Opt<Expr> p3)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 20

Attributes

Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 121
Aspect
DataStructures
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 122
Aspect
DataStructures
@ASTNodeAnnotation.Attribute
syn boolean contains(java.lang.Object o)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 126
Aspect
DataStructures
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 114
Aspect
DefiniteAssignment
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 115
Aspect
DefiniteAssignment
@ASTNodeAnnotation.Attribute
syn boolean isDAafter(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 551
Aspect
DA
@ASTNodeAnnotation.Attribute
syn boolean isDUafter(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 996
Aspect
DU
@ASTNodeAnnotation.Attribute
syn boolean declaresVariable(java.lang.String name)
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag at line 216
Aspect
VariableScope
Source
Declared in /home/jesper/git/extendj/java4/frontend/Modifiers.jrag at line 260
Aspect
Modifiers
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag at line 251
Aspect
PrettyPrintUtil
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag at line 276
Aspect
TypeAnalysis
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 34
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 36
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 37
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 38
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 39
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 40
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 41
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 43
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 44
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 45
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 46
Aspect
Variables
@ASTNodeAnnotation.Attribute
syn java.lang.String name()
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 48
Aspect
Variables
@ASTNodeAnnotation.Attribute
syn org.extendj.ast.Constant constant()
Source
Declared in /home/jesper/git/extendj/java4/frontend/VariableDeclaration.jrag at line 50
Aspect
Variables
Source
Declared in /home/jesper/git/extendj/java4/backend/LocalNum.jrag at line 48
Aspect
LocalNum
@ASTNodeAnnotation.Attribute
syn org.extendj.ast.Variable sourceVariableDecl()
Source
Declared in /home/jesper/git/extendj/java5/frontend/Generics.jrag at line 1637
Aspect
SourceDeclarations
@ASTNodeAnnotation.Attribute
syn java.util.Collection<TypeDecl> throwTypes()
Source
Declared in /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag at line 41
Aspect
PreciseRethrow
@ASTNodeAnnotation.Attribute
syn boolean modifiedInScope(org.extendj.ast.Variable var)
Source
Declared in /home/jesper/git/extendj/java7/frontend/PreciseRethrow.jrag at line 93
Aspect
PreciseRethrow
@ASTNodeAnnotation.Attribute
syn boolean hasAnnotationSuppressWarnings(java.lang.String annot)
Source
Declared in /home/jesper/git/extendj/java7/frontend/SuppressWarnings.jrag at line 32
Aspect
SuppressWarnings
@ASTNodeAnnotation.Attribute
syn boolean suppressWarnings(java.lang.String type)
Source
Declared in /home/jesper/git/extendj/java7/frontend/SuppressWarnings.jrag at line 42
Aspect
SuppressWarnings
Note: this attribute deviates from what the JLS says about effectively finalness, simply because the attribute name would be confusing if it did not return true when the variable was explicitly declared final. The JLS considers declared final and effectively final to be mutually exclusive, we don't.
Source
Declared in /home/jesper/git/extendj/java8/frontend/EffectivelyFinal.jrag at line 151
Aspect
EffectivelyFinal
Source
Declared in /home/jesper/git/extendj/java4/frontend/DeclareBeforeUse.jrag at line 34
Aspect
DeclareBeforeUse
@ASTNodeAnnotation.Attribute
inh boolean isDAbefore(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 256
Aspect
DA
@ASTNodeAnnotation.Attribute
inh boolean isDUbefore(org.extendj.ast.Variable v)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 780
Aspect
DU
@ASTNodeAnnotation.Attribute
inh org.extendj.ast.SimpleSet lookupVariable(java.lang.String name)
Source
Declared in /home/jesper/git/extendj/java4/frontend/LookupVariable.jrag at line 42
Aspect
VariableScope
@ASTNodeAnnotation.Attribute
inh org.extendj.ast.VariableScope outerScope()
Source
Declared in /home/jesper/git/extendj/java4/frontend/NameCheck.jrag at line 365
Aspect
NameCheck
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag at line 563
Aspect
NestedTypes
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeAnalysis.jrag at line 640
Aspect
NestedTypes
@ASTNodeAnnotation.Attribute
inh int variableScopeEndLabel(org.extendj.ast.CodeGeneration gen)
Source
Declared in /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag at line 67
Aspect
CodeGeneration
Source
Declared in /home/jesper/git/extendj/java4/backend/LocalNum.jrag at line 50
Aspect
LocalNum
@ASTNodeAnnotation.Attribute
inh boolean withinSuppressWarnings(java.lang.String annot)
Source
Declared in /home/jesper/git/extendj/java7/frontend/SuppressWarnings.jrag at line 35
Aspect
SuppressWarnings
@ASTNodeAnnotation.Attribute
inh boolean resourcePreviouslyDeclared(java.lang.String name)
Source
Declared in /home/jesper/git/extendj/java7/frontend/TryWithResources.jrag at line 182
Aspect
TryWithResources
@ASTNodeAnnotation.Attribute
inh boolean inhModifiedInScope(org.extendj.ast.Variable var)
Source
Declared in /home/jesper/git/extendj/java8/frontend/EffectivelyFinal.jrag at line 32
Aspect
PreciseRethrow
Source
Declared in /home/jesper/git/extendj/java8/frontend/EnclosingLambda.jrag at line 36
Aspect
EnclosingLambda

Methods

public org.extendj.ast.SimpleSet add(java.lang.Object o)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 123
Aspect
DataStructures
public boolean isSingleton()
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 127
Aspect
DataStructures
public boolean isSingleton(java.lang.Object o)
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 128
Aspect
DataStructures
public java.util.Iterator iterator()
Specified by:iterator in interface java.lang.Iterable<ASTNode>Overrides:iterator in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 132
Aspect
DataStructures
public boolean hasNext()
Specified by:hasNext in interface java.util.Iterator
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 133
Aspect
DataStructures
public java.lang.Object next()
Specified by:next in interface java.util.Iterator
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 134
Aspect
DataStructures
public void remove()
Specified by:remove in interface java.util.Iterator
Source
Declared in /home/jesper/git/extendj/java4/frontend/DataStructures.jrag at line 135
Aspect
DataStructures
public void typeCheck()
Overrides:typeCheck in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/TypeCheck.jrag at line 43
Aspect
TypeCheck
public void createBCode(org.extendj.ast.CodeGeneration gen)
Overrides:createBCode in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 276
Aspect
CreateBCode
protected void emitInitializerBCode(org.extendj.ast.CodeGeneration gen)
Generate variable initialization bytecode.
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 287
Aspect
CreateBCode
public void checkWarnings()
Description copied from class: ASTNodeChecking of the SafeVarargs annotation is only needed for method declarations.
Overrides:checkWarnings in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java7/frontend/UncheckedConversion.jrag at line 41
Aspect
UncheckedConversion
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 29
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 35
public void flushAttrCache()
Overrides:flushAttrCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 41
public void flushCollectionCache()
Overrides:flushCollectionCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 57
public void flushRewriteCache()
Overrides:flushRewriteCache in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 63
public VariableDeclaration 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 69
public VariableDeclaration copy()
Overrides:copy in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 76
@Deprecated
public VariableDeclaration 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 95
public VariableDeclaration 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 105
public VariableDeclaration 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 125
protected boolean is$Equal(ASTNode node)
Overrides:is$Equal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/ASTNode at line 132
public void setModifiers(Modifiers node)
Replaces the Modifiers child.
Parameters:
node - The new node to replace the Modifiers child.
Retrieves the Modifiers child.
Returns:
The current node used as the Modifiers child.
Retrieves the Modifiers child.

This method does not invoke AST transformations.

Returns:
The current node used as the Modifiers child.
public void setTypeAccess(Access node)
Replaces the TypeAccess child.
Parameters:
node - The new node to replace the TypeAccess child.
Retrieves the TypeAccess child.
Returns:
The current node used as the TypeAccess child.
Retrieves the TypeAccess child.

This method does not invoke AST transformations.

Returns:
The current node used as the TypeAccess child.
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 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.
Source
Declared in /home/jesper/git/extendj/java7/frontend/MultiCatch.jrag at line 245
Aspect
MultiCatch
public void nameCheck()
Overrides:nameCheck in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/NameCheck.jrag at line 139
Aspect
Java8NameCheck
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)
public boolean Define_isDAbefore(ASTNode caller,
                                 ASTNode child,
                                 org.extendj.ast.Variable v)
Overrides:Define_isDAbefore in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 255
protected boolean canDefine_isDAbefore(ASTNode caller,
                                       ASTNode child,
                                       org.extendj.ast.Variable v)
public boolean Define_isDUbefore(ASTNode caller,
                                 ASTNode child,
                                 org.extendj.ast.Variable v)
Overrides:Define_isDUbefore in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/DefiniteAssignment.jrag at line 779
protected boolean canDefine_isDUbefore(ASTNode caller,
                                       ASTNode child,
                                       org.extendj.ast.Variable v)
public boolean Define_mayBeFinal(ASTNode caller,
                                 ASTNode child)
Overrides:Define_mayBeFinal in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/Modifiers.jrag at line 423
protected boolean canDefine_mayBeFinal(ASTNode caller,
                                       ASTNode child)
public org.extendj.ast.NameType Define_nameType(ASTNode caller,
                                                ASTNode child)
Overrides:Define_nameType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/SyntacticClassification.jrag at line 36
protected boolean canDefine_nameType(ASTNode caller,
                                     ASTNode child)
public TypeDecl Define_declType(ASTNode caller,
                                ASTNode child)
Overrides:Define_declType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java5/frontend/Annotations.jrag at line 601
protected boolean canDefine_declType(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_mayUseAnnotationTarget(ASTNode caller,
                                             ASTNode child,
                                             java.lang.String name)
Overrides:Define_mayUseAnnotationTarget in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java5/frontend/Annotations.jrag at line 96
protected boolean canDefine_mayUseAnnotationTarget(ASTNode caller,
                                                   ASTNode child,
                                                   java.lang.String name)
Overrides:Define_assignConvertedType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java5/frontend/GenericMethodsInference.jrag at line 58
protected boolean canDefine_assignConvertedType(ASTNode caller,
                                                ASTNode child)
public TypeDecl Define_targetType(ASTNode caller,
                                  ASTNode child)
Overrides:Define_targetType in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java8/frontend/TargetType.jrag at line 30
protected boolean canDefine_targetType(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_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)
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)
Overrides:rewriteTo in class ASTNode<ASTNode>
public int size()
public boolean isEmpty()
public boolean contains(java.lang.Object o)
public java.lang.String name()
public TypeDecl type()
public java.util.Collection<TypeDecl> throwTypes()
public boolean isParameter()
public boolean isClassVariable()
public boolean isInstanceVariable()
public boolean isMethodParameter()
public boolean isConstructorParameter()
public boolean isLocalVariable()
public boolean isFinal()
public boolean isVolatile()
public boolean isEffectivelyFinal()
public boolean isBlank()
public boolean isStatic()
public boolean isSynthetic()
public org.extendj.ast.Constant constant()

Fields

protected java.lang.String tokenString_ID
public int IDstart
public int IDend
protected java.util.Map isDAafter_Variable_values
protected java.util.Map isDUafter_Variable_values
protected boolean constant_computed
protected org.extendj.ast.Constant constant_value
protected boolean localSize_computed
protected int localSize_value
protected boolean sourceVariableDecl_computed
protected org.extendj.ast.Variable sourceVariableDecl_value
protected boolean throwTypes_computed
protected java.util.Collection<TypeDecl> throwTypes_value
protected boolean isEffectivelyFinal_computed
protected boolean isEffectivelyFinal_value
protected boolean blockIndex_computed
protected int blockIndex_value
protected boolean localNum_computed
protected int localNum_value
protected boolean enclosingLambda_computed
public static final org.extendj.ast.SimpleSet emptySet
public static final org.extendj.ast.SimpleSet fullSet

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