Re: Using Flex/Lex in a Cocoa project
Re: Using Flex/Lex in a Cocoa project
- Subject: Re: Using Flex/Lex in a Cocoa project
- From: John Joyce <email@hidden>
- Date: Mon, 18 Aug 2008 20:01:45 -0500
On Aug 18, 2008, at 7:01 PM, email@hidden wrote:
to avoid the splitting problem
(c < 128) ? "%c" : "\\ux", c);
Not quite sure what this is doing.
I see it's checking for ASCII range
if ( c < 128 )
The conditional is obvious,
but what's the other doing exactly?
returning a char if it is ASCII, it seems,
and then some sort of escaped version if it is beyond ASCII range...?
Particularly there, I'm not sure what that results in.
Basically, I only need to do anything based on characters that are in
ASCII now, but I'd like to allow other ranges in the text files
without worry. Browsing around, I've seen where basically, everyone is
hoping somebody else will modernize lex and yacc with a clever
algorithm that reduces the overhead. Personally, I think that in many
cases, this should be no problem with the speed and capability of
contemporary computers, but it could still be a drag.
I have been looking at simply building an NSString of the same length
with ranges of non-ASCII subbed out with some other character, just to
do the lexing, then apply the results of the lex to the original
NSString.
For speed, it may even make sense to simply have two NSStrings going,
one that is the real thing, the other that auto-substitutes anything
non-ASCII. For this, my question to all is, what ASCII character would
be good for the substitution without messing up the regexes? I'm
considering some the unused control characters in the lower ranges,
but I'm a little scared to see what will happen...
Any suggestions on this idea?
Cheers,
JJ
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden