[antlr-interest] Error in Backtracking (?)

Johannes Luber JALuber at gmx.de
Sat Jan 12 09:29:12 PST 2008


> Hi
> 
> I putted down this simple grammar:
...
> 
> This grammar could(?) generate 4 kind of differen expressions
> Aritmethic expressions(expA)
> Boolean expressions(expB)
> String expressions(expS)
> and an expression consisting of a simple field (FIELD)
> 
> whithout any option the compiler says that when i find a '(' it can't
> decide if the expression is a expA or a expB or a expS.
> 
> if i use the option backtrack=true and memoize=true the interpreter don't
> accept any kind of string.
> 
> where is the problem?

I suppose backtracking creates predicates in the code, which the interpreter doesn't understand. Use the debug option instead. BTW, don't use the global backtrack option. Instead use left-factoring or syntactic predicates. Makes the grammar faster.

Johannes
-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail


More information about the antlr-interest mailing list