[antlr-interest] linear list from tree

Monty Zukowski monty at codetransform.com
Fri Aug 12 09:47:11 PDT 2005


marc schellens wrote:
> I would like to build a linear list made from the 'expr'
> in the following grammer fragment.
> This way it does not work.
> So how to do it?
> 
> Thanks,
> marc
> 
> 
> arrayindex_list!
>     : ( #(ARRAYIX
>                 ( ALL
>                 | ( e1:expr // 0 or 2
>                         {
>                             #arrayindex_list = #( NULL,
> (arrayindex_list),e1);

How about #arrayindex_list = #(NULL, arrayindex_list,e1); ?

> // also not working:        #arrayindex_list = #( arrayindex_list,e1);
> //                          #arrayindex_list = #( (arrayindex_list),e1);
> 
> 
>                         }
>                     )
>                 )
>         )+
>         {
> //            #arrayindex_list = #([ARRAYIX,"[...]"], arrayindex_list);
> //            #arrayindex_list->SetArrayIndexList( ixList.release());
>         }
>     ;   
> 
> 
> 



More information about the antlr-interest mailing list