[antlr-interest] ANTLRWorks "synpredNN_MyGrammar" labels
Jim Idle
jimi at temporal-wave.com
Sat Nov 1 14:42:17 PDT 2008
On Sat, 2008-11-01 at 16:11 -0500, Ben Gillis wrote:
> OK...thanks. :-)
>
> So, why are they present in some ANTLRWorks Syntax Diagrams, but not in
> others? (Exact-same grammar rules, the smaller, trimmed down grammars do
> not have them...but, beyond being the exact-same rules, sub-rules, etc. I
> don't know why/what else in the grammar would determine when they're
> displayed).
Firstly, don't use backtracking mode as the parsers you get will be
pretty slow and error messages will be weak - see lots of posts on this
(it might help you to read through some of the archives).
ANTLR does what it can to get rid of any predicates that it realizes it
does not need. So sometimes there will be a predicate and sometimes
there won't be. Get rid of the backtrack option and there won't be any
that you don't put in yourself.
Jim
>
> ----- Original Message -----
> From: "Terence Parr" <parrt at cs.usfca.edu>
> To: "Ben Gillis" <wbgillis at gmail.com>
> Cc: <antlr-interest at antlr.org>
> Sent: Saturday, November 01, 2008 4:09 PM
> Subject: Re: [antlr-interest] ANTLRWorks "synpredNN_MyGrammar" labels
>
>
> > they are backtracking syntactic predicates.
> > Ter
> > On Nov 1, 2008, at 1:17 PM, Ben Gillis wrote:
> >
> >> Why does ANTLRWorks display blocks with synpredNN__ labels? e.g.
> >>
> >> {synpred25_MyGrammar}?
> >>
> >> Ambiguous alternatives?
> >>
> >> When I duplicate the *exact-same* rule (all sub-rules included) in a
> >> smaller grammar to isolate the problem, the "synpredNN" labels never
> >> appear.
> >>
> >> Thanks,
> >> Ben
> >>
> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> >> Unsubscribe:
> >> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> >>
> >
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081101/96033d93/attachment.html
More information about the antlr-interest
mailing list