[antlr-interest] How do you implement conditional blocks in tree grammars?

Kurt Otte kurtotte at gmail.com
Wed Sep 17 16:13:20 PDT 2008


This didn't work for me.  The '.' will only match real or imaginary
tokens and not UPs or DOWNs so this works as long as there are no
subtrees.  In my case there are subtrees so I get a recognizer error
on an unexpected DOWN.  I tried '.' and '.+' and both got hung up on
UPs and DOWNs.

Would this be language specific?  I am using the C Runtime, but I
figured this is generic.

Am I missing something?

Thanks,

Kurt


On Wed, Sep 17, 2008 at 5:05 PM, Terence Parr <parrt at cs.usfca.edu> wrote:
>
> On Sep 17, 2008, at 3:57 PM, Kurt Otte wrote:
>
>> How can I skip a section of the token stream when using a tree grammar
>> to implement a conditional block?
>
> ^(COND . ^(IF ^(BLOCK .)))
>
> I think.
>
> Ter
>
>


More information about the antlr-interest mailing list