Package org.apache.sling.scripting.sightly.impl.compiler.optimization.reduce

## Class ConstantFolding

- java.lang.Object
- - org.apache.sling.scripting.sightly.impl.compiler.visitor.UniformVisitor
  - - org.apache.sling.scripting.sightly.impl.compiler.visitor.TrackingVisitor<EvalResult>
    - - org.apache.sling.scripting.sightly.impl.compiler.optimization.reduce.ConstantFolding

All Implemented Interfaces:
  `CommandVisitor`, `EmitterVisitor`

    public final class ConstantFolding
    extends TrackingVisitor<EvalResult>
    implements EmitterVisitor

Optimization which evaluates constant expressions during compilation-time

### Field Summary

### Fields inherited from class org.apache.sling.scripting.sightly.impl.compiler.visitor.TrackingVisitor

`tracker`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected EvalResult` `assignDefault​(Command command)`
`PushStream` `getOutputStream()` Get the output stream
`protected void` `onCommand​(Command command)`
`static StreamTransformer` `transformer()`
`void` `visit​(VariableBinding.Start variableBindingStart)` Process a `VariableBinding.Start` command.

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

`visit, visit, visit`

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

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

### Methods inherited from interface org.apache.sling.scripting.sightly.compiler.commands.CommandVisitor

`visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit`

### Method Detail

#### transformer

    public static StreamTransformer transformer()

#### 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 `TrackingVisitor<EvalResult>`
Parameters:
  `variableBindingStart` - the command

#### assignDefault

    protected EvalResult assignDefault​(Command command)

Specified by:
  `assignDefault` in class `TrackingVisitor<EvalResult>`

#### onCommand

    protected void onCommand​(Command command)

Specified by:
  `onCommand` in class `UniformVisitor`

#### getOutputStream

    public PushStream getOutputStream()

Description copied from interface: `EmitterVisitor`
Get the output stream

Specified by:
  `getOutputStream` in interface `EmitterVisitor`
Returns:
  the output stream of this visitor