Commit a3370dc0 authored by Arnaud Dieumegard's avatar Arnaud Dieumegard

Factorization of Link type grammar rule. Regenerated code.

parent fd7c2de5
...@@ -70,8 +70,8 @@ public class PatternParser extends AbstractContentAssistParser { ...@@ -70,8 +70,8 @@ public class PatternParser extends AbstractContentAssistParser {
put(grammarAccess.getPatternPortAccess().getCardinalityElementAssignment_2_1_1(), "rule__PatternPort__CardinalityElementAssignment_2_1_1"); put(grammarAccess.getPatternPortAccess().getCardinalityElementAssignment_2_1_1(), "rule__PatternPort__CardinalityElementAssignment_2_1_1");
put(grammarAccess.getCardinalityElementAccess().getNameAssignment(), "rule__CardinalityElement__NameAssignment"); put(grammarAccess.getCardinalityElementAccess().getNameAssignment(), "rule__CardinalityElement__NameAssignment");
put(grammarAccess.getPatternLinkAccess().getSrcAssignment_0(), "rule__PatternLink__SrcAssignment_0"); put(grammarAccess.getPatternLinkAccess().getSrcAssignment_0(), "rule__PatternLink__SrcAssignment_0");
put(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_1(), "rule__PatternLink__LinkTypeAssignment_1"); put(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_2(), "rule__PatternLink__LinkTypeAssignment_2");
put(grammarAccess.getPatternLinkAccess().getDstAssignment_2(), "rule__PatternLink__DstAssignment_2"); put(grammarAccess.getPatternLinkAccess().getDstAssignment_4(), "rule__PatternLink__DstAssignment_4");
} }
}; };
} }
......
...@@ -355,73 +355,73 @@ rule__LinkType__Alternatives ...@@ -355,73 +355,73 @@ rule__LinkType__Alternatives
: :
( (
{ before(grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0()); } { before(grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0()); }
('-{Transpose}->') ('Transpose')
{ after(grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0()); } { after(grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1()); } { before(grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1()); }
('-{Identity}->') ('Identity')
{ after(grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1()); } { after(grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2()); } { before(grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2()); }
('-{First}->') ('First')
{ after(grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2()); } { after(grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3()); } { before(grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3()); }
('-{Rotate}->') ('Rotate')
{ after(grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3()); } { after(grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4()); } { before(grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4()); }
('-{ShiftC}->') ('ShiftC')
{ after(grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4()); } { after(grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5()); } { before(grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5()); }
('-{ShiftP}->') ('ShiftP')
{ after(grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5()); } { after(grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6()); } { before(grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6()); }
('-{FlattenC}->') ('FlattenC')
{ after(grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6()); } { after(grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7()); } { before(grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7()); }
('-{ForkC}->') ('ForkC')
{ after(grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7()); } { after(grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8()); } { before(grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8()); }
('-{ForkP}->') ('ForkP')
{ after(grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8()); } { after(grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9()); } { before(grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9()); }
('-{JoinC}->') ('JoinC')
{ after(grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9()); } { after(grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10()); } { before(grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10()); }
('-{JoinP}->') ('JoinP')
{ after(grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10()); } { after(grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10()); }
) )
| |
( (
{ before(grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11()); } { before(grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11()); }
('-{Last}->') ('Last')
{ after(grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11()); } { after(grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11()); }
) )
; ;
...@@ -1446,9 +1446,9 @@ rule__PatternLink__Group__1__Impl ...@@ -1446,9 +1446,9 @@ rule__PatternLink__Group__1__Impl
} }
: :
( (
{ before(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_1()); } { before(grammarAccess.getPatternLinkAccess().getHyphenMinusHyphenMinusLeftCurlyBracketKeyword_1()); }
(rule__PatternLink__LinkTypeAssignment_1) '--{'
{ after(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_1()); } { after(grammarAccess.getPatternLinkAccess().getHyphenMinusHyphenMinusLeftCurlyBracketKeyword_1()); }
) )
; ;
finally { finally {
...@@ -1461,6 +1461,7 @@ rule__PatternLink__Group__2 ...@@ -1461,6 +1461,7 @@ rule__PatternLink__Group__2
} }
: :
rule__PatternLink__Group__2__Impl rule__PatternLink__Group__2__Impl
rule__PatternLink__Group__3
; ;
finally { finally {
restoreStackSize(stackSize); restoreStackSize(stackSize);
...@@ -1472,9 +1473,62 @@ rule__PatternLink__Group__2__Impl ...@@ -1472,9 +1473,62 @@ rule__PatternLink__Group__2__Impl
} }
: :
( (
{ before(grammarAccess.getPatternLinkAccess().getDstAssignment_2()); } { before(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_2()); }
(rule__PatternLink__DstAssignment_2) (rule__PatternLink__LinkTypeAssignment_2)
{ after(grammarAccess.getPatternLinkAccess().getDstAssignment_2()); } { after(grammarAccess.getPatternLinkAccess().getLinkTypeAssignment_2()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__PatternLink__Group__3
@init {
int stackSize = keepStackSize();
}
:
rule__PatternLink__Group__3__Impl
rule__PatternLink__Group__4
;
finally {
restoreStackSize(stackSize);
}
rule__PatternLink__Group__3__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getPatternLinkAccess().getRightCurlyBracketHyphenMinusGreaterThanSignKeyword_3()); }
'}->'
{ after(grammarAccess.getPatternLinkAccess().getRightCurlyBracketHyphenMinusGreaterThanSignKeyword_3()); }
)
;
finally {
restoreStackSize(stackSize);
}
rule__PatternLink__Group__4
@init {
int stackSize = keepStackSize();
}
:
rule__PatternLink__Group__4__Impl
;
finally {
restoreStackSize(stackSize);
}
rule__PatternLink__Group__4__Impl
@init {
int stackSize = keepStackSize();
}
:
(
{ before(grammarAccess.getPatternLinkAccess().getDstAssignment_4()); }
(rule__PatternLink__DstAssignment_4)
{ after(grammarAccess.getPatternLinkAccess().getDstAssignment_4()); }
) )
; ;
finally { finally {
...@@ -1872,34 +1926,34 @@ finally { ...@@ -1872,34 +1926,34 @@ finally {
restoreStackSize(stackSize); restoreStackSize(stackSize);
} }
rule__PatternLink__LinkTypeAssignment_1 rule__PatternLink__LinkTypeAssignment_2
@init { @init {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
} }
: :
( (
{ before(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_1_0()); } { before(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_2_0()); }
ruleLinkType ruleLinkType
{ after(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_1_0()); } { after(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_2_0()); }
) )
; ;
finally { finally {
restoreStackSize(stackSize); restoreStackSize(stackSize);
} }
rule__PatternLink__DstAssignment_2 rule__PatternLink__DstAssignment_4
@init { @init {
int stackSize = keepStackSize(); int stackSize = keepStackSize();
} }
: :
( (
{ before(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_2_0()); } { before(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_4_0()); }
( (
{ before(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_2_0_1()); } { before(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_4_0_1()); }
ruleQualifiedID ruleQualifiedID
{ after(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_2_0_1()); } { after(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_4_0_1()); }
) )
{ after(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_2_0()); } { after(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_4_0()); }
) )
; ;
finally { finally {
......
'('=28 '('=28
')'=29 ')'=29
','=30 ','=30
'-{First}->'=17 '--{'=36
'-{FlattenC}->'=21 '.'=38
'-{ForkC}->'=22 'First'=17
'-{ForkP}->'=23 'FlattenC'=21
'-{Identity}->'=16 'ForkC'=22
'-{JoinC}->'=24 'ForkP'=23
'-{JoinP}->'=25 'Identity'=16
'-{Last}->'=26 'JoinC'=24
'-{Rotate}->'=18 'JoinP'=25
'-{ShiftC}->'=19 'Last'=26
'-{ShiftP}->'=20 'Rotate'=18
'-{Transpose}->'=15 'ShiftC'=19
'.'=36 'ShiftP'=20
'Transpose'=15
'['=34 '['=34
']'=35 ']'=35
'component'=33 'component'=33
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
'unspec'=11 'unspec'=11
'{'=31 '{'=31
'}'=32 '}'=32
'}->'=37
RULE_ANY_OTHER=10 RULE_ANY_OTHER=10
RULE_ID=4 RULE_ID=4
RULE_INT=5 RULE_INT=5
...@@ -57,3 +59,5 @@ T__33=33 ...@@ -57,3 +59,5 @@ T__33=33
T__34=34 T__34=34
T__35=35 T__35=35
T__36=36 T__36=36
T__37=37
T__38=38
...@@ -564,12 +564,16 @@ rulePatternLink returns [EObject current=null] ...@@ -564,12 +564,16 @@ rulePatternLink returns [EObject current=null]
} }
) )
) )
otherlv_1='--{'
{
newLeafNode(otherlv_1, grammarAccess.getPatternLinkAccess().getHyphenMinusHyphenMinusLeftCurlyBracketKeyword_1());
}
( (
( (
{ {
newCompositeNode(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_1_0()); newCompositeNode(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_2_0());
} }
lv_linkType_1_0=ruleLinkType lv_linkType_2_0=ruleLinkType
{ {
if ($current==null) { if ($current==null) {
$current = createModelElementForParent(grammarAccess.getPatternLinkRule()); $current = createModelElementForParent(grammarAccess.getPatternLinkRule());
...@@ -577,12 +581,16 @@ rulePatternLink returns [EObject current=null] ...@@ -577,12 +581,16 @@ rulePatternLink returns [EObject current=null]
set( set(
$current, $current,
"linkType", "linkType",
lv_linkType_1_0, lv_linkType_2_0,
"com.irtsaintexupery.xtext.pseim.Pattern.LinkType"); "com.irtsaintexupery.xtext.pseim.Pattern.LinkType");
afterParserOrEnumRuleCall(); afterParserOrEnumRuleCall();
} }
) )
) )
otherlv_3='}->'
{
newLeafNode(otherlv_3, grammarAccess.getPatternLinkAccess().getRightCurlyBracketHyphenMinusGreaterThanSignKeyword_3());
}
( (
( (
{ {
...@@ -591,7 +599,7 @@ rulePatternLink returns [EObject current=null] ...@@ -591,7 +599,7 @@ rulePatternLink returns [EObject current=null]
} }
} }
{ {
newCompositeNode(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_2_0()); newCompositeNode(grammarAccess.getPatternLinkAccess().getDstPatternPortCrossReference_4_0());
} }
ruleQualifiedID ruleQualifiedID
{ {
...@@ -695,7 +703,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -695,7 +703,7 @@ ruleLinkType returns [Enumerator current=null]
}: }:
( (
( (
enumLiteral_0='-{Transpose}->' enumLiteral_0='Transpose'
{ {
$current = grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_0, grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0()); newLeafNode(enumLiteral_0, grammarAccess.getLinkTypeAccess().getTRANSPOSEEnumLiteralDeclaration_0());
...@@ -703,7 +711,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -703,7 +711,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_1='-{Identity}->' enumLiteral_1='Identity'
{ {
$current = grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_1, grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1()); newLeafNode(enumLiteral_1, grammarAccess.getLinkTypeAccess().getIDENTITYEnumLiteralDeclaration_1());
...@@ -711,7 +719,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -711,7 +719,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_2='-{First}->' enumLiteral_2='First'
{ {
$current = grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_2, grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2()); newLeafNode(enumLiteral_2, grammarAccess.getLinkTypeAccess().getFIRSTEnumLiteralDeclaration_2());
...@@ -719,7 +727,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -719,7 +727,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_3='-{Rotate}->' enumLiteral_3='Rotate'
{ {
$current = grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_3, grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3()); newLeafNode(enumLiteral_3, grammarAccess.getLinkTypeAccess().getROTATEEnumLiteralDeclaration_3());
...@@ -727,7 +735,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -727,7 +735,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_4='-{ShiftC}->' enumLiteral_4='ShiftC'
{ {
$current = grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_4, grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4()); newLeafNode(enumLiteral_4, grammarAccess.getLinkTypeAccess().getSHIFTCEnumLiteralDeclaration_4());
...@@ -735,7 +743,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -735,7 +743,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_5='-{ShiftP}->' enumLiteral_5='ShiftP'
{ {
$current = grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_5, grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5()); newLeafNode(enumLiteral_5, grammarAccess.getLinkTypeAccess().getSHIFTPEnumLiteralDeclaration_5());
...@@ -743,7 +751,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -743,7 +751,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_6='-{FlattenC}->' enumLiteral_6='FlattenC'
{ {
$current = grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_6, grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6()); newLeafNode(enumLiteral_6, grammarAccess.getLinkTypeAccess().getFLATTENCEnumLiteralDeclaration_6());
...@@ -751,7 +759,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -751,7 +759,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_7='-{ForkC}->' enumLiteral_7='ForkC'
{ {
$current = grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_7, grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7()); newLeafNode(enumLiteral_7, grammarAccess.getLinkTypeAccess().getFORKCEnumLiteralDeclaration_7());
...@@ -759,7 +767,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -759,7 +767,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_8='-{ForkP}->' enumLiteral_8='ForkP'
{ {
$current = grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_8, grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8()); newLeafNode(enumLiteral_8, grammarAccess.getLinkTypeAccess().getFORKPEnumLiteralDeclaration_8());
...@@ -767,7 +775,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -767,7 +775,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_9='-{JoinC}->' enumLiteral_9='JoinC'
{ {
$current = grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_9, grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9()); newLeafNode(enumLiteral_9, grammarAccess.getLinkTypeAccess().getJOINCEnumLiteralDeclaration_9());
...@@ -775,7 +783,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -775,7 +783,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_10='-{JoinP}->' enumLiteral_10='JoinP'
{ {
$current = grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_10, grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10()); newLeafNode(enumLiteral_10, grammarAccess.getLinkTypeAccess().getJOINPEnumLiteralDeclaration_10());
...@@ -783,7 +791,7 @@ ruleLinkType returns [Enumerator current=null] ...@@ -783,7 +791,7 @@ ruleLinkType returns [Enumerator current=null]
) )
| |
( (
enumLiteral_11='-{Last}->' enumLiteral_11='Last'
{ {
$current = grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11().getEnumLiteral().getInstance(); $current = grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11().getEnumLiteral().getInstance();
newLeafNode(enumLiteral_11, grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11()); newLeafNode(enumLiteral_11, grammarAccess.getLinkTypeAccess().getLASTEnumLiteralDeclaration_11());
......
'('=12 '('=12
')'=14 ')'=14
','=13 ','=13
'-{First}->'=27 '--{'=20
'-{FlattenC}->'=31 '.'=22
'-{ForkC}->'=32 'First'=29
'-{ForkP}->'=33 'FlattenC'=33
'-{Identity}->'=26 'ForkC'=34
'-{JoinC}->'=34 'ForkP'=35
'-{JoinP}->'=35 'Identity'=28
'-{Last}->'=36 'JoinC'=36
'-{Rotate}->'=28 'JoinP'=37
'-{ShiftC}->'=29 'Last'=38
'-{ShiftP}->'=30 'Rotate'=30
'-{Transpose}->'=25 'ShiftC'=31
'.'=20 'ShiftP'=32
'Transpose'=27
'['=18 '['=18
']'=19 ']'=19
'component'=17 'component'=17
'in'=22 'in'=24
'inout'=24 'inout'=26
'out'=23 'out'=25
'pattern'=11 'pattern'=11
'unspec'=21 'unspec'=23
'{'=15 '{'=15
'}'=16 '}'=16
'}->'=21
RULE_ANY_OTHER=10 RULE_ANY_OTHER=10
RULE_ID=4 RULE_ID=4
RULE_INT=5 RULE_INT=5
...@@ -57,3 +59,5 @@ T__33=33 ...@@ -57,3 +59,5 @@ T__33=33
T__34=34 T__34=34
T__35=35 T__35=35
T__36=36 T__36=36
T__37=37
T__38=38
...@@ -111,8 +111,8 @@ public class PatternSemanticSequencer extends AbstractDelegatingSemanticSequence ...@@ -111,8 +111,8 @@ public class PatternSemanticSequencer extends AbstractDelegatingSemanticSequence
} }
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getPatternLinkAccess().getSrcPatternPortQualifiedIDParserRuleCall_0_0_1(), semanticObject.eGet(SeimPackage.Literals.LINK__SRC, false)); feeder.accept(grammarAccess.getPatternLinkAccess().getSrcPatternPortQualifiedIDParserRuleCall_0_0_1(), semanticObject.eGet(SeimPackage.Literals.LINK__SRC, false));
feeder.accept(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_1_0(), semanticObject.getLinkType()); feeder.accept(grammarAccess.getPatternLinkAccess().getLinkTypeLinkTypeEnumRuleCall_2_0(), semanticObject.getLinkType());
feeder.accept(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_2_0_1(), semanticObject.eGet(SeimPackage.Literals.LINK__DST, false)); feeder.accept(grammarAccess.getPatternLinkAccess().getDstPatternPortQualifiedIDParserRuleCall_4_0_1(), semanticObject.eGet(SeimPackage.Literals.LINK__DST, false));
feeder.finish(); feeder.finish();
} }
......
...@@ -34,13 +34,13 @@ CardinalityElement returns CardinalityElement: ...@@ -34,13 +34,13 @@ CardinalityElement returns CardinalityElement:
; ;
PatternLink returns PatternLink: PatternLink returns PatternLink:
src=[PatternPort|QualifiedID] linkType=LinkType dst=[PatternPort|QualifiedID] src=[PatternPort|QualifiedID] '--{' linkType=LinkType '}->' dst=[PatternPort|QualifiedID]
; ;
enum LinkType returns LinkType: enum LinkType returns LinkType:
TRANSPOSE = '-{Transpose}->' | IDENTITY = '-{Identity}->' | FIRST = '-{First}->' | ROTATE = '-{Rotate}->' TRANSPOSE = 'Transpose' | IDENTITY = 'Identity' | FIRST = 'First' | ROTATE = 'Rotate'
| SHIFTC = '-{ShiftC}->' | SHIFTP = '-{ShiftP}->' | FLATTENC = '-{FlattenC}->' | FORKC = '-{ForkC}->' | FORKP = '-{ForkP}->' | SHIFTC = 'ShiftC' | SHIFTP = 'ShiftP' | FLATTENC = 'FlattenC' | FORKC = 'ForkC' | FORKP = 'ForkP'
| JOINC = '-{JoinC}->' | JOINP = '-{JoinP}->' | LAST = '-{Last}->' | JOINC = 'JoinC' | JOINP = 'JoinP' | LAST = 'Last'
; ;
enum PortDirection returns seim::PortDirection: enum PortDirection returns seim::PortDirection:
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
*/ */
package com.irtsaintexupery.xtext.pseim.validation package com.irtsaintexupery.xtext.pseim.validation
import com.irtsaintexupery.pseim.pseim.Pattern
import org.eclipse.xtext.validation.Check
/** /**
* This class contains custom validation rules. * This class contains custom validation rules.
...@@ -22,4 +24,17 @@ class PatternValidator extends AbstractPatternValidator { ...@@ -22,4 +24,17 @@ class PatternValidator extends AbstractPatternValidator {
// } // }
// } // }
@Check
def checkPattern(Pattern p) {
// Static checking
// Check if there exists a solution for the set of constraints induced by the pattern model (all links + constraints)
// Warning: Two variables are necessarily identical -> Potential error as there is redundancy in the variables
// -> Maybe it is not an error as in creates different interfaces for the pattern
// Global arithmetic constraints may be added to the pattern language (no need for now)
// TODO Dynamic synthesis (in the Mapping MM validator)
// A synthesis tool synthesizes a solution for the mapping
// If there is no solution, then the mapping is not correct
// In both cases, we need a bridge between our model and a solver
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment