[cfe-dev] Future of AST transformation
Olaf Krzikalla
Olaf.Krzikalla at tu-dresden.de
Mon Jul 23 02:20:26 PDT 2012
Am 21.07.2012 01:08, schrieb Sean Silva:
> Check out the block comment right above the class declaration, it
> contains a quite thorough discussion. TreeTransform is just a standard
> visitor pattern which recursively accumulates the results of
> subinvocations. If you're familiar with Pythons `ast.NodeTransformer`,
> TreeTransform is basically the same idea.
There are at least two reasons against TreeTransform: firstly, it is not
even exposed as an API but just a part of the sema lib. Secondly, even
if it would be available, I won't be able to construct an actual object,
since I don't have a proper sema object. For various reasons I have to
construct the complete AST before I start transforming it. And then I
don't have an idea, how I get sema back to the appropriate state.
For the moment I'm going to implement my own simple EvaluateAsRValue
function. Of course I'm very unhappy with this solution right now.
Best regards
Olaf Krzikalla
More information about the cfe-dev
mailing list