Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Railroad image for grammar documentation
Railroad image for grammar documentation [message #1149628] Tue, 22 October 2013 03:44 Go to next message
Eclipse UserFriend
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 03:46] by Moderator

Re: Railroad image for grammar documentation [message #1149647 is a reply to message #1149628] Tue, 22 October 2013 03:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

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

~Christian
Re: Railroad image for grammar documentation [message #1149696 is a reply to message #1149647] Tue, 22 October 2013 04:37 Go to previous messageGo to next message
Eclipse UserFriend
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 04:38] by Moderator

Re: Railroad image for grammar documentation [message #1149707 is a reply to message #1149696] Tue, 22 October 2013 04:47 Go to previous message
Eclipse UserFriend
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

[Updated on: Tue, 22 October 2013 04:48] by Moderator

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


Current Time: Sun Jul 13 18:33:57 EDT 2025

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

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

Back to the top