TDLan2.xtext 34 KB
Newer Older

TestDescriptionReference returns tdl::TestDescriptionReference:
	'execute'
	testDescription=[tdl::TestDescription|Identifier]
	('(' actualParameter+=DataUse ( "," actualParameter+=DataUse)* ')' )?
	('with'
	  '{'
		('bindings' '{' componentInstanceBinding+=ComponentInstanceBinding ( "," componentInstanceBinding+=ComponentInstanceBinding)* '}' )?
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
	
		('name' name=Identifier)?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
	'}')?
	';';

TestObjective returns tdl::TestObjective:
	{tdl::TestObjective}
	'Test' 'Objective'
		(name=Identifier)?
	'{'
		('from' ':' objectiveURI+=String0 ';' ( 'from' ':' objectiveURI+=String0 ';')* )?
		('description' ':' description=String0 ';')?
	'}'
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
	;


Time returns tdl::Time:
	{tdl::Time}
	'Time'
	name=Identifier
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
	';';

TimeConstraint returns tdl::TimeConstraint:
		(name=Identifier)?
		timeConstraintExpression=DataUse
		('with'
		'{'
			(comment+=Comment (comment+=Comment)*)?
			(annotation+=Annotation (annotation+=Annotation)*)?
		'}')?
	;

TimeLabel returns tdl::TimeLabel:
	name=Identifier
//	'in' 
//	dataType=[tdl::DataType|Identifier]
    ('with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
	';';

TimeOut returns tdl::TimeOut:
	componentInstance=[tdl::ComponentInstance|Identifier]
	'.'	
	timer=[tdl::Timer|Identifier]
	'times' 'out'
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
	'}')?
	';'
	;

Timer returns tdl::Timer:
	{tdl::Timer}
	'timer'
	name=Identifier
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
	'}')?
	';';


TimerStart returns tdl::TimerStart:
	'start'
	componentInstance=[tdl::ComponentInstance|Identifier]
	'.'
	timer=[tdl::Timer|Identifier]
	'for'
	period=DataUse
	('with' 
	 '{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
		('name' name=Identifier)?
	'}')?
	';'
	;

TimerStop returns tdl::TimerStop:
	'stop'
	componentInstance=[tdl::ComponentInstance|Identifier]
	'.'
	timer=[tdl::Timer|Identifier]
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
	'}')?
	';'
	;


UnboundedLoopBehaviour returns tdl::UnboundedLoopBehaviour:
	'repeat'
	block=Block
	(
	'with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)?
    	(periodic+=PeriodicBehaviour ( periodic+=PeriodicBehaviour)* )?
    	(exceptional+=ExceptionalBehaviour ( exceptional+=ExceptionalBehaviour)*)?
	'}'
	)?
	('on' scope=[tdl::ComponentInstance|Identifier])?
	;

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

VariableUse returns tdl::VariableUse:
	//TODO: try to adjust syntax so that -> is not necessary
	componentInstance=[tdl::ComponentInstance|Identifier]
	'->'
	variable=[tdl::Variable|Identifier]
	('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?
	("." reduction+=[tdl::Member|Identifier])*
	('with' 
	'{'
		('name' name=Identifier)?
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
	'}')?
	;


//Verdict returns tdl::Verdict:
//	//'verdict'
//	(	(dataType=[tdl::DataType|PredefinedVerdict] name=Identifier)
//		| 
//		('Verdict' name=Identifier 'of type' dataType=[tdl::DataType|Identifier])
//	)
//    ('with'
//    '{'
//        (comment+=Comment (comment+=Comment)*)?
//        (annotation+=Annotation (annotation+=Annotation)*)?
//    '}')?
//    ';'
//	;

PredefinedVerdict returns ecore::EString: 'Verdict';

VerdictAssignment returns tdl::VerdictAssignment:
	'set' 'verdict' 'to'
	verdict=DataUse
	(
	'with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
	'}')?
	';'
	;

Wait returns tdl::Wait:
	( 'component' componentInstance=[tdl::ComponentInstance|Identifier])
	'waits' 'for'
	period=DataUse
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('test' 'objectives' ':' testObjective+=[tdl::TestObjective|Identifier] ( "," testObjective+=[tdl::TestObjective|Identifier])* ';')?
		('name' name=Identifier)?
		('time' 'label' timeLabel=TimeLabel)?
		('time' 'constraints' ':' timeConstraint+=TimeConstraint ( "," timeConstraint+=TimeConstraint)* ';' )?
		
	'}')?
	';';
	
NumberAsIdentifier returns ecore::EString:
    '-'? INT ('.' INT)?;