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

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

Model returns Model:
	'model'	name=EString ('{'
		(modelElements+=GraphElement)*
	'}')?;

Component returns Component:
	'component' name=ID '(' (content+=Port (',' content+=Port)*)? ')' ('{'
		(content+=GraphElement)*
	'}')?;

Port returns Port:
	direction=PortDirection name=ID
	;

Link returns Link:
	src=[Port|QualifiedID] '->' dst=[Port|QualifiedID]
	;

enum PortDirection returns PortDirection:
				UNSPECIFIED = 'unspec' | IN = 'in' | OUT = 'out' | INOUT = 'inout';
				
Property returns Property:
	IntegerProperty | StringProperty | BooleanProperty | ReferenceProperty;

GraphElement returns GraphElement:
	Component | Link;

PropertyHolder returns PropertyHolder:
	Component | Port | Link | Model;

Element returns Element:
	Component | Port | Link;

QualifiedID:
	ID('.'ID)*	
;

EString returns ecore::EString:
	STRING | ID;

IntegerProperty returns IntegerProperty:
	'IntegerProperty'
	'{'
		'key' key=EString
		'value' value=EInt
	'}';

StringProperty returns StringProperty:
	'StringProperty'
	'{'
		'key' key=EString
		'value' value=EString
	'}';

BooleanProperty returns BooleanProperty:
	value?='value'
	'BooleanProperty'
	'{'
		'key' key=EString
	'}';

ReferenceProperty returns ReferenceProperty:
	'ReferenceProperty'
	'{'
		'key' key=EString
		'ref' ref=[PropertyHolder|EString]
	'}';

EInt returns ecore::EInt:
	'-'? INT;

EBoolean returns ecore::EBoolean:
	'true' | 'false';