Search in sources :

Example 6 with IEntityContext

use of org.whole.lang.contexts.IEntityContext in project whole by wholeplatform.

the class TemplatesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TemplatesGenericBuilderAdapter((ITemplatesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TemplatesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TemplatesSpecificBuilderAdapter(strategy, entityContext);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IEntityContext(org.whole.lang.contexts.IEntityContext) TemplatesGenericBuilderAdapter(org.whole.lang.templates.builders.TemplatesGenericBuilderAdapter) ITemplatesBuilder(org.whole.lang.templates.builders.ITemplatesBuilder) TemplatesSpecificBuilderAdapter(org.whole.lang.templates.builders.TemplatesSpecificBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory)

Example 7 with IEntityContext

use of org.whole.lang.contexts.IEntityContext in project whole by wholeplatform.

the class SyntaxTreesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SyntaxTreesGenericBuilderAdapter((ISyntaxTreesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(SyntaxTreesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SyntaxTreesSpecificBuilderAdapter(strategy, entityContext);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ISyntaxTreesBuilder(org.whole.lang.syntaxtrees.builders.ISyntaxTreesBuilder) SyntaxTreesSpecificBuilderAdapter(org.whole.lang.syntaxtrees.builders.SyntaxTreesSpecificBuilderAdapter) SyntaxTreesGenericBuilderAdapter(org.whole.lang.syntaxtrees.builders.SyntaxTreesGenericBuilderAdapter)

Example 8 with IEntityContext

use of org.whole.lang.contexts.IEntityContext in project whole by wholeplatform.

the class TestEntitiesLanguageDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    if (ReflectionFactory.getLanguageKitRegistry().containsResource(TestEntitiesLanguageKit.URI, false, null))
        return;
    platform.addLanguageKit(new TestEntitiesLanguageKit());
    platform.addOperationFactory(TestEntitiesLanguageKit.URI, GenericBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TestEntitiesGenericBuilderAdapter((ITestEntitiesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TestEntitiesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TestEntitiesSpecificBuilderAdapter(strategy, entityContext);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IEntityContext(org.whole.lang.contexts.IEntityContext) TestEntitiesSpecificBuilderAdapter(org.whole.lang.testentities.builders.TestEntitiesSpecificBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ITestEntitiesBuilder(org.whole.lang.testentities.builders.ITestEntitiesBuilder) TestEntitiesGenericBuilderAdapter(org.whole.lang.testentities.builders.TestEntitiesGenericBuilderAdapter)

Example 9 with IEntityContext

use of org.whole.lang.contexts.IEntityContext 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 10 with IEntityContext

use of org.whole.lang.contexts.IEntityContext in project whole by wholeplatform.

the class XsdLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new XsdGenericBuilderAdapter((IXsdBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(XsdLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new XsdSpecificBuilderAdapter(strategy, entityContext);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IEntityContext(org.whole.lang.contexts.IEntityContext) XsdSpecificBuilderAdapter(org.whole.lang.xsd.builders.XsdSpecificBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) XsdGenericBuilderAdapter(org.whole.lang.xsd.builders.XsdGenericBuilderAdapter) IXsdBuilder(org.whole.lang.xsd.builders.IXsdBuilder)

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)42 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)42 IEntityContext (org.whole.lang.contexts.IEntityContext)42 IOperation (org.whole.lang.operations.IOperation)20 IVisitor (org.whole.lang.visitors.IVisitor)20 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)20 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)11 IRedBlackTreeBuilder (org.whole.examples.datatypes.redblacktree.builders.IRedBlackTreeBuilder)1 RedBlackTreeGenericBuilderAdapter (org.whole.examples.datatypes.redblacktree.builders.RedBlackTreeGenericBuilderAdapter)1 RedBlackTreeSpecificBuilderAdapter (org.whole.examples.datatypes.redblacktree.builders.RedBlackTreeSpecificBuilderAdapter)1 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 ActionsGenericBuilderAdapter (org.whole.lang.actions.builders.ActionsGenericBuilderAdapter)1