Commit 45305afc authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ updated TDLan2 editor according to the current state of the meta-model



Change-Id: If28443ca05deb6c9002daedbb42eb42e4ef708de
Signed-off-by: default avatarmakedonski <makedonski@informatik.uni-goettingen.de>
parent 534a5522
Loading
Loading
Loading
Loading
+26 −98
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ AlternativeBehaviour returns tdl::AlternativeBehaviour:
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
	'}'
	)?
	('on' scope=[tdl::ComponentInstance|Identifier])?
	;

Annotation returns tdl::Annotation:
@@ -102,7 +101,6 @@ AnyValueOrOmit returns tdl::AnyValueOrOmit:
	(
	'with'
	  '{'
		('reduction' '(' reduction+=[tdl::Member|Identifier] ( "," reduction+=[tdl::Member|Identifier])* ')' )?
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('name' name=Identifier)?
@@ -118,7 +116,6 @@ AnyValue returns tdl::AnyValue:
	(
	'with'
	  '{'
		('reduction' '(' reduction+=[tdl::Member|Identifier] ( "," reduction+=[tdl::Member|Identifier])* ')' )?
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		//('name' name=Identifier)?
@@ -215,7 +212,7 @@ BehaviourDescription returns tdl::BehaviourDescription:


Block returns tdl::Block:
	('[' guard=DataUse ']')?
	('[' guard+=LocalExpression (',' guard+=LocalExpression)* ']')?
	'{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
@@ -224,17 +221,27 @@ Block returns tdl::Block:
	'}'
	;

LocalExpression returns tdl::LocalExpression:
	expression=DataUse ('on' scope=[tdl::ComponentInstance|Identifier])? 
	;

LocalLoopExpression returns tdl::LocalExpression:
	expression=DataUse 'times' ('on' scope=[tdl::ComponentInstance|Identifier])? 
	;


MemberReference returns tdl::MemberReference:
	member=[tdl::Member|Identifier] ('[' collectionIndex=DataUse ']')? 
	;


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

BoundedLoopBehaviour returns tdl::BoundedLoopBehaviour:
	'repeat'
	numIteration=DataUse
	'times'
//	'from' startValue=DataInstanceSpecification
//	'to' endValue=DataInstanceSpecification
//	('with step' stepValue=DataInstanceSpecification)?
	numIteration+=LocalLoopExpression (',' numIteration+=LocalLoopExpression)*
	block=Block
    (
    'with'
@@ -247,7 +254,6 @@ BoundedLoopBehaviour returns tdl::BoundedLoopBehaviour:
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
    '}'
    )?
	('on' scope=[tdl::ComponentInstance|Identifier])?
	;

Break returns tdl::Break:
@@ -339,7 +345,6 @@ CompoundBehaviour returns tdl::CompoundBehaviour:
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
	'}'
	)?
	('on' scope=[tdl::ComponentInstance|Identifier])?
	;

ConditionalBehaviour returns tdl::ConditionalBehaviour:
@@ -356,7 +361,6 @@ ConditionalBehaviour returns tdl::ConditionalBehaviour:
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
	'}'
    )?
    ('on' scope=[tdl::ComponentInstance|Identifier])?
    ;

Connection returns tdl::Connection:
@@ -420,7 +424,7 @@ DataInstanceUse returns tdl::DataInstanceUse:
			(
				('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )
				|
				('.' reduction+=[tdl::Member|Identifier])*
				('.' reduction+=MemberReference)*
			)?
		)
	 	|
@@ -459,7 +463,7 @@ DataResourceMapping returns tdl::DataResourceMapping:
	';';

DataType returns tdl::DataType:
	SimpleDataType_Impl | StructuredDataType | Time | Procedure;
	SimpleDataType_Impl | StructuredDataType | Time;

DataUse returns tdl::DataUse:
	DataInstanceUse | FunctionCall | FormalParameterUse | TimeLabelUse | VariableUse | AnyValue | AnyValueOrOmit | OmitValue;
@@ -526,7 +530,7 @@ FunctionCall returns tdl::FunctionCall:
	'('
	(argument+=ParameterBinding ( "," argument+=ParameterBinding)*)?
	')'
	('.' reduction+=[tdl::Member|Identifier])*
	('.' reduction+=MemberReference)*
	('with'
	'{'
		('name' name=Identifier)?
@@ -589,13 +593,13 @@ InlineAction returns tdl::InlineAction:
	';';

Interaction returns tdl::Interaction:
	Message | ProcedureCall
	Message
	;

Message returns tdl::Message:
	sourceGate=[tdl::GateReference|IdentifierDot]
	('sends' | (isTrigger?='triggers')) 
	argument+=DataUse
	argument=DataUse
	'to' 
	target+=Target ( "," target+=Target)* 
	(
@@ -611,29 +615,6 @@ Message returns tdl::Message:
	';'
	;

ProcedureCall returns tdl::ProcedureCall:
	source=Target
	'calls'
	procedure=[tdl::Procedure|Identifier]
	//TODO: double check what the exact syntax shall be
	//and what is return value and such
	'(' argument+=DataUse (',' argument+=DataUse)* ')'

	'on' 
	target+=Target ( "," target+=Target)* 
	(
	'with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)? //USE FOR STEPS?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
	'}')?
	';'
	;

Trigger returns ecore::EBooleanObject :
	'triggers'
;
@@ -703,7 +684,6 @@ OmitValue returns tdl::OmitValue:
    'with'
    '{'
		('argument' '{' argument+=ParameterBinding ( "," argument+=ParameterBinding)* '}' )?
		('reduction' '(' reduction+=[tdl::Member|Identifier] ( "," reduction+=[tdl::Member|Identifier])* ')' )?
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('name' name=Identifier)?
@@ -730,7 +710,7 @@ OmitValue returns tdl::OmitValue:

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 | Procedure | StructuredDataInstance | Action_Impl | Function | ComponentType | GateType | Time | TestConfiguration | TestDescription;
	AnnotationType | TestObjective | DataResourceMapping | DataElementMapping | SimpleDataType_Impl | SimpleDataInstance_Impl | StructuredDataType | StructuredDataInstance | Action_Impl | Function | ComponentType | GateType | Time | TestConfiguration | TestDescription;

ParallelBehaviour returns tdl::ParallelBehaviour:
	'run' block+=Block ('in' 'parallel' 'to' block+=Block)* 
@@ -769,7 +749,6 @@ TimeLabelUse returns tdl::TimeLabelUse:
    'with'
    '{'
		('argument' '{' argument+=ParameterBinding ( "," argument+=ParameterBinding)* '}' )?
		('reduction' '(' reduction+=[tdl::Member|Identifier] ( "," reduction+=[tdl::Member|Identifier])* ')' )?
		('name' name=Identifier)?
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
@@ -780,7 +759,7 @@ FormalParameterUse returns tdl::FormalParameterUse:
	'parameter'
	parameter=[tdl::FormalParameter|Identifier]
	('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?
	( "." reduction+=[tdl::Member|Identifier])*
	( "." reduction+=MemberReference)*
    (
    'with'
    '{'
@@ -792,7 +771,7 @@ FormalParameterUse returns tdl::FormalParameterUse:

PeriodicBehaviour returns tdl::PeriodicBehaviour:
	'every'
	period=DataUse
	(period+=LocalExpression (',' period+=LocalExpression)*)
    block=Block
    (
    'with'
@@ -850,40 +829,6 @@ SimpleDataType_Impl returns tdl::SimpleDataType:
	';'
	;		

Procedure returns tdl::Procedure:
	{tdl::Procedure}
	//'Simple' 'Data' 'Type'
	'Procedure'
	name=Identifier
	('(' parameter+=ProcedureParameter ( "," parameter+=ProcedureParameter)* ')')?
	(
    'with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
	';'
	;		

ProcedureParameter returns tdl::ProcedureParameter:
	{tdl::ProcedureParameter}
	kind=ParameterKind
    name=Identifier
    'of' 'type'
    dataType=[tdl::DataType|Identifier]
    (
    'with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
	;
	

enum ParameterKind returns tdl::ParameterKind:
	IN = 'in' | OUT = 'out' | EXCEPTION = 'exception';


StaticDataUse returns tdl::StaticDataUse:
	DataInstanceUse | AnyValue | AnyValueOrOmit | OmitValue;

@@ -925,22 +870,6 @@ StructuredDataInstance returns tdl::StructuredDataInstance:
	';'
	;

CollectionDataInstance returns tdl::CollectionDataInstance:
	{tdl::CollectionDataInstance}
	'Collection'
	name=Identifier
	'of' 'type'
	dataType=[tdl::DataType|Identifier]
	('containing' '{' member+=StaticDataUse (',' member+=StaticDataUse)*  '}')?		
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
	'}')?
	';'
	;


StructuredDataType returns tdl::StructuredDataType:
	{tdl::StructuredDataType}
	//'Structured' 'Data' 'Type'
@@ -958,7 +887,7 @@ StructuredDataType returns tdl::StructuredDataType:
Target returns tdl::Target:
	targetGate=[tdl::GateReference|IdentifierDot]
	//TODO: check what the correct syntax shall be
	('where' 'it' 'is' 'assigned' 'to' variable+=[tdl::Variable|Identifier])?
	('where' 'it' 'is' 'assigned' 'to' variable=[tdl::Variable|Identifier])?
   	(
    'with'
    '{'
@@ -1144,7 +1073,6 @@ UnboundedLoopBehaviour returns tdl::UnboundedLoopBehaviour:
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
	'}'
	)?
	('on' scope=[tdl::ComponentInstance|Identifier])?
	;

Variable returns tdl::Variable:
@@ -1165,7 +1093,7 @@ VariableUse returns tdl::VariableUse:
	'->'
	variable=[tdl::Variable|Identifier]
	('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?
	("." reduction+=[tdl::Member|Identifier])*
	("." reduction+=MemberReference)*
	('with' 
	'{'
		('name' name=Identifier)?
+8 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import org.etsi.mts.tdl.DataInstanceUse;
import org.etsi.mts.tdl.Element;
import org.etsi.mts.tdl.GateInstance;
import org.etsi.mts.tdl.GateReference;
import org.etsi.mts.tdl.LocalExpression;
import org.etsi.mts.tdl.MemberAssignment;
import org.etsi.mts.tdl.Parameter;
import org.etsi.mts.tdl.ParameterBinding;
@@ -54,7 +55,7 @@ public class TDLan2ScopeProvider extends AbstractDeclarativeScopeProvider {
				return scope;
			}
		} else if (reference.getEType().getInstanceClass() == ComponentInstance.class) {
			if (context instanceof Behaviour || context instanceof Block) {
			if (context instanceof Behaviour || context instanceof Block || context instanceof LocalExpression) {
				TestDescription testDescription = getTestDescription((Element) context);
				if (testDescription!=null) {
					TestConfiguration configuration = testDescription.getTestConfiguration();
@@ -119,6 +120,12 @@ public class TDLan2ScopeProvider extends AbstractDeclarativeScopeProvider {
					return scope;
				}
			}
			else if (context instanceof Target) {
				if (((Target)context).getTargetGate().getComponent()!=null) {
					IScope scope = Scopes.scopeFor(((Target)context).getTargetGate().getComponent().getType().getVariable());
					return scope;
				}
			}
		} else {
		}