XPand for modifying arbitrary textfiles! [message #527910] |
Fri, 16 April 2010 21:39 |
Miles Parker 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.
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..
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03713 seconds