This project is a demonstrator of pattern instanciation on system engineering model (pseim), made by the MOISE project. It contains the metamodel of the pseim, graphical and textual editors, formal verification models (event-B) and examples.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

52 lines
1.7 KiB

grammar com.irtsaintexupery.xtext.pseim.Pattern with org.eclipse.xtext.common.Terminals
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.irt-saintexupery.com/seim/0.1" as seim
import "http://www.irt-saintexupery.com/pseim/0.1"
Pattern returns Pattern:
'pattern' name=ID '(' (cardinalityElements+=CardinalityElement (',' cardinalityElements+=CardinalityElement)*)? ')'
('{'
(
modelElements+=PatternComponent |
modelElements+=PatternLink
)*
'}')?;
PatternComponent returns PatternComponent:
'component' name=ID ('[' (multiplicityValue=INT | cardinalityElement=[CardinalityElement]) ']')? '(' (content+=PatternPort (',' content+=PatternPort)*)? ')'
('{'
(
content+=PatternComponent |
content+=PatternLink
)*
'}')?;
PatternPort returns PatternPort:
dir=PatternPortDirection name=ID ('[' (multiplicityValue=INT | cardinalityElement=[CardinalityElement]) ']')?
;
enum PatternPortDirection returns PatternPortDirection:
UNSPECIFIED = 'unspec' | IN = 'in' | OUT = 'out' | INOUT = 'inout';
CardinalityElement returns CardinalityElement:
name=ID
;
PatternLink returns PatternLink:
src=[PatternPort|QualifiedID] linkType=LinkType dst=[PatternPort|QualifiedID]
;
enum LinkType returns LinkType:
TRANSPOSE = '-{Transpose}->' | IDENTITY = '-{Identity}->' | FIRST = '-{First}->' | ROTATE = '-{Rotate}->'
| SHIFTC = '-{ShiftC}->' | SHIFTP = '-{ShiftP}->' | FLATTENC = '-{FlattenC}->' | FORKC = '-{ForkC}->' | FORKP = '-{ForkP}->'
| JOINC = '-{JoinC}->' | JOINP = '-{JoinP}->' | LAST = '-{Last}->'
;
enum PortDirection returns seim::PortDirection:
UNSPECIFIED = 'unspec' | IN = 'in' | OUT = 'out' | INOUT = 'inout'
;
QualifiedID:
ID('.'ID)*
;