Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » View AST of my grammar
View AST of my grammar [message #719026] Thu, 25 August 2011 20:39 Go to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
I have built a grammar out using Xtext and created an instance of this grammar. Everything works great! After my dsl instance is parsed into an abstract syntax tree according to my parser rules, is it possible to some sort of graphical representation of the tree? Similar to this: http://dslmeinte.files.wordpress.com/2010/08/blog2fig-exampleast1.png

If not, are there any tools out there that will let me do this? Thanks for the fantastic framework.
Re: View AST of my grammar [message #719154 is a reply to message #719026] Fri, 26 August 2011 08:34 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Well, the AST is an EMF model instance, so any graphical editing
framework for EMF should work (GMF, Graphiti), but will require some
extra work.

Creating a Graphviz .dot file, e.g. with Xtend2, should also be a no
brainer.

I've also implemented the prototype of a generic graphical view that
works fine with any kind of Java object model, but it's not ready to be
published yet.
http://koehnlein.blogspot.com/2011/06/using-xbase-to-define-generic-graphical.html

Am 25.08.11 22:39, schrieb john doe:
> I have built a grammar out using Xtext and created an instance of this
> grammar. Everything works great! After my dsl instance is parsed into an
> abstract syntax tree according to my parser rules, is it possible to
> some sort of graphical representation of the tree? Similar to this:
> http://dslmeinte.files.wordpress.com/2010/08/blog2fig-exampleast1.png
>
> If not, are there any tools out there that will let me do this? Thanks
> for the fantastic framework.


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: View AST of my grammar [message #719155 is a reply to message #719026] Fri, 26 August 2011 08:35 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi John,

you could try to open your *.yourdsl file with the Sample Reflective
Ecore Editor and browse the semantic tree there.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 25.08.11 22:39, john doe wrote:
> I have built a grammar out using Xtext and created an instance of this
> grammar. Everything works great! After my dsl instance is parsed into an
> abstract syntax tree according to my parser rules, is it possible to
> some sort of graphical representation of the tree? Similar to this:
> http://dslmeinte.files.wordpress.com/2010/08/blog2fig-exampleast1.png
>
> If not, are there any tools out there that will let me do this? Thanks
> for the fantastic framework.
Re: View AST of my grammar [message #719209 is a reply to message #719155] Fri, 26 August 2011 12:03 Go to previous messageGo to next message
john doe is currently offline john doeFriend
Messages: 74
Registered: June 2011
Member
@Sebastian yep I tried that. But I was looking for something a little more flash.

@Jan I did some searching on Google, but I can't find an example of how to do what you outline

> Creating a Graphviz .dot file, e.g. with Xtend2, should also be a no
> brainer.

Do you know of any examples?

P.S that's a great looking prototype you're working on. Pity it's not publishable just yet... Smile

Thanks for the help
Re: View AST of my grammar [message #719828 is a reply to message #719209] Mon, 29 August 2011 06:58 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Moritz uses Graphviz a lot to debug the serializer components of Xtext.
Have a look at
org.eclipse.xtext.util.GraphvizDotBuilder

Am 26.08.11 14:03, schrieb john doe:
> @Sebastian yep I tried that. But I was looking for something a little
> more flash.
>
> @Jan I did some searching on Google, but I can't find an example of how
> to do what you outline
>
>> Creating a Graphviz .dot file, e.g. with Xtend2, should also be a no
>> brainer.
>
> Do you know of any examples?
>
> P.S that's a great looking prototype you're working on. Pity it's not
> publishable just yet... :)
>
> Thanks for the help


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Configure postprocessor for xtext2 generator in the MWE2 workflow?
Next Topic:[Xtend] Cannot refer to a non-final variable ... inside an inner class
Goto Forum:
  


Current Time: Fri Mar 29 01:51:25 GMT 2024

Powered by FUDForum. Page generated in 0.03637 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top