Search in sources :

Example 26 with IVisitor

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

the class Matcher method findChild.

@SuppressWarnings("unchecked")
public static <E extends IEntity> E findChild(E pattern, IEntity model, IBindingManager bindings) {
    IVisitor mv = GenericMatcherFactory.instance.matchInScope(pattern);
    mv.setBindings(bindings);
    return (E) findChild(mv, model);
}
Also used : IVisitor(org.whole.lang.visitors.IVisitor)

Example 27 with IVisitor

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

the class FramesUIDeployer method deploy.

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

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

Example 28 with IVisitor

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

the class QueriesUIDeployer method deploy.

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

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

Example 29 with IVisitor

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

the class ActionsLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new ActionsGenericBuilderAdapter((IActionsBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(ActionsLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

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

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

        public IVisitor create(IOperation operation, int stage) {
            if (stage == 0)
                return new ActionsDynamicCompilerVisitor();
            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) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) ActionsGenericBuilderAdapter(org.whole.lang.actions.builders.ActionsGenericBuilderAdapter) IVisitorFactory(org.whole.lang.visitors.IVisitorFactory) ActionsInterpreterVisitor(org.whole.lang.actions.visitors.ActionsInterpreterVisitor) IActionsBuilder(org.whole.lang.actions.builders.IActionsBuilder) ActionsSpecificBuilderAdapter(org.whole.lang.actions.builders.ActionsSpecificBuilderAdapter) ActionsDynamicCompilerVisitor(org.whole.lang.actions.visitors.ActionsDynamicCompilerVisitor)

Example 30 with IVisitor

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

the class PojoLanguageDeployer method deploy.

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

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PojoGenericBuilderAdapter((IPojoBuilder) strategy, entityContext);
        }
    });
    platform.addOperationFactory(PojoLanguageKit.URI, SpecificBuilderAdapterOperation.ID, new IBuilderFactory() {

        public IBuilder create(IBuilder strategy, IEntityContext entityContext) {
            return new PojoSpecificBuilderAdapter(strategy, entityContext);
        }
    });
    platform.addOperationFactory(PojoLanguageKit.URI, NormalizerOperation.ID, new IVisitorFactory() {

        public IVisitor create(IOperation operation, int stage) {
            return new PojoNormalizerVisitor();
        }
    });
}
Also used : IBuilder(org.whole.lang.builders.IBuilder) IOperation(org.whole.lang.operations.IOperation) PojoSpecificBuilderAdapter(org.whole.lang.pojo.builders.PojoSpecificBuilderAdapter) IPojoBuilder(org.whole.lang.pojo.builders.IPojoBuilder) IVisitor(org.whole.lang.visitors.IVisitor) PojoNormalizerVisitor(org.whole.lang.pojo.visitors.PojoNormalizerVisitor) IEntityContext(org.whole.lang.contexts.IEntityContext) IBuilderFactory(org.whole.lang.builders.IBuilderFactory) PojoGenericBuilderAdapter(org.whole.lang.pojo.builders.PojoGenericBuilderAdapter) 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