[antlr-interest] ANTLR v3 Tree Interface request

Jim Idle jimi at temporal-wave.com
Tue Apr 4 08:23:21 PDT 2006


Joking of course - I suspect that the request to move that method to the
adaptor makes sense and anyway, I have written the C stuff such that it
is easy to reflect any change you/we wish to make to the interfaces,
including the moving of methods :-)

To the interfaces, I added a tiny method to set the assumed "end of
line" character to some other single character to 0x0A (maybe we should
allow more than one character, though of course anyone can override
anything with their own implementation.

Also, the python grammar points out that it is difficult to produce
semantic predicates in the lexer based on the character offset. Your
solution of overriding the next token method is neat enough but in
languages such as C it is a bit (not enormous efforts but still some)
more of a pain to do this. I also have a language to lex/parse where I
need to interpret something at the start of the code line differently to
when it is not. Perhaps there is some variable that that we can/should
automatically keep in sync with the offset where a rule is starting the
scan?  Tracking one more offset would not be much of an overhead I
should think.

Jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Terence Parr
Sent: Monday, April 03, 2006 5:15 PM
To: ANTLR Interest
Subject: Re: [antlr-interest] ANTLR v3 Tree Interface request


On Apr 3, 2006, at 5:08 PM, Jim Idle wrote:
> Seems like we should open up the whole interface to discussion...
>
>
> What, just when I have finished coding it for the C output!!! ;-)

Well, it's open to discuss, but what we have is not bad ;)
Ter



More information about the antlr-interest mailing list