Search in sources :

Example 1 with CommandVisitorHandler

use of org.apache.sling.scripting.sightly.java.compiler.impl.CommandVisitorHandler in project sling by apache.

the class GlobalShadowCheckBackendCompiler method handle.

@Override
public void handle(CommandStream stream) {
    stream.addHandler(new CommandVisitorHandler(new GlobalShadowChecker(globals)));
    baseBackend.handle(stream);
}
Also used : CommandVisitorHandler(org.apache.sling.scripting.sightly.java.compiler.impl.CommandVisitorHandler) GlobalShadowChecker(org.apache.sling.scripting.sightly.java.compiler.impl.GlobalShadowChecker)

Example 2 with CommandVisitorHandler

use of org.apache.sling.scripting.sightly.java.compiler.impl.CommandVisitorHandler in project sling by apache.

the class JavaClassBackendCompiler method handle.

@Override
public void handle(CommandStream stream) {
    StatefulVisitor statefulVisitor = new StatefulVisitor();
    final CodeGenVisitor visitor = new CodeGenVisitor(unitBuilder, statefulVisitor.getControl());
    statefulVisitor.initializeWith(visitor);
    stream.addHandler(new CommandVisitorHandler(statefulVisitor) {

        @Override
        public void onDone() {
            super.onDone();
            visitor.finish();
        }
    });
}
Also used : CommandVisitorHandler(org.apache.sling.scripting.sightly.java.compiler.impl.CommandVisitorHandler) StatefulVisitor(org.apache.sling.scripting.sightly.compiler.commands.StatefulVisitor) CodeGenVisitor(org.apache.sling.scripting.sightly.java.compiler.impl.CodeGenVisitor)

Aggregations

CommandVisitorHandler (org.apache.sling.scripting.sightly.java.compiler.impl.CommandVisitorHandler)2 StatefulVisitor (org.apache.sling.scripting.sightly.compiler.commands.StatefulVisitor)1 CodeGenVisitor (org.apache.sling.scripting.sightly.java.compiler.impl.CodeGenVisitor)1 GlobalShadowChecker (org.apache.sling.scripting.sightly.java.compiler.impl.GlobalShadowChecker)1