Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » XPand for modifying arbitrary textfiles!
XPand for modifying arbitrary textfiles! [message #527910] Fri, 16 April 2010 21:39 Go to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Hi guys,

I wonder if this use case has occurred to you.. It seems like Xpand could with little (or no) additions to the language be used for modifying existing text documents. For example, I have written a bunch of documentation for an ecore model and it would be nice to have a way to weave this back into the genmodel descriptions themselves. Now, I guess I could use some kin of shell script with regexp and so on to accomplish this, but that's too *nix nerdy (hard) for me. Smile

Imagine having an EXPAND keyword that allowed the specification of a regexp for an input parser. That parser would then simply call invoke the EXPAND with the contents of any captures which you could refer to through targetDef or whatever. So in this example, I could search for the appropriate block of XML text and then use the capture of the id bit to locate the definition I want from my documentation meta-model (as interpreted by XText, of course). Voila, instant weaving with arbitrary text files.. Very Happy

Of course, I am sure that there would be a few pesky details involved.. There might even be away to use AROUND advice for this instead of using EXPAND statements directly..

cheers,

Miles
Re: XPand for modifying arbitrary textfiles! [message #528110 is a reply to message #527910] Mon, 19 April 2010 11:43 Go to previous message
Darius Jockel is currently offline Darius JockelFriend
Messages: 63
Registered: July 2009
Member
Hello Miles,

what about using Xtext to parse your documents and generating text from it?

Regards
Darius
Previous Topic:[Xtend] apply a function with multiple arguments on all elements of a list
Next Topic:Recommended approach for generating XHTML from model data at runtime - XSLT/Xpand/?
Goto Forum:
  


Current Time: Tue Apr 23 07:43:12 GMT 2024

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

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

Back to the top