From: Taras S. <st...@gm...> - 2010-12-29 09:43:28
|
Hi all, I need a feature along the lines of ANTLR validating semantic predicates ( http://stackoverflow.com/questions/3056441/what-is-a-semantic-predicate-in-antlr ). That is, before firing the RHS of a rule I'd like to check if the current bindings satisfy some predicate. I don't want to do this in the Java RHS because I'd like the transducer to backtrack and try other rules when the predicate does not hold. Hypothetical syntax: Rule: PersonName ( ({FirstName}):firstname ({LastName}):lastname ):match When: firstname.country == lastname.country --> :match.Name = {} As far as I understand the only ways to extend Jape now are custom AnnotationAccessor's and ConstraintPredicate's, which are not enough for the task at hand. I'm willing to develop a custom transducer but before diving into that I'd like to ask for suggestions - what would be the optimal strategy to develop such a transducer, classes to look at, etc best regards, Taras |