Search in sources :

Example 26 with IVisitorFactory

use of org.whole.lang.visitors.IVisitorFactory 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 27 with IVisitorFactory

use of org.whole.lang.visitors.IVisitorFactory 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 28 with IVisitorFactory

use of org.whole.lang.visitors.IVisitorFactory in project whole by wholeplatform.

the class GrammarsUIDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addEditorKit(GrammarsEditorKit.ID);
    platform.addEditorKit(GrammarsParserEditorKit.ID);
    platform.addEditorKit(GrammarsUnparserEditorKit.ID);
    platform.addOperationFactory(GrammarsLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new GrammarsUIInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IOperation(org.whole.lang.operations.IOperation) IVisitor(org.whole.lang.visitors.IVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) GrammarsUIInterpreterVisitor(org.whole.lang.grammars.visitors.GrammarsUIInterpreterVisitor)

Example 29 with IVisitorFactory

use of org.whole.lang.visitors.IVisitorFactory 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 30 with IVisitorFactory

use of org.whole.lang.visitors.IVisitorFactory 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

IOperation (org.whole.lang.operations.IOperation)36 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)36 IVisitor (org.whole.lang.visitors.IVisitor)34 IBuilder (org.whole.lang.builders.IBuilder)20 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)20 IEntityContext (org.whole.lang.contexts.IEntityContext)20 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)13 ResourceArtifactsGeneratorVisitor (org.whole.lang.artifacts.visitors.ResourceArtifactsGeneratorVisitor)2 IBindingManager (org.whole.lang.bindings.IBindingManager)2 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 ReflectLibraryDeployer (org.whole.lang.ReflectLibraryDeployer)1 ViewDerivationLibraryDeployer (org.whole.lang.ViewDerivationLibraryDeployer)1