## 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

    public class VariableScopeVisitor

extends ClassCodeVisitorSupport

goes through an AST and initializes the scopes

Author:
  Jochen Theodorou

Constructor Summary
`VariableScopeVisitor(SourceUnit source)`

Method Summary
`protected SourceUnit` `getSourceUnit()`
`void` `visitBlockStatement(BlockStatement block)`
`void` `visitCatchStatement(CatchStatement statement)`
`void` `visitClass(ClassNode node)`
`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` `visitMethodCallExpression(MethodCallExpression call)`
`void` `visitProperty(PropertyNode node)`
`void` `visitPropertyExpression(PropertyExpression expression)`
`void` `visitVariableExpression(VariableExpression expression)`

Methods inherited from class org.codehaus.groovy.ast.ClassCodeVisitorSupport
`addError, visitAnnotations, visitAssertStatement, visitBreakStatement, visitCaseStatement, visitClassCodeContainer, visitConstructor, visitContinueStatement, visitDoWhileLoop, visitExpressionStatement, visitIfElse, visitMethod, visitReturnStatement, visitStatement, visitSwitch, visitSynchronizedStatement, visitThrowStatement, visitTryCatchFinally, visitWhileLoop`

Methods inherited from class org.codehaus.groovy.ast.CodeVisitorSupport

`visitArgumentlistExpression, visitArrayExpression, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBooleanExpression, visitCastExpression, visitClassExpression, visitClosureListExpression, visitConstantExpression, visitGStringExpression, visitListExpression, visitListOfExpressions, visitMapEntryExpression, visitMapExpression, visitMethodPointerExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitRangeExpression, visitRegexExpression, 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`

Constructor Detail

### VariableScopeVisitor

    public VariableScopeVisitor(SourceUnit source)

Method Detail

### getSourceUnit

    protected SourceUnit getSourceUnit()

  Specified by:
    `getSourceUnit` in class `ClassCodeVisitorSupport`

### visitBlockStatement

    public void visitBlockStatement(BlockStatement block)

  Specified by:
    `visitBlockStatement` in interface `GroovyCodeVisitor`
  Overrides:
    `visitBlockStatement` in class `ClassCodeVisitorSupport`

### visitForLoop

    public void visitForLoop(ForStatement forLoop)

  Specified by:
    `visitForLoop` in interface `GroovyCodeVisitor`
  Overrides:
    `visitForLoop` in class `ClassCodeVisitorSupport`

### visitDeclarationExpression

    public void visitDeclarationExpression(DeclarationExpression expression)

  Specified by:
    `visitDeclarationExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitDeclarationExpression` in class `CodeVisitorSupport`

### visitVariableExpression

    public void visitVariableExpression(VariableExpression expression)

  Specified by:
    `visitVariableExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitVariableExpression` in class `CodeVisitorSupport`

### visitPropertyExpression

    public void visitPropertyExpression(PropertyExpression expression)

  Specified by:
    `visitPropertyExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitPropertyExpression` in class `CodeVisitorSupport`

### visitClosureExpression

    public void visitClosureExpression(ClosureExpression expression)

  Specified by:
    `visitClosureExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitClosureExpression` in class `CodeVisitorSupport`

### visitCatchStatement

    public void visitCatchStatement(CatchStatement statement)

  Specified by:
    `visitCatchStatement` in interface `GroovyCodeVisitor`
  Overrides:
    `visitCatchStatement` in class `ClassCodeVisitorSupport`

### visitFieldExpression

    public void visitFieldExpression(FieldExpression expression)

  Specified by:
    `visitFieldExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitFieldExpression` in class `CodeVisitorSupport`

### visitClass

    public void visitClass(ClassNode node)

  Specified by:
    `visitClass` in interface `GroovyClassVisitor`
  Overrides:
    `visitClass` in class `ClassCodeVisitorSupport`

### visitConstructorOrMethod

    protected void visitConstructorOrMethod(MethodNode node,
                                            boolean isConstructor)

  Overrides:
    `visitConstructorOrMethod` in class `ClassCodeVisitorSupport`

### visitMethodCallExpression

    public void visitMethodCallExpression(MethodCallExpression call)

  Specified by:
    `visitMethodCallExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitMethodCallExpression` in class `CodeVisitorSupport`

### visitConstructorCallExpression

    public void visitConstructorCallExpression(ConstructorCallExpression call)

  Specified by:
    `visitConstructorCallExpression` in interface `GroovyCodeVisitor`
  Overrides:
    `visitConstructorCallExpression` in class `CodeVisitorSupport`

### visitProperty

    public void visitProperty(PropertyNode node)

  Specified by:
    `visitProperty` in interface `GroovyClassVisitor`
  Overrides:
    `visitProperty` in class `ClassCodeVisitorSupport`

### visitField

    public void visitField(FieldNode node)

  Specified by:
    `visitField` in interface `GroovyClassVisitor`
  Overrides:
    `visitField` in class `ClassCodeVisitorSupport`

Copyright © 2003-2008 The Codehaus. All rights reserved.