[antlr-interest] Embedding templates in itself

Oliver B. Fischer o.b.fischer at gmx.de
Mon Jul 7 00:59:36 PDT 2008


Hello,

I have a tree parser to parse nested blocks like "{{}{}}". The generated 
tree looks fine: (PROGRAM (FUNC void function (BLOCK (BLOCK BLOCK)))).

Unfortunately it seems to be impossible to embed templates in itself as 
I try it:

block
   : ^(BLOCK (blo+=block)*)
     -> block(st={$blo})
   ;

Doing this, I always get IllegalArgumentException saying "cannot embed 
template block in itself". But who can I handle such structure with 
StringTemplate?

Best regards,

Oliver

-- 
Oliver B. Fischer, Schönhauser Allee 64, 10437 Berlin
Tel. +49 30 44793251, Mobil: +49 178 7903538
Mail: o.b.fischer at gmx.de Blog: http://www.sw-blog.net


More information about the antlr-interest mailing list