[antlr-interest] 3.0.1 C target woes

Wincent Colaiuta win at wincent.com
Tue Oct 16 11:38:20 PDT 2007


El 16/10/2007, a las 19:33, Jim Idle escribió:

> Basically, You should use the methods given to get the text of  
> tokens, but
> in general I don’t intend that you should need to know what the  
> changelists
> are to use it of course.

I'll look at doing that in the future, but in this case I made the  
mistake of thinking that the "start" member was publicly accessible  
and had stable semantics because it was documented in the headers,  
which are the public API of the runtime.

Correct me if I'm wrong though, but in this particular case using the  
provided methods wouldn't have helped at all. Using getStartIndex()  
rather than just accessing token->start directly wouldn't have helped  
because getStartIndex() just returns token->start.

So the key problem I ran into was that the semantics of the property  
changed (from character index to absolute pointer), but there was no  
changelist that I could find which documented this API-level change,  
and the documentation for the property in the header file wasn't  
updated to inform of the new semantics. This is not a criticism, just  
a request for documentation of API changes in future versions.

> Ironically, both the change to use absolute pointers (though it  
> does sound
> like that isn't quite right for UCS2) and the correction to  
> spelling errors
> in comments, were done for you!
>
> I will take your suggestions under advisement, but let's not lose  
> track of
> the fact that it is free and unencumbered

Yes, I'm well aware that ANTLR is free and you work on it as a  
volunteer, and I appreciate your efforts. I was just trying to  
provide feedback to help you make it even better. If you're not  
interested in that kind of feedback let me know and I'll try to keep  
it to myself.

> and a little more complicated than
> Git ;-)

I haven't actually compared lines-of-code and what not, but I didn't  
bring up Git because of its relative complexity (or lack of); I  
brought it up because it's the best example of clean history I've  
ever seen in an open source project, right from the very first  
commit. I think we could all learn a lot by studying their processes.

Cheers,
Wincent





More information about the antlr-interest mailing list