[antlr-interest] Island grammars in Antlr 2?

Pete Gonzalez pgonzalez at bluel.com
Thu Nov 17 09:16:12 PST 2005


I need to parse something like this:

     block {
       block {
       }
       exec {
         freeform text
       }
     }

That is, I want to collect the raw text inside the "exec" block (i.e. 
[^}]*) and return it as a single token, which will be parsed by separately 
by a different grammar.  I know that this is addressed explicitly in Antlr 
3, but is it possible with Antlr 2?

Cheers,
-Pete


More information about the antlr-interest mailing list