Commit 7ba9bedf authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* rearranged after moving part 4 clause 8.8 extensions to part 8, #208

parent 479e2bf4
Loading
Loading
Loading
Loading
Loading
+119 −126
Original line number Diff line number Diff line
@@ -957,12 +957,50 @@ fragment TDObjectiveFragment returns tdl::TestDescription:
    ( ',' testObjective+=[tdl::TestObjective|DeclName])*
;

TestPurposeDescription returns tdl::TestDescription:
    annotation+=TestPurposeDescriptionAnnotation
    //TODO: locally ordered?
    //('TestDescription' | isLocallyOrdered?='Test')
    name=TOIdentifier
    (LParen formalParameter+=FormalParameter ( ',' formalParameter+=FormalParameter)* RParen )?
    //TODO: Reference, PICS?, Objective reference vs Objective inline (all annotations?) or simply defer to objective
    BEGIN
        TDObjectiveFragment?
        'Configuration' ':' testConfiguration=[tdl::TestConfiguration|TOIdentifier]
        (behaviourDescription=TPDBehaviourDescription)
    END
;

TestVariantDescription returns tdl::TestDescription:
    annotation+=TestVariantDescriptionAnnotation
    //TODO: locally ordered?
    //('TestDescription' | isLocallyOrdered?='Test')
    name=TOIdentifier
    (LParen formalParameter+=FormalParameter ( ',' formalParameter+=FormalParameter)* RParen )?
    //TODO: Reference, PICS?, Objective reference vs Objective inline (all annotations?) or simply defer to objective
//  (behaviourDescription=TVDBehaviourDescription)
    BEGIN
        TDObjectiveFragment?
        //TODO: why is configuration not serialised?!
        'Configuration' ':' testConfiguration=[tdl::TestConfiguration|TOIdentifier]
        (behaviourDescription=TVDBehaviourDescription)
    END
;

//BehaviourDescription
BehaviourDescription returns tdl::BehaviourDescription:
    //NOTE: No annotations or comments
    behaviour=Behaviour
;

TPDBehaviourDescription returns tdl::BehaviourDescription:
    behaviour=TPDCompoundBehaviour
;

TVDBehaviourDescription returns tdl::BehaviourDescription:
    behaviour=TVDCompoundBehaviour
;

//## Combined Behaviour

//Behaviour
@@ -1010,6 +1048,29 @@ NoGuardBlock returns tdl::Block:
    END
;

TPDBlock returns tdl::Block:
    //NOTE: No guard -> guard is PICS
    //TODO: annotation has to be pulled up? or pushed down?
    (annotation+=PICSAnnotation ':' guard+=LocalExpression)?
    (behaviour+=InitialConditionsBehaviour)? 
    (behaviour+=ExpectedBehaviourBehaviour)? 
    (behaviour+=FinalConditionsBehaviour)? 
;

WhenThenBlock returns tdl::Block:
    behaviour+=WhenBehaviour
    behaviour+=ThenBehaviour 
;

TVDBlock returns tdl::Block:
    //NOTE: No guard -> guard is PICS
    //TODO: annotation has to be pulled up? or pushed down?
    //TODO: Objective
    (annotation+=PICSAnnotation ':' guard+=LocalExpression)?
    behaviour+=VariantBehaviour 
;


//LocalExpression
LocalExpression returns tdl::LocalExpression:
    //NOTE: No annotations or comments
@@ -1054,6 +1115,50 @@ CompoundBehaviour returns tdl::CompoundBehaviour:
    block=NoGuardBlock
;

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

InitialConditionsBehaviour returns tdl::CompoundBehaviour:
    annotation+=InitialConditionsAnnotation
    'with' block=Block
;

ExpectedBehaviourBehaviour returns tdl::CompoundBehaviour:
    annotation+=ExpectedBehaviourAnnotation
    'ensure' 'that'
    (
        BEGIN
            block=WhenThenBlock
        END
    )
    //TODO: this does not seem to work
    |
    block=NoGuardBlock
;

FinalConditionsBehaviour returns tdl::CompoundBehaviour:
    annotation+=FinalConditionsAnnotation
    'with' block=Block
;


WhenBehaviour returns tdl::CompoundBehaviour:
    annotation+=WhenAnnotation
    block=Block
;

ThenBehaviour returns tdl::CompoundBehaviour:
    annotation+=ThenAnnotation
    block=Block
;

TVDCompoundBehaviour returns tdl::CompoundBehaviour:
    //(annotation+=PICSAnnotation ':')?
    block=TVDBlock
;

//BoundedLoopBehaviour
BoundedLoopBehaviour returns tdl::BoundedLoopBehaviour:
    AnnotationFragment?
@@ -1292,6 +1397,19 @@ TestDescriptionReference returns tdl::TestDescriptionReference:
    END)?
;

VariantBehaviour returns tdl::TestDescriptionReference:
    'Bindings' ':' testDescription=[tdl::TestDescription|DeclName]
    (BEGIN 
        argument+=ParameterBinding 
        ( ',' argument+=ParameterBinding)* 
    END)?
    //TODO: skip / merge above
    ('with' BEGIN
        componentInstanceBinding+=ComponentInstanceBinding 
        (',' componentInstanceBinding+=ComponentInstanceBinding)*
    END)?
;

//ComponentInstanceBinding
ComponentInstanceBinding returns tdl::ComponentInstanceBinding:
    AnnotationCommentFragment
@@ -2238,132 +2356,7 @@ VariantBindingPredefined returns to::VariantBinding:
    WithCommentFragment?
;

//# Test Description

//TestDescription
TestPurposeDescription returns tdl::TestDescription:
    annotation+=TestPurposeDescriptionAnnotation
    //TODO: locally ordered?
    //('TestDescription' | isLocallyOrdered?='Test')
    name=TOIdentifier
    (LParen formalParameter+=FormalParameter ( ',' formalParameter+=FormalParameter)* RParen )?
    //TODO: Reference, PICS?, Objective reference vs Objective inline (all annotations?) or simply defer to objective
    BEGIN
        TDObjectiveFragment?
        'Configuration' ':' testConfiguration=[tdl::TestConfiguration|TOIdentifier]
        (behaviourDescription=TPDBehaviourDescription)
    END
;

TestVariantDescription returns tdl::TestDescription:
    annotation+=TestVariantDescriptionAnnotation
    //TODO: locally ordered?
    //('TestDescription' | isLocallyOrdered?='Test')
    name=TOIdentifier
    (LParen formalParameter+=FormalParameter ( ',' formalParameter+=FormalParameter)* RParen )?
    //TODO: Reference, PICS?, Objective reference vs Objective inline (all annotations?) or simply defer to objective
//	(behaviourDescription=TVDBehaviourDescription)
    BEGIN
        TDObjectiveFragment?
        //TODO: why is configuration not serialised?!
        'Configuration' ':' testConfiguration=[tdl::TestConfiguration|TOIdentifier]
        (behaviourDescription=TVDBehaviourDescription)
    END
;

//BehaviourDescription
TPDBehaviourDescription returns tdl::BehaviourDescription:
    behaviour=TPDCompoundBehaviour
;

TVDBehaviourDescription returns tdl::BehaviourDescription:
    behaviour=TVDCompoundBehaviour
;


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

InitialConditionsBehaviour returns tdl::CompoundBehaviour:
    annotation+=InitialConditionsAnnotation
    'with' block=Block
;

ExpectedBehaviourBehaviour returns tdl::CompoundBehaviour:
    annotation+=ExpectedBehaviourAnnotation
	'ensure' 'that'
    (
        BEGIN
            block=WhenThenBlock
        END
    )
    //TODO: this does not seem to work
    |
	block=NoGuardBlock
;

FinalConditionsBehaviour returns tdl::CompoundBehaviour:
    annotation+=FinalConditionsAnnotation
    'with' block=Block
;


WhenBehaviour returns tdl::CompoundBehaviour:
    annotation+=WhenAnnotation
    block=Block
;

ThenBehaviour returns tdl::CompoundBehaviour:
    annotation+=ThenAnnotation
    block=Block
;

TVDCompoundBehaviour returns tdl::CompoundBehaviour:
    //(annotation+=PICSAnnotation ':')?
    block=TVDBlock
;


//Block
TPDBlock returns tdl::Block:
    //NOTE: No guard -> guard is PICS
    //TODO: annotation has to be pulled up? or pushed down?
    (annotation+=PICSAnnotation ':' guard+=LocalExpression)?
    (behaviour+=InitialConditionsBehaviour)? 
    (behaviour+=ExpectedBehaviourBehaviour)? 
    (behaviour+=FinalConditionsBehaviour)? 
;

WhenThenBlock returns tdl::Block:
    behaviour+=WhenBehaviour
    behaviour+=ThenBehaviour 
;

TVDBlock returns tdl::Block:
    //NOTE: No guard -> guard is PICS
    //TODO: annotation has to be pulled up? or pushed down?
    //TODO: Objective
    (annotation+=PICSAnnotation ':' guard+=LocalExpression)?
    behaviour+=VariantBehaviour 
;

//TestDescriptionReference
VariantBehaviour returns tdl::TestDescriptionReference:
    'Bindings' ':' testDescription=[tdl::TestDescription|DeclName]
    (BEGIN 
    	argument+=ParameterBinding 
    	( ',' argument+=ParameterBinding)* 
	END)?
	//TODO: skip / merge above
    ('with' BEGIN
        componentInstanceBinding+=ComponentInstanceBinding 
        (',' componentInstanceBinding+=ComponentInstanceBinding)*
    END)?
;

//# Behaviour


//#############################################