Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Inserting copyright information in generated code
Inserting copyright information in generated code [message #760074] Thu, 01 December 2011 03:51 Go to next message
Eclipse UserFriend
Hi,

I am new to XText and created my grammer. I want to know how to configure Xtext to insert a copyright message when classes are generated when we run generate XText Artifacts command.

Thanks
Arvind
Re: Inserting copyright information in generated code [message #760828 is a reply to message #760074] Mon, 05 December 2011 06:56 Go to previous messageGo to next message
Eclipse UserFriend
The Xtext generator fires up a bunch of AbstractGeneratorFragment instances, each of which generate source (text) by means of an Xpand template file with the same name as the generator fragment's class. E.g., the (org.eclipse.xtext.generator.ecore.)EcoreGeneratorFragment class has an Xpand template EcoreGeneratorFragment.xpt next to it which does the actual (text) generation.

To override its behavior you can subclass the generator fragments whose generation behavior you need to customize and provide your own Xpand template which overrides the behavior of the original template in the desired way. More about this: http://dslmeinte.wordpress.com/2010/09/02/configuring-local-and-global-scope-providers-at-the-same-time/ It's written for Xtext 1.0.1 but still seems valid enough for current Xtext.
Re: Inserting copyright information in generated code [message #762794 is a reply to message #760828] Thu, 08 December 2011 11:20 Go to previous message
Eclipse UserFriend
Thanks for your reply. I will try this.

Thanks
Arvind
Previous Topic:[Xtend/mwe2] Disable model validation
Next Topic:Null Pointer Exception while opening xtext editor with a non workspace file
Goto Forum:
  


Current Time: Sun Jul 13 20:32:15 EDT 2025

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

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

Back to the top