Package org.codehaus.groovy.classgen
Class VariableScopeVisitor
- java.lang.Object
-
- org.codehaus.groovy.ast.CodeVisitorSupport
-
- org.codehaus.groovy.ast.ClassCodeVisitorSupport
-
- org.codehaus.groovy.classgen.VariableScopeVisitor
-
- All Implemented Interfaces:
GroovyClassVisitor
,GroovyCodeVisitor
,ErrorCollecting
public class VariableScopeVisitor extends ClassCodeVisitorSupport
Initializes the variable scopes for an AST.
-
-
Constructor Summary
Constructors Constructor Description VariableScopeVisitor(SourceUnit source)
VariableScopeVisitor(SourceUnit source, boolean recurseInnerClasses)
-
Method Summary
-
Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, visitAssertStatement, visitBreakStatement, visitCaseStatement, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop
-
Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport
afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitBytecodeExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitEmptyStatement, visitGStringExpression, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitRangeExpression, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitTernaryExpression, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.groovy.ast.GroovyCodeVisitor
visitEmptyExpression, visitListOfExpressions
-
-
-
-
Constructor Detail
-
VariableScopeVisitor
public VariableScopeVisitor(SourceUnit source, boolean recurseInnerClasses)
-
VariableScopeVisitor
public VariableScopeVisitor(SourceUnit source)
-
-
Method Detail
-
getSourceUnit
protected SourceUnit getSourceUnit()
- Specified by:
getSourceUnit
in classClassCodeVisitorSupport
-
prepareVisit
public void prepareVisit(ClassNode node)
Sets the current class node context.
-
visitClass
public void visitClass(ClassNode node)
Description copied from interface:GroovyClassVisitor
Visit a ClassNode.- Specified by:
visitClass
in interfaceGroovyClassVisitor
- Overrides:
visitClass
in classClassCodeVisitorSupport
-
visitField
public void visitField(FieldNode node)
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitProperty
public void visitProperty(PropertyNode node)
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitConstructorOrMethod
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)
- Overrides:
visitConstructorOrMethod
in classClassCodeVisitorSupport
-
visitBlockStatement
public void visitBlockStatement(BlockStatement statement)
- Specified by:
visitBlockStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitBlockStatement
in classClassCodeVisitorSupport
-
visitCatchStatement
public void visitCatchStatement(CatchStatement statement)
- Specified by:
visitCatchStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCatchStatement
in classClassCodeVisitorSupport
-
visitForLoop
public void visitForLoop(ForStatement statement)
- Specified by:
visitForLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitForLoop
in classClassCodeVisitorSupport
-
visitIfElse
public void visitIfElse(IfStatement statement)
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitBinaryExpression
public void visitBinaryExpression(BinaryExpression expression)
- Specified by:
visitBinaryExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitBinaryExpression
in classCodeVisitorSupport
-
visitClosureExpression
public void visitClosureExpression(ClosureExpression expression)
- Specified by:
visitClosureExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitClosureExpression
in classCodeVisitorSupport
-
visitConstructorCallExpression
public void visitConstructorCallExpression(ConstructorCallExpression expression)
- Specified by:
visitConstructorCallExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitConstructorCallExpression
in classCodeVisitorSupport
-
visitDeclarationExpression
public void visitDeclarationExpression(DeclarationExpression expression)
- Specified by:
visitDeclarationExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitDeclarationExpression
in classClassCodeVisitorSupport
-
visitFieldExpression
public void visitFieldExpression(FieldExpression expression)
- Specified by:
visitFieldExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitFieldExpression
in classCodeVisitorSupport
-
visitMethodCallExpression
public void visitMethodCallExpression(MethodCallExpression expression)
- Specified by:
visitMethodCallExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitMethodCallExpression
in classCodeVisitorSupport
-
visitPropertyExpression
public void visitPropertyExpression(PropertyExpression expression)
- Specified by:
visitPropertyExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPropertyExpression
in classCodeVisitorSupport
-
visitVariableExpression
public void visitVariableExpression(VariableExpression expression)
- Specified by:
visitVariableExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitVariableExpression
in classCodeVisitorSupport
-
-