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

+ PICS support for test purpose descriptions

* spacing between keywords and :
parent 0b27d6f4
Loading
Loading
Loading
Loading
+43 −18
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ fragment AnnotationCommentFragment returns tdl::Element:
;

fragment NameFragment returns tdl::Element:
    'Name:' name=Identifier
    'Name' ':' name=Identifier
;

fragment WithCommentFragment returns tdl::Element:
@@ -109,8 +109,8 @@ TestObjective returns tdl::TestObjective:
    AnnotationCommentFragment
    'Objective' name=Identifier
    (BEGIN
        ('Description:' description=EString)?
        ('References:' objectiveURI+=EString (',' objectiveURI+=EString)*)?
        ('Description' ':' description=EString)?
        ('References' ':' objectiveURI+=EString (',' objectiveURI+=EString)*)?
    END)?
;

@@ -667,7 +667,7 @@ fragment TDPrefixFragment returns tdl::TestDescription:
;

fragment TDObjectiveFragment returns tdl::TestDescription:
    'Objective:' testObjective+=[tdl::TestObjective|Identifier] 
    'Objective' ':' testObjective+=[tdl::TestObjective|Identifier] 
    ( ',' testObjective+=[tdl::TestObjective|Identifier])*
;

@@ -696,13 +696,17 @@ fragment WithBehaviourFragment returns tdl::Behaviour:
;

fragment ObjectiveFragment returns tdl::Behaviour:
    'Objective:' testObjective+=[tdl::TestObjective|Identifier] ( ',' testObjective+=[tdl::TestObjective|Identifier])*
    'Objective' ':' testObjective+=[tdl::TestObjective|Identifier] ( ',' testObjective+=[tdl::TestObjective|Identifier])*
;


Block returns tdl::Block:
    //NOTE: No annotations or comments
    ('[' guard+=LocalExpression ( ',' guard+=LocalExpression)* ']' )?
    ('[' 
//    	('@' annotation+=PICSAnnotation)? //TODO: Exception for PICS? seems not enough
		AnnotationFragment
    	guard+=LocalExpression ( ',' guard+=LocalExpression)* 
	']')?
    BEGIN
        behaviour+=Behaviour+ 
    END
@@ -1047,6 +1051,7 @@ AIdentifier:
    | TestPurposeDescriptionName
    | When
    | Then
    | PICSName    
;

GRIdentifier:
@@ -1128,9 +1133,17 @@ Event returns to::Event:

PICS returns to::PICS:
    AnnotationCommentFragment
    'PICS' name=Identifier
    PICSName name=Identifier
;

//PICS as data instance
//PICS returns tdl::SimpleDataInstance:
//    AnnotationCommentFragment
//    dataType=[tdl::DataType|PICSName] 
//    name=Identifier
//;


//# Comments as Qualifiers

//DONE: Group by context? -> no
@@ -1253,6 +1266,10 @@ ThenAnnotation returns tdl::Annotation:
    key=[tdl::AnnotationType|Then]
;

PICSAnnotation returns tdl::Annotation:
    key=[tdl::AnnotationType|PICSName]
;


//## Element: Abstract 
fragment InitialConditionsFragment returns tdl::Element:
@@ -1288,10 +1305,11 @@ fragment ElementAndOrPrefix returns tdl::Element:
StructuredTestObjective returns to::StructuredTestObjective:
    'Test' 'Purpose' name=Identifier
    BEGIN
        ('Objective:' description=EString)? 
        ('Reference:' objectiveURI+=EString (',' objectiveURI+=EString )*)?
        ('Configuration:' configuration=[tdl::TestConfiguration|Identifier])? 
        ('PICS:' picsReference+=FirstPICSReference (picsReference+=PICSReference)*)? 
        ('Objective' ':' description=EString)? 
        ('Reference' ':' objectiveURI+=EString (',' objectiveURI+=EString )*)?
        ('Configuration' ':' configuration=[tdl::TestConfiguration|Identifier])? 
        ('PICS' ':' picsReference+=FirstPICSReference (picsReference+=PICSReference)*)?
        //('Guard:' guard+=DataUse)? //Substitute for PICS eventually?
        (initialConditions=InitialConditions)?
        (expectedBehaviour=ExpectedBehaviour)?
        (finalConditions=FinalConditions)?
@@ -1661,9 +1679,10 @@ EntityBinding returns to::EntityBinding:
Variant returns to::TestObjectiveVariant:
    'Variant' name=Identifier
    BEGIN
        ('Objective:' description=EString)? 
        ('Reference:' objectiveURI+=EString (',' objectiveURI+=EString)*)?  
        ('PICS:' picsReference+=FirstPICSReference (picsReference+=PICSReference)*)?
        ('Objective' ':' description=EString)? 
        ('Reference' ':' objectiveURI+=EString (',' objectiveURI+=EString)*)?  
        ('PICS' ':' picsReference+=FirstPICSReference (picsReference+=PICSReference)*)?
        //('Guard:' guard+=DataUse)? //Substitute for PICS eventually? 
        ('Bindings' 
            BEGIN
                bindings+=VariantBinding (',' bindings+=VariantBinding)*
@@ -1715,7 +1734,7 @@ TestPurposeDescription returns tdl::TestDescription:
    //TODO: Reference, PICS?, Objective reference vs Objective inline (all annotations?) or simply defer to objective
    BEGIN
        TDObjectiveFragment?
        'Configuration:' testConfiguration=[tdl::TestConfiguration|Identifier]
        'Configuration' ':' testConfiguration=[tdl::TestConfiguration|Identifier]
        (behaviourDescription=TPDBehaviourDescription)
    END
;
@@ -1725,6 +1744,7 @@ TPDBehaviourDescription returns tdl::BehaviourDescription:
;

TPDCompoundBehaviour returns tdl::CompoundBehaviour:
    //(annotation+=PICSAnnotation ':')?
    block=TPDBlock
;

@@ -1764,7 +1784,8 @@ ThenBehaviour returns tdl::CompoundBehaviour:

TPDBlock returns tdl::Block:
    //NOTE: No guard -> guard is PICS
    ('PICS:' guard+=LocalExpression)?
    //TODO: annotation has to be pulled up? or pushed down?
    (annotation+=PICSAnnotation ':' guard+=LocalExpression)?
    (behaviour+=InitialConditionsBehaviour)? 
    (behaviour+=ExpectedBehaviourBehaviour)? 
    (behaviour+=FinalConditionsBehaviour)? 
@@ -1888,6 +1909,10 @@ TestPurposeDescriptionName:
    'Test' 'Purpose' 'Description'
;

PICSName:
    'PICS'
;

When:
    'when'
;