Search in sources :

Example 1 with ReusablesGenericBuilderAdapter

use of org.whole.lang.reusables.builders.ReusablesGenericBuilderAdapter in project whole by wholeplatform.

the class ReusablesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ReusablesGenericBuilderAdapter((IReusablesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ReusablesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ReusablesInterpreterVisitor();
            else
                return null;
        }
    });
    platform.addOperationFactory(ReusablesLanguageKit.URI, DynamicCompilerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ReusablesDynamicCompilerVisitor();
            else
                return null;
        }
    });
    platform.addOperationFactory(ReusablesLanguageKit.URI, ArtifactsGeneratorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new ReusablesArtifactsGeneratorVisitor();
        }
    });
// platform.addReactionsHandler(ReusablesLanguageKit.URI, new ReusablesReactionsHandler());
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) ReusablesDynamicCompilerVisitor(org.whole.lang.reusables.visitors.ReusablesDynamicCompilerVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) ReusablesGenericBuilderAdapter(org.whole.lang.reusables.builders.ReusablesGenericBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ReusablesSpecificBuilderAdapter(org.whole.lang.reusables.builders.ReusablesSpecificBuilderAdapter) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ReusablesArtifactsGeneratorVisitor(org.whole.lang.reusables.visitors.ReusablesArtifactsGeneratorVisitor) IReusablesBuilder(org.whole.lang.reusables.builders.IReusablesBuilder) ReusablesInterpreterVisitor(org.whole.lang.reusables.visitors.ReusablesInterpreterVisitor)

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 IReusablesBuilder (org.whole.lang.reusables.builders.IReusablesBuilder)1 ReusablesGenericBuilderAdapter (org.whole.lang.reusables.builders.ReusablesGenericBuilderAdapter)1 ReusablesSpecificBuilderAdapter (org.whole.lang.reusables.builders.ReusablesSpecificBuilderAdapter)1 ReusablesArtifactsGeneratorVisitor (org.whole.lang.reusables.visitors.ReusablesArtifactsGeneratorVisitor)1 ReusablesDynamicCompilerVisitor (org.whole.lang.reusables.visitors.ReusablesDynamicCompilerVisitor)1 ReusablesInterpreterVisitor (org.whole.lang.reusables.visitors.ReusablesInterpreterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1