[antlr-interest] Re: lexer "modes" for XML parsing etc...

Anthony Youngman Anthony.Youngman at eca-international.com
Tue Nov 22 07:18:43 PST 2005


Okay, the language has evolved, but this (if I'm following correctly)
would be perfect for parsing DATABASIC. The original language
specification actually WAS a state table, if I understand the history
correctly. The flowchart is long lost, but its existence was well known.

I don't know how well the modern language would lex/parse that way, but
it would probably make life a lot easier.

Cheers,
Wol 

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Martin Probst
Sent: 20 November 2005 23:41
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Re: lexer "modes" for XML parsing etc...

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


* ************************************************************************ *

This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system.

Telephone numbers for ECA International offices are: Sydney +61 (0)2 8272 5300, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.

* ************************************************************************ *



More information about the antlr-interest mailing list