www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - {DMD-AST-Tool} For beginning DDMD hackers

reply Stefan Koch <uplink.coder googlemail.com> writes:
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.
Nov 12 2016
next sibling parent reply Stefan Koch <uplink.coder googlemail.com> writes:
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.
I have just added a bit of code to modify the ast-nodes. It can also print a few stats about dmd. For example the names of the visitors implemented in dmd.
Nov 13 2016
parent reply Dicebot <public dicebot.lv> writes:
 protected-headers="v1"
From: Dicebot <public dicebot.lv>
Newsgroups: d,i,g,i,t,a,l,m,a,r,s,.,D
Subject: Re: {DMD-AST-Tool} For beginning DDMD hackers
References: <hgutlxngdoxeuufcqhjv forum.dlang.org>
 <nyqadvzvwtdudbuuhhda forum.dlang.org>
In-Reply-To: <nyqadvzvwtdudbuuhhda forum.dlang.org>

--BMntHqKhUujM6OmhkKtxliRLUoqMN3Cf0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 11/13/2016 10:40 AM, Stefan Koch 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-visito=
rs.
 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.
=20 I have just added a bit of code to modify the ast-nodes. It can also print a few stats about dmd. For example the names of the visitors implemented in dmd.
You may want to consider adding it to https://github.com/dlang/tools --BMntHqKhUujM6OmhkKtxliRLUoqMN3Cf0--
Nov 15 2016
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Tuesday, 15 November 2016 at 11:31:01 UTC, Dicebot wrote:
 You may want to consider adding it to 
 https://github.com/dlang/tools
Yes, I will make it a little more user friendly, then I'll raise a PR.
Nov 18 2016
prev sibling parent reply ANtlord <antlord92 gmail.com> writes:
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?
Nov 22 2016
parent Stefan Koch <uplink.coder googlemail.com> writes:
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.
Nov 22 2016