Hi Mark, Le 29/06/2015 18:04, Mark Rizun a écrit :
Hi, everyone!
When I was exploring AST in Pharo, at the beginning it seemed a bit confusing for me how the tree looks like, or which part of code some node represents etc. As I'm working with ASTs for a while now, still not an expert ;), I decided to make a simple AST Inspector for myself and everyone that needs it. Hopefully, this inspector will make peoples lives easier when learning ASTs. For now its very raw. Inspector shows the code and its AST representation visually like in the picture.
Cool. Need a bit of anti-aliasing for the round shapes :) I wonder how it will look with a long method: they usually have rather flat ASTs that would result in a wide diagram.
Also you can select/deselect a nodes of AST an see which part of code it represents (like in the picture above). Functionality ends here :) What do you think about it? Maybe you guys have some cool ideas for this inspector?
I used that kind of inspector a lot for my work, but I usually just represent the tree as a normal tree node morph (and with the exact select the node => select the source). Some of the added ones I use is showing the CFG (control flow graph), eventually a SSA (Single Signed Assignment) or IR. I tend to base them on the SmaCC AST API, so like that they work with all programming languages, not only Smalltalk. I tried to use GT-Inspector for that but it didn't work. Thierry
<http://forum.world.st/file/n4834638/AST_Inspector.png>
Cheers, Mark
-- View this message in context: http://forum.world.st/AST-Inspector-tp4834638.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.