Search in sources :

Example 31 with IVisitor

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

Example 32 with IVisitor

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

the class PropertiesLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PropertiesGenericBuilderAdapter((IPropertiesBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(PropertiesLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new PropertiesInterpreterVisitor();
            else
                return null;
        }
    });
    platform.addPersistenceKit("org.whole.lang.properties.PropertiesTextEditor", PropertiesTextPersistenceKit.instance());
    platform.addPersistenceKit("org.whole.lang.properties.PropertiesXmlEditor", PropertiesXmlPersistenceKit.instance());
}
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) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) PropertiesPrettyPrinterVisitor(org.whole.lang.properties.visitors.PropertiesPrettyPrinterVisitor) PropertiesSpecificBuilderAdapter(org.whole.lang.properties.builders.PropertiesSpecificBuilderAdapter) PropertiesInterpreterVisitor(org.whole.lang.properties.visitors.PropertiesInterpreterVisitor) PropertiesGenericBuilderAdapter(org.whole.lang.properties.builders.PropertiesGenericBuilderAdapter) IPropertiesBuilder(org.whole.lang.properties.builders.IPropertiesBuilder)

Example 33 with IVisitor

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

the class IDEOperationsDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addOperationFactory(WorkflowsLanguageKit.URI, InterpreterOperation.ID, new IVisitorFactory() {

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

        public IVisitor create(IOperation operation, int stage) {
            return new WorkflowsIDEContentAssistVisitor();
        }
    });
    new JavaReflectLibraryDeployer().deploy(platform);
}
Also used : IOperation(org.whole.lang.operations.IOperation) WorkflowsIDEInterpreterVisitor(org.whole.lang.workflows.visitors.WorkflowsIDEInterpreterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) WorkflowsIDEContentAssistVisitor(org.whole.lang.workflows.visitors.WorkflowsIDEContentAssistVisitor) JavaReflectLibraryDeployer(org.whole.lang.java.JavaReflectLibraryDeployer) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory)

Example 34 with IVisitor

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

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

the class SemanticsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new SemanticsGenericBuilderAdapter((ISemanticsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(SemanticsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new SemanticsDynamicCompilerVisitor();
            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) ISemanticsBuilder(org.whole.lang.semantics.builders.ISemanticsBuilder) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) SemanticsSpecificBuilderAdapter(org.whole.lang.semantics.builders.SemanticsSpecificBuilderAdapter) SemanticsInterpreterVisitor(org.whole.lang.semantics.visitors.SemanticsInterpreterVisitor) SemanticsDynamicCompilerVisitor(org.whole.lang.semantics.visitors.SemanticsDynamicCompilerVisitor) SemanticsGenericBuilderAdapter(org.whole.lang.semantics.builders.SemanticsGenericBuilderAdapter)

Aggregations

IVisitor (org.whole.lang.visitors.IVisitor)63 IOperation (org.whole.lang.operations.IOperation)34 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)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 IEntity (org.whole.lang.model.IEntity)9 ILanguageKit (org.whole.lang.reflect.ILanguageKit)4 MethodInvocation (org.eclipse.jdt.core.dom.MethodInvocation)3 IBindingManager (org.whole.lang.bindings.IBindingManager)3 Test (org.junit.Test)2 ITransactionScope (org.whole.lang.bindings.ITransactionScope)2 GenericMatcherFactory (org.whole.lang.matchers.GenericMatcherFactory)2 AbstractOperation (org.whole.lang.operations.AbstractOperation)2 PrettyPrinterOperation.toPrettyPrintString (org.whole.lang.operations.PrettyPrinterOperation.toPrettyPrintString)2 VisitException (org.whole.lang.visitors.VisitException)2 PrintWriter (java.io.PrintWriter)1 Writer (java.io.Writer)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1