Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » SQL Beautifier ??
SQL Beautifier ?? [message #522469] Mon, 22 March 2010 17:47 Go to next message
MasterBoy  is currently offline MasterBoy Friend
Messages: 18
Registered: March 2010
Junior Member
Hi all,

I'm using xtext in a projet in wich i should generate a sql files.

but i have some design problem in my generated sql files.

i found that in a java file i can use JavaBeautifier and XmlBeautifier for xml files.. but what about the other files!!

should i developpe a beautifier for all my files!!!

best regards!
Re: SQL Beautifier ?? [message #522484 is a reply to message #522469] Mon, 22 March 2010 18:31 Go to previous messageGo to next message
Darius Jockel is currently offline Darius JockelFriend
Messages: 63
Registered: July 2009
Member
Hello MasterBoy,

Xpand is a text generation framework. It does not know a several "output-language". But Xpand provides default beautifier for the most common usecases (generating Java or XML).
The Xpand framework will not provide further beautifier because of:
-We think this is the work of other platforms like the Fornax platform (http://fornax.itemis.de/confluence/display/fornax/Formatter)
-Beautifier shiped with Xpand have to fulfill the Eclipse code policies
- and therefore we do not want to reimplement formatters (most of them are outside Eclipse).

Use your favorite beautifier instead. You can invoke it by implementing the PostProcessor Interface. Maybe you want to share your code and provide the component to the Fornax Platform?

Regards
Darius
Re: SQL Beautifier ?? [message #522601 is a reply to message #522484] Tue, 23 March 2010 10:34 Go to previous messageGo to next message
MasterBoy  is currently offline MasterBoy Friend
Messages: 18
Registered: March 2010
Junior Member
Thank you for your answer!
Yes i use Xpand for the code generation!

Have you a doc for this PostProcess because i didn't found a lot in the Net
Re: SQL Beautifier ?? [message #522703 is a reply to message #522601] Tue, 23 March 2010 16:28 Go to previous messageGo to next message
Darius Jockel is currently offline Darius JockelFriend
Messages: 63
Registered: July 2009
Member
Sorry for the late answer.

There are no good documentation about the PostProcessor.

Maybe it is a good idea to take a look at the sourcecode of an existing Beautifier like the xpand2.JavaBeautifier:
http:// dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2t/org.eclips e.xpand/plugins/org.eclipse.xpand/src/org/eclipse/xpand2/out put/JavaBeautifier.java?root=Modeling_Project&view=marku p

The interesting method is beforeWriteAndClose

Regards
Darius
Re: SQL Beautifier ?? [message #522858 is a reply to message #522703] Wed, 24 March 2010 08:57 Go to previous message
MasterBoy  is currently offline MasterBoy Friend
Messages: 18
Registered: March 2010
Junior Member
Thank u..
I'm gonna to take a look. And i well share my beautifier with all who maybe need it Wink

I just have another question!! is the beautifier necessary to format my text? i mean for exemple if i use an IF statement, and i want that my code be readable, i have to use a whitespace, so i have a lot of whitespaces in my generated text even if i put " - " :

   bla bla bla   
        «IFstatement-»
                      «IFstatement-»
                                 «IFstatement-»
                                 hi
                                «ELSEIF-»
                                 hi2
                                 «ENDIF»
                      «ENDIF»
	«ENDIF»
	(	
«ENDDEFINE»



The result is:
bla bla bla                                                     hi


there is a solution for this problem ?

Regards
Zakariae

[Updated on: Wed, 24 March 2010 09:40]

Report message to a moderator

Previous Topic:[JET] How to do like <c:dump select="var"/> but to a variable/string instead?
Next Topic:Use polymorphism with 2 xpand file
Goto Forum:
  


Current Time: Fri Apr 26 11:52:36 GMT 2024

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

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

Back to the top