Commit c4ecb7e1 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ further grammar refinements

parent 636e74b0
Loading
Loading
Loading
Loading
+21 −19
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ AlternativeBehaviour returns tdl::AlternativeBehaviour:
Annotation returns tdl::Annotation:
	key=[tdl::AnnotationType|Identifier]
	(':' value=String0)?
    CommentAnnotationNameFragment
	';';

AnnotationType returns tdl::AnnotationType:
@@ -147,12 +146,13 @@ BehaviourDescription returns tdl::BehaviourDescription:


Block returns tdl::Block:
	{tdl::Block} 
	('[' guard+=LocalExpression (',' guard+=LocalExpression)* ']')?
	'{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
        comment+=Comment*
        annotation+=Annotation*
        ('name' name=Identifier)?
		behaviour+=Behaviour ( behaviour+=Behaviour)* 
		behaviour+=Behaviour* 
	'}'
	;

@@ -188,7 +188,6 @@ Break returns tdl::Break:
Comment returns tdl::Comment:
	'Note' (name=Identifier)?
	':' body=String0
    CommentAnnotationFragment
	';';


@@ -574,11 +573,11 @@ MappableDataElement returns tdl::MappableDataElement:

Member returns tdl::Member:
	(isOptional?='optional')?
    MemberConstraintFragment
	name=Identifier
	'of' 'type'
	dataType=[tdl::DataType|Identifier]
    MemberConstraintFragment
    CommentAnnotationFragment
//    CommentAnnotationFragment
	;

Optional returns ecore::EBoolean :
@@ -705,7 +704,7 @@ SimpleDataInstance_Impl returns tdl::SimpleDataInstance:
SimpleDataType_Impl returns tdl::SimpleDataType:
	{tdl::SimpleDataType}
	//'Simple' 'Data' 'Type'
    ConstraintFragment
    ConstraintFragment?
	'Type'
	name=Identifier
	;		
@@ -737,8 +736,9 @@ StructuredDataInstance returns tdl::StructuredDataInstance:

StructuredDataType returns tdl::StructuredDataType:
	{tdl::StructuredDataType}
	//TODO: this seems broken
	//'Structured' 'Data' 'Type'
    ConstraintFragment
    ConstraintFragment?
	'Type'
	name=Identifier
	(extension=Extension)?
@@ -920,6 +920,7 @@ NumberAsIdentifier returns ecore::EString:

Extension returns tdl::Extension:
	'extends' extending=[tdl::PackageableElement|Identifier]
	//TODO: with block?
	;


@@ -974,8 +975,8 @@ fragment CommentAnnotationFragment returns tdl::Element:
fragment WithAtomicBehaviour returns tdl::AtomicBehaviour:
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
        comment+=Comment*
        annotation+=Annotation*
        ('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
        ('name' name=Identifier)?
        ('time' 'label' timeLabel=TimeLabel)?
@@ -987,20 +988,20 @@ fragment WithAtomicBehaviour returns tdl::AtomicBehaviour:
fragment WithCombinedBehaviour returns tdl::CombinedBehaviour:
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
        comment+=Comment*
        annotation+=Annotation*
        ('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
        ('name' name=Identifier)?
        (periodic+=PeriodicBehaviour ( periodic+=PeriodicBehaviour)* )?
        (exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
        periodic+=PeriodicBehaviour*
        exceptional+=ExceptionalBehaviour*
    '}')?
;
	
fragment WithExceptionalBehaviour returns tdl::ExceptionalBehaviour:
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
        comment+=Comment*
        annotation+=Annotation*
        ('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
        ('name' name=Identifier)?
	'}')?
@@ -1009,8 +1010,8 @@ fragment WithExceptionalBehaviour returns tdl::ExceptionalBehaviour:
fragment WithPeriodicBehaviour returns tdl::PeriodicBehaviour:
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
        comment+=Comment*
        annotation+=Annotation*
        ('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
        ('name' name=Identifier)?
    '}')?
@@ -1018,6 +1019,7 @@ fragment WithPeriodicBehaviour returns tdl::PeriodicBehaviour:

fragment ConstraintFragment returns tdl::DataType:
    //TODO: put braces into constraint?
    //TODO: move constraint after type name?!
    ('{' constraint+=Constraint '}')* 
;