Search in sources :

Example 16 with IBuilderFactory

use of org.whole.lang.builders.IBuilderFactory in project whole by wholeplatform.

the class SchemeLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SchemeGenericBuilderAdapter((ISchemeBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(SchemeLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new SchemeInterpreterVisitor((InterpreterOperation) operation);
            else
                return null;
        }
    });
    platform.addEditorKit(SchemeTextualEditorKit.ID);
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) SchemeGenericBuilderAdapter(org.whole.lang.scheme.builders.SchemeGenericBuilderAdapter) SchemeSpecificBuilderAdapter(org.whole.lang.scheme.builders.SchemeSpecificBuilderAdapter) ISchemeBuilder(org.whole.lang.scheme.builders.ISchemeBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) SchemeInterpreterVisitor(org.whole.lang.scheme.visitors.SchemeInterpreterVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory)

Example 17 with IBuilderFactory

use of org.whole.lang.builders.IBuilderFactory 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 18 with IBuilderFactory

use of org.whole.lang.builders.IBuilderFactory in project whole by wholeplatform.

the class ActionsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ActionsGenericBuilderAdapter((IActionsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ActionsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ActionsDynamicCompilerVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ActionsGenericBuilderAdapter(org.whole.lang.actions.builders.ActionsGenericBuilderAdapter) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ActionsInterpreterVisitor(org.whole.lang.actions.visitors.ActionsInterpreterVisitor) IActionsBuilder(org.whole.lang.actions.builders.IActionsBuilder) ActionsSpecificBuilderAdapter(org.whole.lang.actions.builders.ActionsSpecificBuilderAdapter) ActionsDynamicCompilerVisitor(org.whole.lang.actions.visitors.ActionsDynamicCompilerVisitor)

Example 19 with IBuilderFactory

use of org.whole.lang.builders.IBuilderFactory in project whole by wholeplatform.

the class PojoLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PojoGenericBuilderAdapter((IPojoBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(PojoLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PojoSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(PojoLanguageKit.URI, NormalizerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new PojoNormalizerVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PojoSpecificBuilderAdapter(org.whole.lang.pojo.builders.PojoSpecificBuilderAdapter) IPojoBuilder(org.whole.lang.pojo.builders.IPojoBuilder) IVisitor(org.whole.lang.visitors.IVisitor) PojoNormalizerVisitor(org.whole.lang.pojo.visitors.PojoNormalizerVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) PojoGenericBuilderAdapter(org.whole.lang.pojo.builders.PojoGenericBuilderAdapter) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory)

Example 20 with IBuilderFactory

use of org.whole.lang.builders.IBuilderFactory 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)

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