Search in sources :

Example 6 with AbstractVisitor

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

the class GenericMatcherFactory method matchInScope.

public IVisitor matchInScope(final IEntity pattern) {
    return new AbstractVisitor() {

        public void visit(IEntity entity) {
            if (!Matcher.match(pattern, entity, getBindings()))
                throw new VisitException();
        }

        public void toString(StringBuilder sb) {
            sb.append("match(");
            // TODO startOf
            sb.append(pattern);
            sb.append(")");
        }
    };
}
Also used : AbstractVisitor(org.whole.lang.visitors.AbstractVisitor) IEntity(org.whole.lang.model.IEntity) VisitException(org.whole.lang.visitors.VisitException)

Aggregations

IEntity (org.whole.lang.model.IEntity)6 AbstractVisitor (org.whole.lang.visitors.AbstractVisitor)6 VisitException (org.whole.lang.visitors.VisitException)4 ReflectLibraryDeployer (org.whole.lang.ReflectLibraryDeployer)1 ViewDerivationLibraryDeployer (org.whole.lang.ViewDerivationLibraryDeployer)1 IBindingManager (org.whole.lang.bindings.IBindingManager)1 EditorsArtifactsGeneratorVisitor (org.whole.lang.editors.visitors.EditorsArtifactsGeneratorVisitor)1 FramesInterpreterVisitor (org.whole.lang.frames.visitors.FramesInterpreterVisitor)1 GrammarsContentAssistVisitor (org.whole.lang.grammars.visitors.GrammarsContentAssistVisitor)1 GrammarsInterpreterVisitor (org.whole.lang.grammars.visitors.GrammarsInterpreterVisitor)1 GrammarsValidatorVisitor (org.whole.lang.grammars.visitors.GrammarsValidatorVisitor)1 ArtifactsGeneratorOperation (org.whole.lang.operations.ArtifactsGeneratorOperation)1 IOperation (org.whole.lang.operations.IOperation)1 PojoArtifactsGeneratorVisitor (org.whole.lang.pojo.visitors.PojoArtifactsGeneratorVisitor)1 EntityDescriptor (org.whole.lang.reflect.EntityDescriptor)1 FeatureDescriptor (org.whole.lang.reflect.FeatureDescriptor)1 IVisitor (org.whole.lang.visitors.IVisitor)1 IVisitorFactory (org.whole.lang.visitors.IVisitorFactory)1