Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » Resolving element references after injection
Resolving element references after injection [message #619469] Tue, 12 August 2008 20:56
Eclipse UserFriend
Originally posted by: mozafara.cs.man.ac.uk

Hi,
I am working on a project where I use TCS to transform textual syntax of
a DSL into a model, then the model is transformed into c++ code using
JET2 templates. JET loads the injected xmi file from TCS output and the
final code is generated by appropriate XPath queries embedded in jet
templates.
I have an issue with the way TCS serializes non-container references.
For example, take notice how the following km3 snippet is represented in
the model.

class Terminator {
reference nextstate : State;
}

the corresponding TCS template is:

template Terminator :
"nextstate" reference{refersTo=name}
;

after injection we get:
<terminator location="7:2-7:21" nextstate="//@process/@state.0"/>

the value of "nextstate" attribute is a reference to the the instance of
a "state" class in the serialized tree.
The big issue is that the expression is not XPath compatible and I have
to resort to ugly hacks to convert it into a valid path expression. The
XPath equivalent of the above example would be "//process/state[1]".

Is there a way to produce XPath friendly path references from TCS
injections? What does the current format stand for?
Previous Topic:[MOFScript] Aspect extension
Next Topic:Resolving element references after injection
Goto Forum:
  


Current Time: Fri Dec 19 10:08:26 GMT 2014

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

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