Factorization of Link type grammar rule. Regenerated code.

This commit is contained in:
Arnaud Dieumegard
2019-01-17 11:04:12 +01:00
parent fd7c2de530
commit a3370dc0c7
16 changed files with 2202 additions and 888 deletions

View File

@@ -34,13 +34,13 @@ CardinalityElement returns CardinalityElement:
;
PatternLink returns PatternLink:
src=[PatternPort|QualifiedID] linkType=LinkType dst=[PatternPort|QualifiedID]
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}->'
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:

View File

@@ -3,6 +3,8 @@
*/
package com.irtsaintexupery.xtext.pseim.validation
import com.irtsaintexupery.pseim.pseim.Pattern
import org.eclipse.xtext.validation.Check
/**
* This class contains custom validation rules.
@@ -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
}
}