{DMD-AST-Tool} For beginning DDMD hackers

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 22 23:26:53 PST 2016


On Wednesday, 23 November 2016 at 07:11:56 UTC, ANtlord wrote:
> On Saturday, 12 November 2016 at 10:26:53 UTC, Stefan Koch 
> wrote:
>> Hi Guys,
>>
>> I have written a small utility called dmd-ast-tool.
>> It can be used to quickly generate boilerplate code for 
>> dmd-ast-visitors.
>> Originally it was only written for my personal use, it used to 
>> work with a handwritten text-file representing dmds ast class 
>> hierarchy.
>>
>> However I recently updated it construct the class hierarchy 
>> from ddmds source code.
>>
>> It is pretty bare-boned, but maybe it can be useful to some of 
>> you :)
>>
>> https://github.com/UplinkCoder/dmd-ast-tool.
>
> Hello! Can you clarify? Does this program use ddmd or ddmd is 
> just used as code sample for parsing?

It is a special purpose tool to get the AST-class-hierarchy of 
ddmd.
I would not even use the word parser, since it just matches a 
simple regex on ddmds source code.
It then does a correlation pass to determine parent-child 
relationships between the classes.
The resulting data-structure can then be used to display said 
hierarchy.


More information about the Digitalmars-d mailing list