[Pharo-dev] Syntax Visualisation in the C# infrastructure

Clément Bera bera.clement at gmail.com
Sat Apr 5 22:38:54 EDT 2014


Yeah I use Roassal + Mondrian to visualize my intermediate representations
in the compiler and doing it for the AST is really simple (like 5 min of
work).

In addition the GTInspector view on trees/graph is really nice.

So basically we have all the tools they provide.


2014-04-05 17:56 GMT-07:00 Alexandre Bergel <alexandre.bergel at me.com>:

> I am not sure to what syntax visualization is useful for, but indeed, this
> is easy in Roassal
>
> Assuming a class MyVisitor, that simples collect the nodes of the AST.
>
> -=-=-=-=-=-=-=-=-=-=
> | ast visitor g |
> "We get the nodes from the AST"
> ast := RBParser parseMethod: (ArrayTest>>#testReplaceFromToWithStartingAt)
> getSource.
> visitor := MyVisitor new.
> ast acceptVisitor: visitor.
>
> "Visualization"
> g := RTGraphBuilder new.
> g node
> if: #isMessage shape: (RTEllipse new size: 10; color: Color red ) +
> (RTLabel new text: #selector);
>  if: #isReturn shape: (RTEllipse new size: 10; color: Color red );
> if: #isBlock shape: (RTBox new size: 10; color: Color blue );
> shape: (RTEllipse new size: 10; color: Color gray ).
> g layout use: RTTreeLayout new.
> g edge connectTo: #parent.
>
> g addAll: visitor nodes.
>
> g applyLayout.
> g view
> -=-=-=-=-=-=-=-=-=-=
>
>
> Cheers,
> Alexandre
>
>
> On Apr 4, 2014, at 4:34 AM, Goubier Thierry <thierry.goubier at cea.fr>
> wrote:
>
> It seems that Microsoft has opened interesting parts of the C# compilation
> infrastructure, including syntax visualisation.
>
>
> http://roslyn.codeplex.com/wikipage?title=Syntax%20Visualizer&referringTitle=Home
>
> Ideas for Opal+Roassal2 ?
>
> Thierry
> --
> Thierry Goubier
> CEA list
> Laboratoire des Fondations des Systèmes Temps Réel Embarqués
> 91191 Gif sur Yvette Cedex
> France
> Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20140405/21160725/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2014-04-05 at 9.56.35 PM.png
Type: image/png
Size: 141687 bytes
Desc: not available
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20140405/21160725/attachment.png>


More information about the Pharo-dev mailing list