Groovy Documentation

## org.codehaus.groovy.classgen
[Java] Class VariableScopeVisitor

    java.lang.Object
      org.codehaus.groovy.ast.CodeVisitorSupport
          org.codehaus.groovy.ast.ClassCodeVisitorSupport
              org.codehaus.groovy.classgen.VariableScopeVisitor

    public class VariableScopeVisitor
    extends ClassCodeVisitorSupport

goes through an AST and initializes the scopes

Authors:
  Jochen Theodorou

Method Summary
`java.lang.Object` | `VariableScopeVisitor(SourceUnit source)`
`protected SourceUnit` | `getSourceUnit()`
`void` | `prepareVisit(ClassNode node)`
`void` | `visitAnnotations(AnnotatedNode node)`
`void` | `visitBinaryExpression(BinaryExpression be)`
`void` | `visitBlockStatement(BlockStatement block)`
`void` | `visitCatchStatement(CatchStatement statement)`
`void` | `visitClass(ClassNode node)` Setup the current class node context.
`void` | `visitClosureExpression(ClosureExpression expression)`
`void` | `visitConstructorCallExpression(ConstructorCallExpression call)`
`protected void` | `visitConstructorOrMethod(MethodNode node, boolean isConstructor)`
`void` | `visitDeclarationExpression(DeclarationExpression expression)`
`void` | `visitField(FieldNode node)`
`void` | `visitFieldExpression(FieldExpression expression)`
`void` | `visitForLoop(ForStatement forLoop)`
`void` | `visitIfElse(IfStatement ifElse)`
`void` | `visitMethodCallExpression(MethodCallExpression call)`
`void` | `visitProperty(PropertyNode node)`
`void` | `visitPropertyExpression(PropertyExpression expression)`
`void` | `visitVariableExpression(VariableExpression expression)`

Methods inherited from class ClassCodeVisitorSupport

addError, getSourceUnit, visitAnnotations, visitAssertStatement, visitBlockStatement, visitBreakStatement, visitCaseStatement, visitCatchStatement, visitClass, visitClassCodeContainer, visitConstructor, visitConstructorOrMethod, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitExpressionStatement, visitField, visitForLoop, visitIfElse, visitImports, visitMethod, visitObjectInitializerStatements, visitPackage, visitProperty, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop

Methods inherited from class CodeVisitorSupport

visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Method Detail

### VariableScopeVisitor

    public java.lang.Object VariableScopeVisitor(SourceUnit source)

### getSourceUnit

    protected SourceUnit getSourceUnit()

### prepareVisit

    public void prepareVisit(ClassNode node)

### visitAnnotations

    public void visitAnnotations(AnnotatedNode node)

### visitBinaryExpression

    break;
    public void visitBinaryExpression(BinaryExpression be)

### visitBlockStatement

    public void visitBlockStatement(BlockStatement block)

### visitCatchStatement

    public void visitCatchStatement(CatchStatement statement)

### visitClass

    public void visitClass(ClassNode node)

  Setup the current class node context.
  Parameters:
    node

### visitClosureExpression

    public void visitClosureExpression(ClosureExpression expression)

### visitConstructorCallExpression

    public void visitConstructorCallExpression(ConstructorCallExpression call)

### visitConstructorOrMethod

    protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor)

### visitDeclarationExpression

    public void visitDeclarationExpression(DeclarationExpression expression)

### visitField

    public void visitField(FieldNode node)

### visitFieldExpression

    public void visitFieldExpression(FieldExpression expression)

### visitForLoop

    public void visitForLoop(ForStatement forLoop)

### visitIfElse

    public void visitIfElse(IfStatement ifElse)

### visitMethodCallExpression

    public void visitMethodCallExpression(MethodCallExpression call)

### visitProperty

    public void visitProperty(PropertyNode node)

### visitPropertyExpression

    public void visitPropertyExpression(PropertyExpression expression)

### visitVariableExpression

    public void visitVariableExpression(VariableExpression expression)

Groovy Documentation