Using EVL in rekursive context [message #806818] |
Sat, 25 February 2012 14:40 |
Snakebyte Missing name Messages: 130 Registered: November 2011 |
Senior Member |
|
|
Hello everybody i got a problem using EVL.
I have an .emf model like this :
@gmf(foo="bar")
@namespace(uri="testmodel", prefix="testmodel")
package testmodel;
@gmf.diagram(onefile="true")
class Mainclass {
val NodeTypeOne[*] NodeTypeOneNodes;
val NodeTypeTwo[*] NodeTypeTwoNodes;
}
@gmf.node(figure="rectangle",label="identifier")
class NodeTypeOne{
attr String identifier;
@gmf.link(target.decoration="filledclosedarrow", color="0,0,0")
ref NodeTypeOne[*] NodeTypeOneRefsOfOne;
@gmf.link(target.decoration="filledclosedarrow", color="0,0,0")
ref NodeTypeTwo[*] NodeTypeTwoRefsOfOne;
}
@gmf.node(figure="rectangle",label="identifier")
class NodeTypeTwo{
attr String identifier;
@gmf.link(target.decoration="filledclosedarrow", color="0,0,0")
ref NodeTypeOne[*] NodeTypeOneRefsOfTwo;
}
What i want to do in EVL now is to add a cyclic check to this.
So i think i have to write a rekursive method, getting all children of a node, and rekursivly call itself on everychild until there are no more childs.
After all, the current node needs to check if any of this nodes references himself.
The problem is i have two different types of nodes and references. Can i make a typecheck in EVL in anyway ? Anybody has some ideas or sample code on how to implement such a check ?
Greetings
[Updated on: Sat, 25 February 2012 14:43] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03820 seconds