Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Railroad image for grammar documentation
Railroad image for grammar documentation [message #1149628] Tue, 22 October 2013 07:44 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi all,

I wondered whether it is possible to generate a railroad image of a given
grammar on the fly.

What I've seen is the Spray project includes railroad images for it's
grammars in their user manual: https://spray.ci.cloudbees.com/job/spray-docs-build/lastSuccessfulBuild/artifact/docs/org.eclipselabs.spray.doc.user/docs/html/SprayUserGuide.html#TheSpraygrammars

During search I found the
org.eclipse.xtext.xtext.ui.graph.actions.ExportToFileAction class used by
the RailroadView. My guess would be that it is not easy to utilise this
functionality headlessly though.

So my question aims on best practices with regard to this. Does anybody have
experience with headless creation of these images? Or is it advantageous to
do the image exports manually to avoid excessive releng work?

Thanks in advance for your opinions,

Axel

[Updated on: Tue, 22 October 2013 07:46]

Report message to a moderator

Re: Railroad image for grammar documentation [message #1149647 is a reply to message #1149628] Tue, 22 October 2013 07:59 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

this already ships with Xtext.
(Have a look at Xtext Syntax Graph View)

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Railroad image for grammar documentation [message #1149696 is a reply to message #1149647] Tue, 22 October 2013 08:37 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi Christian,

thanks! I know that this included in Xtext. My question is whether and how this image export could also be used headlessly or would it be more adequate/easy/achievable to do this manually after each change in the grammar?

Axel

[Updated on: Tue, 22 October 2013 08:38]

Report message to a moderator

Re: Railroad image for grammar documentation [message #1149707 is a reply to message #1149696] Tue, 22 October 2013 08:47 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

i think it should be no problem to wrap the code (org.eclipse.xtext.xtext.ui.graph) into a own fragment.
(I dont know how easy it is to store a draw2d canvas as an image)

Maybe you can reuse parts of ExportToFileAction


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Tue, 22 October 2013 08:48]

Report message to a moderator

Previous Topic:Code generation problem
Next Topic:Xtend vs. Xpand?
Goto Forum:
  


Current Time: Thu Apr 18 02:49:13 GMT 2024

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

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

Back to the top