Search in sources :

Example 1 with EnvironmentPrettyPrinterVisitor

use of org.whole.lang.environment.visitors.EnvironmentPrettyPrinterVisitor in project whole by wholeplatform.

the class EnvironmentLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new EnvironmentGenericBuilderAdapter((IEnvironmentBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(EnvironmentLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            return stage == 0 ? new EnvironmentInterpreterVisitor() : null;
        }
    });
    platform.addOperationFactory(EnvironmentLanguageKit.URI, ArtifactsGeneratorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return stage == 0 ? new EnvironmentInterpreterVisitor() : null;
        }
    });
    platform.addOperationFactory(EnvironmentLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new EnvironmentPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) EnvironmentPrettyPrinterVisitor(org.whole.lang.environment.visitors.EnvironmentPrettyPrinterVisitor) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) EnvironmentInterpreterVisitor(org.whole.lang.environment.visitors.EnvironmentInterpreterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) EnvironmentGenericBuilderAdapter(org.whole.lang.environment.builders.EnvironmentGenericBuilderAdapter) EnvironmentSpecificBuilderAdapter(org.whole.lang.environment.builders.EnvironmentSpecificBuilderAdapter) IEnvironmentBuilder(org.whole.lang.environment.builders.IEnvironmentBuilder)

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 EnvironmentGenericBuilderAdapter (org.whole.lang.environment.builders.EnvironmentGenericBuilderAdapter)1 EnvironmentSpecificBuilderAdapter (org.whole.lang.environment.builders.EnvironmentSpecificBuilderAdapter)1 IEnvironmentBuilder (org.whole.lang.environment.builders.IEnvironmentBuilder)1 EnvironmentInterpreterVisitor (org.whole.lang.environment.visitors.EnvironmentInterpreterVisitor)1 EnvironmentPrettyPrinterVisitor (org.whole.lang.environment.visitors.EnvironmentPrettyPrinterVisitor)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1