www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMD AST Docs/Reference or Dumper?

reply "bitwise" <bitwise.pvt gmail.com> writes:
I'm trying to add some compile-time function generation to dmd, 
but wasn't sure exactly how to click all the little legos 
together.

Is there any documentation or reference for the DMD AST? Or maybe 
some examples somewhere of what an AST may look like for a given 
function?

As a last resort, I was about to start converting the 
ToJsonVisitor to a ToAstDumpVisitor, but as you may have guessed, 
I am not particularly excited about this venture. Does source 
code exist anywhere for this already?

Thanks
Apr 07 2015
parent "Kai Nacke" <kai redstar.de> writes:
On Tuesday, 7 April 2015 at 15:58:49 UTC, bitwise wrote:
 I'm trying to add some compile-time function generation to dmd, 
 but wasn't sure exactly how to click all the little legos 
 together.

 Is there any documentation or reference for the DMD AST? Or 
 maybe some examples somewhere of what an AST may look like for 
 a given function?

 As a last resort, I was about to start converting the 
 ToJsonVisitor to a ToAstDumpVisitor, but as you may have 
 guessed, I am not particularly excited about this venture. Does 
 source code exist anywhere for this already?

 Thanks
Hi bitwise, I am not aware of such a visitor but would find it helpful, too. Regards, Kai
Apr 07 2015