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.
50 lines
1.6 KiB
50 lines
1.6 KiB
6 years ago
|
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}->' | SHIFT = '-{Shift}->'
|
||
|
;
|
||
|
|
||
|
enum PortDirection returns seim::PortDirection:
|
||
|
UNSPECIFIED = 'unspec' | IN = 'in' | OUT = 'out' | INOUT = 'inout'
|
||
|
;
|
||
|
|
||
|
QualifiedID:
|
||
|
ID('.'ID)*
|
||
|
;
|