Search in sources :

Example 36 with IVisitor

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

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

the class AttributesMatcherFactory method matchReferenceAttribute.

public static IVisitor matchReferenceAttribute(IBindingManager bm) {
    IVisitor ov = GenericTraversalFactory.instance.one(GenericMatcherFactory.instance.matchInScope(getRefAttrPattern()), GenericMatcherFactory.instance.matchInScope(getQualifiedRefAttrPattern()));
    ov.setBindings(bm);
    return ov;
}
Also used : IVisitor(org.whole.lang.visitors.IVisitor)

Example 38 with IVisitor

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

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

the class WorkflowsInterpreterDeployer 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 WorkflowsInterpreterVisitor();
            else
                return null;
        }
    });
    platform.addOperationFactory(WorkflowsLanguageKit.URI, DynamicCompilerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new WorkflowsDynamicCompilerVisitor();
            else
                return null;
        }
    });
}
Also used : IOperation(org.whole.lang.operations.IOperation) WorkflowsInterpreterVisitor(org.whole.lang.workflows.visitors.WorkflowsInterpreterVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) WorkflowsDynamicCompilerVisitor(org.whole.lang.workflows.visitors.WorkflowsDynamicCompilerVisitor)

Example 40 with IVisitor

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

the class ActionsUIDeployer method deploy.

public void deploy(ReflectionFactory platform) {
    platform.addEditorKit(ActionsEditorKit.ID);
    platform.addOperationFactory(ActionsLanguageKit.URI, ContentAssistOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new ActionsUIContentAssistVisitor();
        }
    });
}
Also used : IOperation(org.whole.lang.operations.IOperation) ActionsUIContentAssistVisitor(org.whole.lang.actions.visitors.ActionsUIContentAssistVisitor) IVisitor(org.whole.lang.visitors.IVisitor) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory)

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