[antlr-interest] how to let parser control lexer state.

femto gary femtowin at gmail.com
Sun Apr 29 03:05:30 PDT 2007


hehe, actually I've written a BaseLexer and BaseTokenStream
to handle rewindable/lazy tokenSource.
so for me, the generated RubyLexer must be inherited from BaseLexer,
not from the default Lexer, do anybody know how to do it?Thanks.
(it seems in v2 you can directly write someLexer/Parser extends
someLexer/Parser).

On 4/29/07, Jim Idle <jimi at temporal-wave.com> wrote:
> Syntax directed lexing opens up whole bags of worms. Perhaps we should
> just delete languages that require it? ;-). But I suppose ANTLR should
> be able to convert them into something sane ;-).
>
> Jim
>
> -----Original Message-----
> From: antlr-interest-bounces at antlr.org
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of femto gary
> Sent: Saturday, April 28, 2007 11:26 PM
> To: ANTLR Interest
> Subject: Re: [antlr-interest] how to let parser control lexer state.
>
> Hi Benjamin, actually I'm also begining writing this
> lazy/rewindable tokenSource/tokenStream,
> I don't think it is too difficult, will contact
> you if I need help, Thanks.
> and Jim Idle, the island grammar in the download
> doesn't helps too, because lexing need parser's info,
> while in the example, lexing doesn't need parser's info,
> just new a island-grammar parser and its job will be done.
> (actually , the wiki provides an island-grammar example which
> lexing will be controlled by parser, but I feel it is a bit complex
> so would like to write my own solution. besides, I can't find
> the whole source code of metaas, (in their homepage, they
> just put bin download, and in svn trunk, I can't find whole source
> code.)
>
>
> (besides, can the reply-to address be configured in this mailing list?
> I click reply and reply to just one person and become off mailing list).
>


-- 
Best Regards
XRuby http://xruby.com
femto http://hi.baidu.com/femto


More information about the antlr-interest mailing list