TDLan2.xtext 32 KB
Newer Older
    '}')?
	';';

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)*)?
	'}'
	)?
	;

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+=CollectionReference)?
	('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)?;