D Compiler as a Library

Trass3r un at known.com
Sat Apr 14 09:26:51 PDT 2012


>> Still some things to learn from Clang though.
>> e.g. it still directly builds an AST instead of using some kind of
>> interface.
>>
>
> I'm very interested in what you mean here. Do you have a link or can you  
> write an explaination ?

Clang decouples the parser from AST construction by letting the parser  
take an interface class that has a virtual method for everything that is  
parsed along the lines of ActOnStartOfFunctionDef().
So a client that doesn't need an AST doesn't have to build one.

Don't know if it's properly implemented in Clang now though.


More information about the Digitalmars-d mailing list