[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Need help scratching an itch (Bug #379684)

Hi Richard

 

I've already started implementing user defined literals syntactically. Code is in gerrit (https://git.eclipse.org/r/6000).

Regarding your question. As far as I know the standard does not explicitly require a space between "" and the following identifier. But it is not possible according to the lexical conventions to have a matching token sequence for a literal operator. If we consider an example:

                float operator ""E(const char*);

This is invalid as ""E would yield only one token, a user defined string literal, instead of "" and E as separate tokens. As you run into this problem, you might not yet have the corresponding adaption in the lexer.

 

Regards

Thomas

 

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Richard
Sent: Sonntag, 3. Juni 2012 08:04
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] Need help scratching an itch (Bug #379684)

 

Hello CDT mailing list, 

I'm taking a stab at fixing bug #379684 User-defined literals, mostly just for the fun of it, but I'm probably going to need a lot of help as this is my first time in the eclipse/cdt internals.

Anyway, I have managed to get the parser to recognise the T operator "" L() syntax, with one caveat: I can't figure out how to require the whitespace between the "" and the literal name.

 

Thanks, Richard.