Search in sources :

Example 61 with IVisitor

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

the class TestsInterpreterVisitor method visit.

@Override
public void visit(AllOf entity) {
    int size = entity.wSize();
    IVisitor[] visitors = new IVisitor[size];
    for (int i = 0; i < size; i++) {
        entity.get(i).accept(this);
        visitors[i] = getResultVisitor();
    }
    setResultVisitor(GenericTraversalFactory.instance.all(visitors).withSourceEntity(entity));
}
Also used : IVisitor(org.whole.lang.visitors.IVisitor) Constraint(org.whole.lang.tests.model.Constraint)

Example 62 with IVisitor

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

the class TestsInterpreterVisitor method visit.

@Override
public void visit(IsDef entity) {
    IVisitor v = TestsMatcherFactory.instance.defined();
    v.withSourceEntity(entity).setBindings(getBindings());
    setResultVisitor(v);
}
Also used : IVisitor(org.whole.lang.visitors.IVisitor)

Example 63 with IVisitor

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

the class TestsInterpreterVisitor method visit.

@Override
public void visit(Throws entity) {
    String className = entity.getThrowableType().getValue();
    IVisitor v = TestsMatcherFactory.instance.hasThrown(className);
    v.withSourceEntity(entity).setBindings(getBindings());
    setResultVisitor(v);
}
Also used : IVisitor(org.whole.lang.visitors.IVisitor)

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