Search in sources :

Example 1 with TestsLearningInterpreterVisitor

use of org.whole.lang.tests.visitors.TestsLearningInterpreterVisitor in project whole by wholeplatform.

the class TestsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new TestsGenericBuilderAdapter((ITestsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(TestsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

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

        public IVisitor create(IOperation operation, int stage) {
            return new TestsContentAssistVisitor();
        }
    });
}
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) TestsLearningInterpreterVisitor(org.whole.lang.tests.visitors.TestsLearningInterpreterVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) ITestsBuilder(org.whole.lang.tests.builders.ITestsBuilder) TestsSpecificBuilderAdapter(org.whole.lang.tests.builders.TestsSpecificBuilderAdapter) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) TestsContentAssistVisitor(org.whole.lang.tests.visitors.TestsContentAssistVisitor) TestsGenericBuilderAdapter(org.whole.lang.tests.builders.TestsGenericBuilderAdapter) TestsPrettyPrinterVisitor(org.whole.lang.tests.visitors.TestsPrettyPrinterVisitor)

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 ITestsBuilder (org.whole.lang.tests.builders.ITestsBuilder)1 TestsGenericBuilderAdapter (org.whole.lang.tests.builders.TestsGenericBuilderAdapter)1 TestsSpecificBuilderAdapter (org.whole.lang.tests.builders.TestsSpecificBuilderAdapter)1 TestsContentAssistVisitor (org.whole.lang.tests.visitors.TestsContentAssistVisitor)1 TestsLearningInterpreterVisitor (org.whole.lang.tests.visitors.TestsLearningInterpreterVisitor)1 TestsPrettyPrinterVisitor (org.whole.lang.tests.visitors.TestsPrettyPrinterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1