Search in sources :

Example 1 with MiscSpecificBuilderAdapter

use of org.whole.lang.misc.builders.MiscSpecificBuilderAdapter in project whole by wholeplatform.

the class MiscLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new MiscGenericBuilderAdapter((IMiscBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new MiscSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, ArtifactsGeneratorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, NormalizerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscOperationVisitor();
        }
    });
    platform.addOperationFactory(MiscLanguageKit.URI, DynamicCompilerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new MiscDynamicCompilerVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) MiscDynamicCompilerVisitor(org.whole.lang.misc.visitors.MiscDynamicCompilerVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IMiscBuilder(org.whole.lang.misc.builders.IMiscBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) MiscGenericBuilderAdapter(org.whole.lang.misc.builders.MiscGenericBuilderAdapter) MiscSpecificBuilderAdapter(org.whole.lang.misc.builders.MiscSpecificBuilderAdapter) MiscOperationVisitor(org.whole.lang.misc.visitors.MiscOperationVisitor)

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IMiscBuilder (org.whole.lang.misc.builders.IMiscBuilder)1 MiscGenericBuilderAdapter (org.whole.lang.misc.builders.MiscGenericBuilderAdapter)1 MiscSpecificBuilderAdapter (org.whole.lang.misc.builders.MiscSpecificBuilderAdapter)1 MiscDynamicCompilerVisitor (org.whole.lang.misc.visitors.MiscDynamicCompilerVisitor)1 MiscOperationVisitor (org.whole.lang.misc.visitors.MiscOperationVisitor)1 IOperation (org.whole.lang.operations.IOperation)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1