Search in sources :

Example 1 with SemanticsDynamicCompilerVisitor

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

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 ISemanticsBuilder (org.whole.lang.semantics.builders.ISemanticsBuilder)1 SemanticsGenericBuilderAdapter (org.whole.lang.semantics.builders.SemanticsGenericBuilderAdapter)1 SemanticsSpecificBuilderAdapter (org.whole.lang.semantics.builders.SemanticsSpecificBuilderAdapter)1 SemanticsDynamicCompilerVisitor (org.whole.lang.semantics.visitors.SemanticsDynamicCompilerVisitor)1 SemanticsInterpreterVisitor (org.whole.lang.semantics.visitors.SemanticsInterpreterVisitor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1