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
Initializes the variable scopes for an AST.
-
Constructor Summary
ConstructorDescriptionVariableScopeVisitor
(SourceUnit source) VariableScopeVisitor
(SourceUnit source, boolean recurseInnerClasses) -
Method Summary
Modifier and TypeMethodDescriptionprotected SourceUnit
void
prepareVisit
(ClassNode node) Sets the current class node context.void
visitBinaryExpression
(BinaryExpression expression) void
visitBlockStatement
(BlockStatement statement) void
visitCatchStatement
(CatchStatement statement) void
visitClass
(ClassNode node) Visit a ClassNode.void
visitClosureExpression
(ClosureExpression expression) void
protected void
visitConstructorOrMethod
(MethodNode node, boolean isConstructor) void
visitDeclarationExpression
(DeclarationExpression expression) void
visitField
(FieldNode node) Visit a FieldNode.void
visitFieldExpression
(FieldExpression expression) void
visitForLoop
(ForStatement statement) void
visitIfElse
(IfStatement statement) void
visitMethodCallExpression
(MethodCallExpression expression) void
visitProperty
(PropertyNode node) Visit a PropertyNode.void
visitPropertyExpression
(PropertyExpression expression) void
visitVariableExpression
(VariableExpression expression) Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
addError, visitAnnotation, visitAnnotations, 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
visit, visit, visitEmptyExpression, visitListOfExpressions
-
Constructor Details
-
VariableScopeVisitor
-
VariableScopeVisitor
-
-
Method Details
-
getSourceUnit
- Specified by:
getSourceUnit
in classClassCodeVisitorSupport
-
prepareVisit
Sets the current class node context. -
visitClass
Description copied from interface:GroovyClassVisitor
Visit a ClassNode.- Specified by:
visitClass
in interfaceGroovyClassVisitor
- Overrides:
visitClass
in classClassCodeVisitorSupport
-
visitField
Description copied from interface:GroovyClassVisitor
Visit a FieldNode.- Specified by:
visitField
in interfaceGroovyClassVisitor
- Overrides:
visitField
in classClassCodeVisitorSupport
-
visitProperty
Description copied from interface:GroovyClassVisitor
Visit a PropertyNode.- Specified by:
visitProperty
in interfaceGroovyClassVisitor
- Overrides:
visitProperty
in classClassCodeVisitorSupport
-
visitConstructorOrMethod
- Overrides:
visitConstructorOrMethod
in classClassCodeVisitorSupport
-
visitBlockStatement
- Specified by:
visitBlockStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitBlockStatement
in classClassCodeVisitorSupport
-
visitCatchStatement
- Specified by:
visitCatchStatement
in interfaceGroovyCodeVisitor
- Overrides:
visitCatchStatement
in classClassCodeVisitorSupport
-
visitForLoop
- Specified by:
visitForLoop
in interfaceGroovyCodeVisitor
- Overrides:
visitForLoop
in classClassCodeVisitorSupport
-
visitIfElse
- Specified by:
visitIfElse
in interfaceGroovyCodeVisitor
- Overrides:
visitIfElse
in classClassCodeVisitorSupport
-
visitBinaryExpression
- Specified by:
visitBinaryExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitBinaryExpression
in classCodeVisitorSupport
-
visitClosureExpression
- Specified by:
visitClosureExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitClosureExpression
in classCodeVisitorSupport
-
visitConstructorCallExpression
- Specified by:
visitConstructorCallExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitConstructorCallExpression
in classCodeVisitorSupport
-
visitDeclarationExpression
- Specified by:
visitDeclarationExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitDeclarationExpression
in classClassCodeVisitorSupport
-
visitFieldExpression
- Specified by:
visitFieldExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitFieldExpression
in classCodeVisitorSupport
-
visitMethodCallExpression
- Specified by:
visitMethodCallExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitMethodCallExpression
in classCodeVisitorSupport
-
visitPropertyExpression
- Specified by:
visitPropertyExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitPropertyExpression
in classCodeVisitorSupport
-
visitVariableExpression
- Specified by:
visitVariableExpression
in interfaceGroovyCodeVisitor
- Overrides:
visitVariableExpression
in classCodeVisitorSupport
-