DCT: D compiler as a collection of libraries

Jacob Carlborg doob at me.com
Fri May 11 04:49:22 PDT 2012


On 2012-05-11 12:35, Roman D. Boiko wrote:
> On Friday, 11 May 2012 at 09:36:28 UTC, Jacob Carlborg wrote:

>> Aha, clever. As long as I can get out the information I'm happy :) How
>> about adding properties for this in the token struct?
> There is a method for that in Lexer interface, for me it looks like it
> belongth there and not to token. Version accepting token and producing a
> pair of start/end Locations will be added.

Found it now, "calculateFor". It not sure if it's the most intuitive 
name though. I get the feeling: "calculate what?".

>> That might be the case. But I don't think it belongs in the parser.
> I will provide example code and a dedicated post later to illustrate my
> point.

I guess I'll have to wait for that then :)

>> Ok, fair enough. Perhaps this could be a property in the Token struct
>> as well. In that case I would suggest renaming "value" to
>> lexeme/spelling/representation, or something like that, and then name
>> the new property "value".
> I was going to rename value, but couldn't find a nice term. Thanks for
> your suggestions!
> As for the property with strongly typed literal value, currently I plan
> to put it into AST.

I stole "spelling" from Clang :)

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list