[antlr-interest] Additional char from LEXER->getText

Jim Idle jimi at temporal-wave.com
Sat Sep 1 10:41:51 PDT 2012


> -----Original Message-----
> From: Mike Lischke [mailto:mike at lischke-online.de]
> Sent: Saturday, September 01, 2012 4:48 AM
> To: Jim Idle
> Cc: ANTLR Mailing List
> Subject: Re: [antlr-interest] Additional char from LEXER->getText
>
>
> Hey Jim,
>
> > I added support for $text because so many examples had it. It is fine
> if you are not doing anything that is performance or memory sensitive.
>
> Just a lookup if a given id starting with an underscore is one in a
> list.

So, definitely don't use $text as you can just pass the text pointer to an
external function, that will be almost language agnostic.

>
> > I think that the goal of non language specific action isn't that
> realistic and will get in the way of doing things correctly.
>
> Unfortunately. Which makes sharing a grammar for different targets a
> pain. If there were only a way to separate grammar and language
> specific stuff...

Start with an unadorned grammar, branch and merge using sccs. It is not
the problem that people think it is unless you are using a weak SCCS.

>
> > Also note that the case insensitive option only works on ASCII and
> not the full Unicode code point set.
>
>
> I know. It works only because all my keywords are ASCII only.

That will work fine then

>
> Mike
> --
> www.soft-gems.net
>


More information about the antlr-interest mailing list