This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc compile-time performance


> 
> You need to look ahead many times, such as when seeing '.' you need two
> chars to see if it's '...'.  But that can be arbitrarily long because
> it could be '.\\n.\\n.".  If you're using the mb functions, what do you
> do with the chars you've just read in if the 3rd one wasn't a dot?
> You can't just go back to after the initial dot, because the mb functions
> have state.  So I imagine you have to buffer them elsewhere, and that
> means maintaining a buffer that needs to be checked whenever you read
> a character.  It gets nasty.

But with all the escaped representations that I am familiar with a dot
looks like a dot, so looking at the next character in the source buffer
to see if it is a dot is easily done. The point is to avoid calling the
functions to interpret extended characters unless you have an extended
character.

I must be missing something here, I don't see why C is so different from
Ada here. I wrote all the circuitry for handling multiple representations
in the Ada lexer, and it seemed quite straightforward.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]