[antlr-interest] Actions and non-LL(*) rules ??

Marcin Rzeźnicki marcin.rzeznicki at gmail.com
Tue May 4 06:10:08 PDT 2010


On Tue, May 4, 2010 at 12:47 AM, Terence Parr <parrt at cs.usfca.edu> wrote:
> Marcin, ANTLR should let backtracking predicates work even with actions.
> Ter
> On May 3, 2010, at 3:36 PM, Marcin Rzeźnicki wrote:
>

Hmm, there is something wrong with all this. I removed all actions
from the grammar - checked - it is ok. Now, I started to add actions
one by one to see which one causes this mess. I haven't found that
yet, but where  I got the rule like
s: a1 {action} | a2 {action} | a3 ( a1{action} | a2{action} )? {action}
it started to complain about hidden predicates (it is a warning only
though). While I understand where the ambiguity comes from (it is
because of the outer rule which chains Ses, so input like a3 a1 can be
parsed in tow ways: either (a3) (a1) or (a3 a1)), I sincerely do not
understand from where it drawn the conclusion that predicate is
hidden.

-- 
Greetings
Marcin Rzeźnicki


More information about the antlr-interest mailing list