Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext grammar to Java Code Generation(I write the grammar and also tested it. Now, I want to generate a java code from the grammar. I followed the documentation but things are very complicated.)
Xtext grammar to Java Code Generation [message #1823565] Sun, 29 March 2020 00:32 Go to next message
Eclipse UserFriend
This is my Grammar:
Model:
(videos+=video)*;
video:
name=ID "=" STRING ";";

and I want to generate a code based on the grammar that a string value is assigned to the variable. I just want to generate this code. Please guide me how can I do it. I am confused about what to write in the dslGenerator.xtend file.
Re: Xtext grammar to Java Code Generation [message #1823725 is a reply to message #1823565] Tue, 31 March 2020 14:59 Go to previous message
Eclipse UserFriend
The project creates a generator stub for you. Check the [YourDsl]Generator class as an entry point.
You can install one of the examples with File/New/Example. Maybe the Statemachine example is the best to start for you.
Also a valuable resource is Lorenzo Bettini's book on Xtext.
Previous Topic:Terminal with specific size
Next Topic:Grammar support
Goto Forum:
  


Current Time: Fri Jul 04 02:30:05 EDT 2025

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

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

Back to the top