[antlr-interest] uh oh...trouble in meaning of (..)=> pred!!!
Terence Parr
parrt at cs.usfca.edu
Thu Mar 15 11:16:16 PDT 2007
On Mar 15, 2007, at 12:32 AM, Gavin Lambert wrote:
> Although it would be nicer if there was a simpler way to express
> them -- since this sort of predicate will usually be of the form
> "(a b c d) => a b" (ie. the matching portion is a strict prefix to
> the predicate), maybe this could be rewritten as something like "a
> b <c d>" (symbols just a suggestion; go with whatever makes more
> sense) to indicate that the tokens/rules at the end need to match
> but not be removed from the input stream and not be part of the
> production. But that's mostly syntactic sugar, so can probably wait.
Hi. I believe a PEG would do
a b &c &d
using & predicates that match but don't consume.
Auto backtracking will do the optimal "use synpred only if LL(*)
fails", but (...)=> manual predicates will force backtracking to eval
the pred. I can't know what's inside compared to alt whereas with
auto backtracking pred is copy of alt.
Ter
More information about the antlr-interest
mailing list