module reverseEdges debug; metamodel Graph : 'platform:/resource/TTC2011/metamodels/graph.ecore'; metamodel TRACE : 'http://www.eclipse.org/m2m/atl/emftvm/2011/Trace'; transform g : Graph, t : TRACE; -- Matches all edges that have not been transformed. abstract rule GraphEdge { from e : Graph!Edge not t : TRACE!SourceElement (object =~ e) to e : Graph!Edge, t : TRACE!SourceElement (object =~ e) } -- Reverses all connected edges. rule ReverseConnectedEdge extends GraphEdge { from e : Graph!Edge (src =~ n1, trg =~ n2), n1 : Graph!Node, n2 : Graph!Node to e : Graph!Edge (src =~ n2, trg =~ n1), n1 : Graph!Node, n2 : Graph!Node } -- Reverses all edges with only a src node. rule ReverseDanglingEdge1 extends GraphEdge { from e : Graph!Edge (src =~ n1), n1 : Graph!Node not e : Graph!Edge (trg =~ n1), n1 : Graph!Node to e : Graph!Edge (trg =~ n1), n1 : Graph!Node } -- Reverses all edges with only a trg node. rule ReverseDanglingEdge2 extends GraphEdge { from e : Graph!Edge (trg =~ n1), n1 : Graph!Node not e : Graph!Edge (src =~ n1), n1 : Graph!Node to e : Graph!Edge (src =~ n1), n1 : Graph!Node }