[antlr-interest] Re: lexer "modes" for XML parsing etc...
Martin Probst
mail at martin-probst.com
Sun Nov 20 15:40:47 PST 2005
Hi,
> context SQL {
> ID : ... ;
> ACTION : ...;
> STRING : ... ;
> ENDSQL : ')' {popContext();}
> }
>
> context island2 {
> ...
> }
> Sounds easy. Is this what we want? It is proper for island grammars
> that feed off the same input stream. Multiple input streams like
> include files need to be handled with a multiplexing input buffer.
That's exactly what I was hoping for. Though I'm not so much into island
grammars for different languages, but rather different states for the
same language, e.g. an operator state (where 'and' is the binary
operator) and a default state (where 'and' is a QName) etc. - that's the
problem I have to tackle. This would help a lot in both cases.
> [note the push/pop rather than simple set; very useful]
Yes, I nearly forgot that. We need push/pop and set.
Martin
More information about the antlr-interest
mailing list