www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD JSON output

reply ANtlord <antlord92 gmail.com> writes:
Hello! I've encroutered intresting tool of DMD. It is dump of AST 
in JSON format (dmd -X main.d). But I it contains only 
declaration of methods, templates and structs. It doesn't contain 
statements like a variables or nested functions inside function's 
body.

Is it possible to make dump with statements inside function's 
body? If yes, how can I do this?

Thanks.
Feb 25 2017
parent rikki cattermole <rikki cattermole.co.nz> writes:
On 26/02/2017 4:01 PM, ANtlord wrote:
 Hello! I've encroutered intresting tool of DMD. It is dump of AST in
 JSON format (dmd -X main.d). But I it contains only declaration of
 methods, templates and structs. It doesn't contain statements like a
 variables or nested functions inside function's body.

 Is it possible to make dump with statements inside function's body? If
 yes, how can I do this?

 Thanks.
Not without modifying the source code. I would recommend instead dscanner[0]. With its --ast export function (xml). [0] https://github.com/Hackerpilot/Dscanner
Feb 25 2017