Search in sources :

Example 6 with PrettyPrinterOperation

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

the class QueriesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new QueriesGenericBuilderAdapter((IQueriesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(QueriesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new QueriesPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) QueriesDynamicCompilerVisitor(org.whole.lang.queries.visitors.QueriesDynamicCompilerVisitor) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) QueriesPrettyPrinterVisitor(org.whole.lang.queries.visitors.QueriesPrettyPrinterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) QueriesSpecificBuilderAdapter(org.whole.lang.queries.builders.QueriesSpecificBuilderAdapter) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) IQueriesBuilder(org.whole.lang.queries.builders.IQueriesBuilder) QueriesInterpreterVisitor(org.whole.lang.queries.visitors.QueriesInterpreterVisitor) QueriesGenericBuilderAdapter(org.whole.lang.queries.builders.QueriesGenericBuilderAdapter)

Example 7 with PrettyPrinterOperation

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

the class JavaLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new JavaGenericBuilderAdapter((IJavaBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(JavaLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new JavaInterpreterVisitor();
            else
                return null;
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PrettyPrinterOperation(org.whole.lang.operations.PrettyPrinterOperation) IJavaBuilder(org.whole.lang.java.builders.IJavaBuilder) IVisitor(org.whole.lang.visitors.IVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) JavaPrettyPrinterVisitor(org.whole.lang.java.visitors.JavaPrettyPrinterVisitor) JavaSpecificBuilderAdapter(org.whole.lang.java.builders.JavaSpecificBuilderAdapter) JavaGenericBuilderAdapter(org.whole.lang.java.builders.JavaGenericBuilderAdapter) JavaInterpreterVisitor(org.whole.lang.java.visitors.JavaInterpreterVisitor)

Example 8 with PrettyPrinterOperation

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

the class TextLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TextGenericBuilderAdapter((ITextBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TextLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new TextPrettyPrinterVisitor((PrettyPrinterOperation) operation);
        }
    });
    platform.addPersistenceKit("org.whole.lang.text.TextSourceEditor", TextSourcePersistenceKit.instance());
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) ITextBuilder(org.whole.lang.text.builders.ITextBuilder) 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) TextPrettyPrinterVisitor(org.whole.lang.text.visitors.TextPrettyPrinterVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) TextInterpreterVisitor(org.whole.lang.text.visitors.TextInterpreterVisitor) TextGenericBuilderAdapter(org.whole.lang.text.builders.TextGenericBuilderAdapter) TextSpecificBuilderAdapter(org.whole.lang.text.builders.TextSpecificBuilderAdapter)

Example 9 with PrettyPrinterOperation

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

use of org.whole.lang.operations.PrettyPrinterOperation 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)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