/*******************************************************************************
 * 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
 *******************************************************************************/
rule list2list
	transform
		forwardList : ForwardList!DoublyLinkedList
	to
		reverseList : ReverseList!DoublyLinkedList {
	reverseList.name = forwardList.name;
	reverseList.headElement ::= forwardList.headElement;
}

rule element2element
	transform
		forwardElement : ForwardList!Element
	to
		reverseElement : ReverseList!Element {
	reverseElement.name = forwardElement.name;
	reverseElement.list ::= forwardElement.list;
	reverseElement.source ::= forwardElement.target;
	reverseElement.target ::= forwardElement.source;
}