Search in sources :

Example 1 with ScriptsSpecificBuilderAdapter

use of org.whole.lang.scripts.builders.ScriptsSpecificBuilderAdapter in project whole by wholeplatform.

the class ScriptsLanguageDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addLanguageKit(new ScriptsLanguageKit());
    platform.addOperationFactory(ScriptsLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ScriptsGenericBuilderAdapter((IScriptsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ScriptsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ScriptsSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(ScriptsLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ScriptsInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) ScriptsGenericBuilderAdapter(org.whole.lang.scripts.builders.ScriptsGenericBuilderAdapter) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IScriptsBuilder(org.whole.lang.scripts.builders.IScriptsBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ScriptsInterpreterVisitor(org.whole.lang.scripts.visitors.ScriptsInterpreterVisitor) ScriptsSpecificBuilderAdapter(org.whole.lang.scripts.builders.ScriptsSpecificBuilderAdapter)

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IOperation (org.whole.lang.operations.IOperation)1 IScriptsBuilder (org.whole.lang.scripts.builders.IScriptsBuilder)1 ScriptsGenericBuilderAdapter (org.whole.lang.scripts.builders.ScriptsGenericBuilderAdapter)1 ScriptsSpecificBuilderAdapter (org.whole.lang.scripts.builders.ScriptsSpecificBuilderAdapter)1 ScriptsInterpreterVisitor (org.whole.lang.scripts.visitors.ScriptsInterpreterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1