Commit 7d67a762 authored by Philip Makedonski's avatar Philip Makedonski Committed by Philip Makedonski
Browse files

+ refinements and reordering

parent 0828871d
Loading
Loading
Loading
Loading
+44 −25
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ Event returns to::Event:
    //DONE: check how well multi-word value converters work as a separate rule..
    //      would it then be a single string or should it be decomposed in a sequence?
    //      -> not in this version
    'Event' name=Identifier
    'Event' name=KIdentifier
;

PICS returns to::PICS:
@@ -375,7 +375,7 @@ fragment EntityReferenceFragment returns to::EntityReference:

EventReference returns to::EventReference:
    (comment+=Qualifier | comment+=CommonWordQualifier | comment+=NotQualifier)*
    event=[to::Event|Identifier] 
    event=[to::Event|KIdentifier] 
;

//# Data
@@ -421,7 +421,7 @@ LiteralValueAsBinding returns to::LiteralValue:

fragment LiteralValueFragment returns to::LiteralValue:
    comment+=Qualifier* 
    (name=Identifier | name=NIdentifier)
    (name=Identifier | name=NIdentifier | name = SIdentifier)
    ('containing' 
        BEGIN
            content+=DataContent (',' content+=DataContent)* 
@@ -432,6 +432,7 @@ fragment LiteralValueFragment returns to::LiteralValue:
DataContent returns to::Content:
    comment+=NotQualifier?
//    (parameter=[Parameter|Identifier] | name=Identifier | name=NumberAsIdentifier)
//    member=[tdl::Member|Identifier]
    comment+=Qualifier*
    (name=Identifier | name=NIdentifier)
    (
@@ -460,6 +461,7 @@ BindingLiteralValueReference returns to::LiteralValueReference:

fragment LiteralValueReferenceFragment returns to::LiteralValueReference:
    'the' 'value' 'of'
    comment+=ArticleQualifier?
    comment+=Qualifier*
    content=[to::LiteralValue|Identifier]
;
@@ -479,7 +481,7 @@ BindingContentReference returns to::ContentReference:

fragment ContentReferenceFragment returns to::ContentReference:
    'the' 'value' 'contained' 'in'
    // (comment+=ArticleQualifier)?
    comment+=ArticleQualifier?
    // (comment+=Qualifier)*
    // (name=Identifier | name='value')
    // comment+=ReferenceQualifier
@@ -644,49 +646,59 @@ TPDCompoundBehaviour returns tdl::CompoundBehaviour:
    block=TPDBlock
;

TPDBlock returns tdl::Block:
    //no guard
//    ('[' guard+=LocalExpression (',' guard+=LocalExpression)* ']')?
        (behaviour+=InitialConditionsBehaviour)? 
        (behaviour+=ExpectedBehaviourBehaviour)? 
        (behaviour+=FinalConditionsBehaviour)? 
;

InitialConditionsBehaviour returns tdl::CompoundBehaviour:
    annotation+=InitialConditionsAnnotation
    //TODO: with annotation?
    'with' block=AtomicBehaviourBlock
//    'with' block=AtomicBehaviourBlock
    'with' block=Block
;

ExpectedBehaviourBehaviour returns tdl::CompoundBehaviour:
    annotation+=ExpectedBehaviourAnnotation
    'ensure' 'that'
    (
    	BEGIN
            block=WhenThenBlock
        END
    //TODO: single then clause
    )
    | block=Block
;

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

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

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

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

TPDBlock returns tdl::Block:
    //no guard
//    ('[' guard+=LocalExpression (',' guard+=LocalExpression)* ']')?
        (behaviour+=InitialConditionsBehaviour)? 
        (behaviour+=ExpectedBehaviourBehaviour)? 
        (behaviour+=FinalConditionsBehaviour)? 
;

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


//Further customisations (not used) 

AtomicBehaviourBlock returns tdl::Block:
    //no guard
//    ('[' guard+=LocalExpression (',' guard+=LocalExpression)* ']')?
@@ -794,3 +806,10 @@ MIdentifier returns ecore::EString:
    ID (ID)*
;

SIdentifier returns ecore::EString:
    STRING
;

KIdentifier returns ecore::EString:
    ID | 'sends' | 'receives' | 'triggers'
;