[antlr-interest] Bug in t.g from "Parsing Simple Data"

David Ewing dewing at apple.com
Thu Nov 8 09:27:12 PST 2001

On Saturday, November 3, 2001, at 02:58 AM, bkuehl at web.de wrote:

>>> The whitespace token isn't correct for MacOS or MacOSX. A
>>> single \r needs to be added.
>> Sorry about that...I was waiting for NeXT to take over Apple and 
>> replace
>> the silly \r with \n as gawd intended ;)  Whew ....just in time. ;)
>> Sorry for the hassle.  \n should work on NeXTStep...er....OS X.  I'm
>> using it right this very second!  Wohooo!
> This is not completly correct. Using OSX (10.1) just mark the input 
> lines
> from the head of the "Parsing Simple Data" webpage, copy and paste them
> into a TextEdit document, save the document and "od -c" shows that all
> lines end with \r.
> But when you paste the same lines as standard input to "od -c" or to the
> parser, the lines are terminated with \n.
> Can someone explain this? Do different applications handle newlines in 
> the
> pasteboard buffer in different ways? Why?

Um..., well..., yeah, Mac OS X goes both ways. Different parts of the OS 
prefer different line endings. Actually, most things handle the DOS way 
as well. And then, there's always the Unicode line and paragraph 
separator characters....

So, if you want to parse "text" files on a Mac, be prepared to deal with 
all the possibilities. :)



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list