Search in sources :

Example 31 with IBuilder

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

the class JSONLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new JSONGenericBuilderAdapter((IJSONBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(JSONLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new JSONSpecificBuilderAdapter(strategy, entityContext);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) JSONSpecificBuilderAdapter(org.whole.lang.json.builders.JSONSpecificBuilderAdapter) IJSONBuilder(org.whole.lang.json.builders.IJSONBuilder) IEntityContext(org.whole.lang.contexts.IEntityContext) JSONGenericBuilderAdapter(org.whole.lang.json.builders.JSONGenericBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory)

Example 32 with IBuilder

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

the class XmlLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new XmlGenericBuilderAdapter((IXmlBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(XmlLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new XmlNormalizerVisitor();
        }
    });
    platform.addPersistenceKit("org.whole.lang.xml.XmlBuilderEditor", XmlBuilderPersistenceKit.instance());
    platform.addPersistenceKit("org.whole.lang.xml.XmlSourceEditor", XmlSourcePersistenceKit.instance());
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) XmlNormalizerVisitor(org.whole.lang.xml.visitors.XmlNormalizerVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) XmlGenericBuilderAdapter(org.whole.lang.xml.builders.XmlGenericBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) XmlPrettyPrinterVisitor(org.whole.lang.xml.visitors.XmlPrettyPrinterVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) XmlSpecificBuilderAdapter(org.whole.lang.xml.builders.XmlSpecificBuilderAdapter) IXmlBuilder(org.whole.lang.xml.builders.IXmlBuilder)

Example 33 with IBuilder

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

the class ScriptsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ScriptsGenericBuilderAdapter((IScriptsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ScriptsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ScriptsInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) ScriptsGenericBuilderAdapter(org.whole.lang.scripts.builders.ScriptsGenericBuilderAdapter) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IScriptsBuilder(org.whole.lang.scripts.builders.IScriptsBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ScriptsInterpreterVisitor(org.whole.lang.scripts.visitors.ScriptsInterpreterVisitor) ScriptsSpecificBuilderAdapter(org.whole.lang.scripts.builders.ScriptsSpecificBuilderAdapter)

Example 34 with IBuilder

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

the class ArtifactsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ArtifactsGenericBuilderAdapter((IArtifactsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ArtifactsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ArtifactsSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(ArtifactsLanguageKit.URI, ArtifactsGeneratorOperation.ID, new IVisitorFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ArtifactsInterpreterVisitor();
            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) ResourceArtifactsGeneratorVisitor(org.whole.lang.artifacts.visitors.ResourceArtifactsGeneratorVisitor) ArtifactsGenericBuilderAdapter(org.whole.lang.artifacts.builders.ArtifactsGenericBuilderAdapter) ArtifactsInterpreterVisitor(org.whole.lang.artifacts.visitors.ArtifactsInterpreterVisitor) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IArtifactsBuilder(org.whole.lang.artifacts.builders.IArtifactsBuilder) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ArtifactsSpecificBuilderAdapter(org.whole.lang.artifacts.builders.ArtifactsSpecificBuilderAdapter)

Example 35 with IBuilder

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