Search in sources :

Example 1 with PrettyPrinterOperation

use of org.whole.lang.operations.PrettyPrinterOperation in project whole by wholeplatform.

the class ModelsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ModelsGenericBuilderAdapter((IModelsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ModelsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ModelsSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(ModelsLanguageKit.URI, ExportTexOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new TeXGeneratorVisitor((ExportTexOperation) operation);
        }
    });
    platform.addOperationFactory(ModelsLanguageKit.URI, PrettyPrinterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new ModelsPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addOperationFactory(ModelsLanguageKit.URI, ValidatorOperation.ID, new IVisitorFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new ModelsNormalizerVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) TeXGeneratorVisitor(org.whole.lang.models.visitors.TeXGeneratorVisitor) IModelsBuilder(org.whole.lang.models.builders.IModelsBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ModelsSpecificBuilderAdapter(org.whole.lang.models.builders.ModelsSpecificBuilderAdapter) ModelsPrettyPrinterVisitor(org.whole.lang.models.visitors.ModelsPrettyPrinterVisitor) ExportTexOperation(org.whole.lang.operations.ExportTexOperation) ModelsGenericBuilderAdapter(org.whole.lang.models.builders.ModelsGenericBuilderAdapter) ModelsInterpreterVisitor(org.whole.lang.models.visitors.ModelsInterpreterVisitor) ModelsNormalizerVisitor(org.whole.lang.models.visitors.ModelsNormalizerVisitor) ModelsValidatorVisitor(org.whole.lang.models.visitors.ModelsValidatorVisitor)

Example 2 with PrettyPrinterOperation

use of org.whole.lang.operations.PrettyPrinterOperation in project whole by wholeplatform.

the class TestsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TestsGenericBuilderAdapter((ITestsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TestsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new TestsContentAssistVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) TestsLearningInterpreterVisitor(org.whole.lang.tests.visitors.TestsLearningInterpreterVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) ITestsBuilder(org.whole.lang.tests.builders.ITestsBuilder) TestsSpecificBuilderAdapter(org.whole.lang.tests.builders.TestsSpecificBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) TestsContentAssistVisitor(org.whole.lang.tests.visitors.TestsContentAssistVisitor) TestsGenericBuilderAdapter(org.whole.lang.tests.builders.TestsGenericBuilderAdapter) TestsPrettyPrinterVisitor(org.whole.lang.tests.visitors.TestsPrettyPrinterVisitor)

Example 3 with PrettyPrinterOperation

use of org.whole.lang.operations.PrettyPrinterOperation in project whole by wholeplatform.

the class ImpLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ImpGenericBuilderAdapter((IImpBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ImpLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

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

        public IVisitor create(IOperation operation, int stage) {
            return ImpTraversalFactory.instance.topDown(ImpTraversalFactory.instance.sequence(new ImpResolverValidatorVisitor((ValidatorOperation) operation), new ImpDefUseValidatorVisitor((ValidatorOperation) operation)), false);
        }
    });
    platform.addOperationFactory(ImpLanguageKit.URI, BytecodeGeneratorOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new ImpBytecodeGeneratorVisitor((BytecodeGeneratorOperation) operation);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ValidatorOperation(org.whole.lang.operations.ValidatorOperation) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ImpResolverValidatorVisitor(org.whole.examples.lang.imp.visitors.ImpResolverValidatorVisitor) ImpGenericBuilderAdapter(org.whole.examples.lang.imp.builders.ImpGenericBuilderAdapter) ImpSpecificBuilderAdapter(org.whole.examples.lang.imp.builders.ImpSpecificBuilderAdapter) BytecodeGeneratorOperation(org.whole.examples.lang.imp.visitors.BytecodeGeneratorOperation) ImpBytecodeGeneratorVisitor(org.whole.examples.lang.imp.visitors.ImpBytecodeGeneratorVisitor) IImpBuilder(org.whole.examples.lang.imp.builders.IImpBuilder) ImpDefUseValidatorVisitor(org.whole.examples.lang.imp.visitors.ImpDefUseValidatorVisitor) ImpInterpreterVisitor(org.whole.examples.lang.imp.visitors.ImpInterpreterVisitor) ImpPrettyPrinterVisitor(org.whole.examples.lang.imp.visitors.ImpPrettyPrinterVisitor)

Example 4 with PrettyPrinterOperation

use of org.whole.lang.operations.PrettyPrinterOperation in project whole by wholeplatform.

the class SQLLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SQLGenericBuilderAdapter((ISQLBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(SQLLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new SQLInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) SQLInterpreterVisitor(org.whole.lang.sql.visitors.SQLInterpreterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) SQLSpecificBuilderAdapter(org.whole.lang.sql.builders.SQLSpecificBuilderAdapter) SQLPrettyPrinterVisitor(org.whole.lang.sql.visitors.SQLPrettyPrinterVisitor) ISQLBuilder(org.whole.lang.sql.builders.ISQLBuilder) SQLGenericBuilderAdapter(org.whole.lang.sql.builders.SQLGenericBuilderAdapter)

Example 5 with PrettyPrinterOperation

use of org.whole.lang.operations.PrettyPrinterOperation in project whole by wholeplatform.

the class PropertiesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PropertiesGenericBuilderAdapter((IPropertiesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(PropertiesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new PropertiesInterpreterVisitor();
            else
                return null;
        }
    });
    platform.addPersistenceKit("org.whole.lang.properties.PropertiesTextEditor", PropertiesTextPersistenceKit.instance());
    platform.addPersistenceKit("org.whole.lang.properties.PropertiesXmlEditor", PropertiesXmlPersistenceKit.instance());
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) PropertiesPrettyPrinterVisitor(org.whole.lang.properties.visitors.PropertiesPrettyPrinterVisitor) PropertiesSpecificBuilderAdapter(org.whole.lang.properties.builders.PropertiesSpecificBuilderAdapter) PropertiesInterpreterVisitor(org.whole.lang.properties.visitors.PropertiesInterpreterVisitor) PropertiesGenericBuilderAdapter(org.whole.lang.properties.builders.PropertiesGenericBuilderAdapter) IPropertiesBuilder(org.whole.lang.properties.builders.IPropertiesBuilder)

Aggregations

IOperation (org.whole.lang.operations.IOperation)13 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)13 IVisitor (org.whole.lang.visitors.IVisitor)13 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)13 IBuilder (org.whole.lang.builders.IBuilder)11 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)11 IEntityContext (org.whole.lang.contexts.IEntityContext)11 IImpBuilder (org.whole.examples.lang.imp.builders.IImpBuilder)1 ImpGenericBuilderAdapter (org.whole.examples.lang.imp.builders.ImpGenericBuilderAdapter)1 ImpSpecificBuilderAdapter (org.whole.examples.lang.imp.builders.ImpSpecificBuilderAdapter)1 BytecodeGeneratorOperation (org.whole.examples.lang.imp.visitors.BytecodeGeneratorOperation)1 ImpBytecodeGeneratorVisitor (org.whole.examples.lang.imp.visitors.ImpBytecodeGeneratorVisitor)1 ImpDefUseValidatorVisitor (org.whole.examples.lang.imp.visitors.ImpDefUseValidatorVisitor)1 ImpInterpreterVisitor (org.whole.examples.lang.imp.visitors.ImpInterpreterVisitor)1 ImpPrettyPrinterVisitor (org.whole.examples.lang.imp.visitors.ImpPrettyPrinterVisitor)1 ImpResolverValidatorVisitor (org.whole.examples.lang.imp.visitors.ImpResolverValidatorVisitor)1 ClasspathPersistenceProvider (org.whole.lang.codebase.ClasspathPersistenceProvider)1 CommonsGenericBuilderAdapter (org.whole.lang.commons.builders.CommonsGenericBuilderAdapter)1 CommonsSpecificBuilderAdapter (org.whole.lang.commons.builders.CommonsSpecificBuilderAdapter)1 ICommonsBuilder (org.whole.lang.commons.builders.ICommonsBuilder)1