Package org.apache.sling.scripting.sightly.impl.compiler.visitor

## Class TrackingVisitor<T>

- java.lang.Object
- - org.apache.sling.scripting.sightly.impl.compiler.visitor.UniformVisitor
  - - org.apache.sling.scripting.sightly.impl.compiler.visitor.TrackingVisitor<T>

All Implemented Interfaces:
  `CommandVisitor`

Direct Known Subclasses:
  `ConstantFolding`, `DeadCodeRemoval`, `SyntheticMapRemoval`, `UnusedVariableRemoval`

    public abstract class TrackingVisitor<T>
    extends UniformVisitor

Command visitor which tracks variables in commands.

### Field Summary

Fields
`protected VariableTracker<T>` `tracker`

### Constructor Summary

Constructors
`TrackingVisitor()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract T` `assignDefault​(Command command)`
`void` `visit​(Loop.End loopEnd)` Process a `Loop.End` command.
`void` `visit​(Loop.Start loopStart)` Process a `Loop.Start` command.
`void` `visit​(VariableBinding.End variableBindingEnd)` Process a `VariableBinding.End` command.
`void` `visit​(VariableBinding.Start variableBindingStart)` Process a `VariableBinding.Start` command.

### Methods inherited from class org.apache.sling.scripting.sightly.impl.compiler.visitor.UniformVisitor

`onCommand, visit, visit, visit, visit, visit, visit, visit, visit`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### tracker

    protected final VariableTracker<T> tracker

### Constructor Detail

#### TrackingVisitor

    public TrackingVisitor()

### Method Detail

#### visit

    public void visit​(VariableBinding.Start variableBindingStart)

Description copied from interface: `CommandVisitor`
Process a `VariableBinding.Start` command.

Specified by:
  `visit` in interface `CommandVisitor`
Overrides:
  `visit` in class `UniformVisitor`
Parameters:
  `variableBindingStart` - the command

#### visit

    public void visit​(VariableBinding.End variableBindingEnd)

Description copied from interface: `CommandVisitor`
Process a `VariableBinding.End` command.

Specified by:
  `visit` in interface `CommandVisitor`
Overrides:
  `visit` in class `UniformVisitor`
Parameters:
  `variableBindingEnd` - the command

#### visit

    public void visit​(Loop.Start loopStart)

Description copied from interface: `CommandVisitor`
Process a `Loop.Start` command.

Specified by:
  `visit` in interface `CommandVisitor`
Overrides:
  `visit` in class `UniformVisitor`
Parameters:
  `loopStart` - the command

#### visit

    public void visit​(Loop.End loopEnd)

Description copied from interface: `CommandVisitor`
Process a `Loop.End` command.

Specified by:
  `visit` in interface `CommandVisitor`
Overrides:
  `visit` in class `UniformVisitor`
Parameters:
  `loopEnd` - the command

#### assignDefault

    protected abstract T assignDefault​(Command command)