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

Marcin Rzeźnicki marcin.rzeznicki at gmail.com
Sun May 2 16:42:57 PDT 2010


2010/5/3 Terence Parr <parrt at cs.usfca.edu>:
>
> On May 2, 2010, at 4:26 PM, Marcin Rzeźnicki wrote:
>
>> On Mon, May 3, 2010 at 12:55 AM, Terence Parr <parrt at cs.usfca.edu> wrote:
>>> hi. actions hide semantic predicates...got any?
>>> T
>>> On May 2, 2010, at 2:43 PM, Marcin Rzeźnicki wrote:
>>
>> Yes, quite a lot :-) Could you elaborate? In what way they do "hide" them?
>
> ANTLR cannot test a predicate during prediction (before alt executes) if an action is in front of it:
>
> a : {action} {p}? ID
>  | ID
>  ;
>
> action could alter results of p.
>
> Ter

ah, thanks a lot - that explains a lot
So, in th example you posted above - with an action in front it is
equivalent to:
a : {action} ID
 | ID
;
right?
So, care to give me any hint about reorganizing actions in similar
case? Thx a lot


-- 
Greetings
Marcin Rzeźnicki


More information about the antlr-interest mailing list