// automatically generated by Xtext
grammar com.irtsaintexupery.xtext.pseim.Mapping with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.irit.fr/patterns/mapping/0.1" as mapping
import "http://www.irt-saintexupery.com/pseim/0.1" as pseim
import "http://www.irt-saintexupery.com/seim/0.1" as seim

PatternApplication returns mapping::PatternApplication:
	'transform' model=[seim::Model|ID] 'using' pattern=[pseim::Pattern|ID] '{'
		('multiplicity' cardinalityValues+=CardinalityValue (cardinalityValues+=CardinalityValue)* )?
		('components'  modelElement+=GraphElementMapping (modelElement+=GraphElementMapping)*)?
		('ports' portMapping+=PortMapping (portMapping+=PortMapping)*)?
	'}';

CardinalityValue returns mapping::CardinalityValue:
	cardinalityElement=[pseim::CardinalityElement|QualifiedID] '->' value=EInt;

PortMapping returns mapping::PortMapping:
	modelPort+=[seim::BorderElement|QualifiedID] (',' modelPort+=[seim::BorderElement|QualifiedID])*
	'->' 
	patternPort=[seim::BorderElement|QualifiedID];

GraphElementMapping returns mapping::GraphElementMapping:
	modelGraphElement+=[seim::GraphElement|QualifiedID] (',' modelGraphElement+=[seim::GraphElement|QualifiedID])*
	'->' 
	patternGraphElement=[seim::GraphElement|QualifiedID];

EInt returns ecore::EInt:
	'-'? INT;
	
QualifiedID:
	ID('.'ID)*	
;