Search in sources :

Example 1 with QueriesInterpreterVisitor

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

Aggregations

IBuilder (org.whole.lang.builders.IBuilder)1 IBuilderFactory (org.whole.lang.builders.IBuilderFactory)1 IEntityContext (org.whole.lang.contexts.IEntityContext)1 IOperation (org.whole.lang.operations.IOperation)1 PrettyPrinterOperation (org.whole.lang.operations.PrettyPrinterOperation)1 IQueriesBuilder (org.whole.lang.queries.builders.IQueriesBuilder)1 QueriesGenericBuilderAdapter (org.whole.lang.queries.builders.QueriesGenericBuilderAdapter)1 QueriesSpecificBuilderAdapter (org.whole.lang.queries.builders.QueriesSpecificBuilderAdapter)1 QueriesDynamicCompilerVisitor (org.whole.lang.queries.visitors.QueriesDynamicCompilerVisitor)1 QueriesInterpreterVisitor (org.whole.lang.queries.visitors.QueriesInterpreterVisitor)1 QueriesPrettyPrinterVisitor (org.whole.lang.queries.visitors.QueriesPrettyPrinterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1