Commit 896cb7b8 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added support for constraints and enums (old grammar)

parent 7902f73f
Loading
Loading
Loading
Loading
+53 −5
Original line number Diff line number Diff line
@@ -241,9 +241,9 @@ CollectionReference returns tdl::MemberReference:
	;


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

BoundedLoopBehaviour returns tdl::BoundedLoopBehaviour:
	'repeat'
@@ -494,6 +494,7 @@ ProcedureSignature returns tdl::ProcedureSignature:
    //'Structured' 'Data' 'Type'
    'Signature'
    name=Identifier
    ('{' constraint+=Constraint '}')* 
    ('(' parameter+=ProcedureParameter ( "," parameter+=ProcedureParameter)* ')')?
    (
    'with'
@@ -524,6 +525,7 @@ CollectionDataType returns tdl::CollectionDataType:
    //'Structured' 'Data' 'Type'
    'Collection'
    name=Identifier
    ('{' constraint+=Constraint '}')* 
    'of' 'type'
    itemType=[tdl::DataType|Identifier]
    (
@@ -832,6 +834,7 @@ MappableDataElement returns tdl::MappableDataElement:
Member returns tdl::Member:
	(isOptional?='optional')?
	name=Identifier
	('{' constraint+=Constraint '}')* 
	'of' 'type'
	dataType=[tdl::DataType|Identifier]
    (
@@ -902,7 +905,7 @@ OptionalBehaviour returns tdl::OptionalBehaviour:

PackageableElement returns tdl::PackageableElement:
//	AnnotationType | TestObjective | DataResourceMapping | DataElementMapping | SimpleDataType_Impl | SimpleDataInstance_Impl | StructuredDataType | StructuredDataInstance | Action_Impl | Function | Verdict | ComponentType | GateType | Time | TimeLabel | TestConfiguration | TestDescription;
	AnnotationType | TestObjective | DataResourceMapping | DataElementMapping | SimpleDataType_Impl | SimpleDataInstance_Impl | StructuredDataType | StructuredDataInstance | Action_Impl | Function | ComponentType | GateType | Time | TestConfiguration | TestDescription | CollectionDataType | CollectionDataInstance | ProcedureSignature | PredefinedFunction;
	AnnotationType | TestObjective | DataResourceMapping | DataElementMapping | SimpleDataType_Impl | SimpleDataInstance_Impl | StructuredDataType | StructuredDataInstance | Action_Impl | Function | ComponentType | GateType | Time | TestConfiguration | TestDescription | CollectionDataType | CollectionDataInstance | ProcedureSignature | PredefinedFunction | ConstraintType | EnumDataType;

ParallelBehaviour returns tdl::ParallelBehaviour:
	'run' block+=Block ('in' 'parallel' 'to' block+=Block)* 
@@ -1018,6 +1021,7 @@ SimpleDataType_Impl returns tdl::SimpleDataType:
	//'Simple' 'Data' 'Type'
	'Type'
	name=Identifier
	('{' constraint+=Constraint '}')* 
	 (
    'with'
    '{'
@@ -1073,6 +1077,7 @@ StructuredDataType returns tdl::StructuredDataType:
	//'Structured' 'Data' 'Type'
	'Type'
	name=Identifier
    ('{' constraint+=Constraint '}')* 
	(extension=Extension)?
	'(' ( member+=Member ( "," member+=Member)* )? ')'
   	(
@@ -1203,6 +1208,7 @@ Time returns tdl::Time:
	{tdl::Time}
	'Time'
	name=Identifier
    ('{' constraint+=Constraint '}')* 
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
@@ -1400,7 +1406,7 @@ Extension returns tdl::Extension:

LiteralValueUse returns tdl::LiteralValueUse:
	{tdl::LiteralValueUse}
	value=String0
    (value=NumberAsIdentifier | value=STRING | intValue=BIGINTEGER | boolValue=BOOLEAN)
	(
 		'of' 'type' dataType=[tdl::DataType|Identifier]
	)?
@@ -1412,4 +1418,46 @@ LiteralValueUse returns tdl::LiteralValueUse:
    '}')?
	;

ConstraintType returns tdl::ConstraintType: 
    'Constraint' name=Identifier
    ('with'
    '{'
        comment+=Comment*
        annotation+=Annotation*
    '}')?
    ';'
;

    
Constraint returns tdl::Constraint: 
    type=[tdl::ConstraintType|Identifier]
    (':' quantifier+=LiteralValueUse (',' quantifier+=LiteralValueUse)* )?
    ('with'
    '{'
        comment+=Comment*
        annotation+=Annotation*
        ('name' name=Identifier)?
    '}')?

;

EnumDataType returns tdl::EnumDataType: 
    ('{' constraint+=Constraint '}')* 
    'Enumerated' name=Identifier
    '{'
        //TODO: without type specification? separator?
        (value+=SimpleDataInstance_Impl)+
    '}'
;


BIGINTEGER returns ecore::EBigInteger:
    INT
;

//## Terminals

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