blob: b05036c616206cc1d3c71a8566e884bba15aee83 [file] [log] [blame]
--******************************************************************************
--* Copyright (c) 2016 University of York
--* All rights reserved. This program and the accompanying materials
--* are made available under the terms of the Eclipse Public License v2.0
--* which accompanies this distribution, and is available at
--* http://www.eclipse.org/legal/epl-v20.html
--*
--* Contributors:
--* Horacio Hoyos - Initial API and implementation
--*******************************************************************************/
module Forward2Reverse;
create OUT : ReverseList from IN : ForwardList;
rule list2list {
from
forwardList : ForwardList!DoublyLinkedList
to
reverseList : ReverseList!DoublyLinkedList (
name <- forwardList.name,
headElement <- forwardList.headElement
)
}
rule element2element {
from
forwardElement : ForwardList!Element
to
reverseElement : ReverseList!Element (
name <- forwardElement.name,
list <- forwardElement.list,
source <- forwardElement.target
)
}