This is the mail archive of the gcc-patches@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: [patch] new exec-charset testcase


Kai Henningsen wrote:

mark@codesourcery.com (Mark Mitchell) wrote on 20.04.04 in <4085ECF6.4080404@codesourcery.com>:



The lexer is the right place to do this stuff, in principle; the parser
should just see a stream of tokens. Unfortunately, you've got a lexical
analysis situation that is context-sensitive; that's often thought to be
a sign of poor design. Not that it's your fault, of course.



Oh, it *is* poor design; strings are used for something entirely different. However, that gives me an idea ...


... we have L"wide strings" already - we could have A"asm strings" which would be treated differently. (For example, they could allow multi-line strings.)


That's clever -- but it runs into a massive backwards-compatibility problem.

Ok, so this doesn't solve 'extern "C"' ...


Well, that case is trivial to get right in the lexer. It requires maintaining One Whole Bit to say whether the previous token was 'extern' or not.

--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com


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