Skip to content
TDLan2.xtext 40.3 KiB
Newer Older
// automatically generated by Xtext
grammar org.etsi.mts.tdl.TDLan2 with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.etsi.org/spec/TDL/1.4.1" as tdl 

Package returns tdl::Package:
	{tdl::Package}
	'Package'
	name=Identifier
	'{'
		(^import+=ElementImport ( ^import+=ElementImport)* )?
		(packagedElement+=PackageableElement ( packagedElement+=PackageableElement)* )?
		(nestedPackage+=Package (nestedPackage+=Package)*)?
	'}'
	(
    'with'
    '{'
        (comment+=Comment (comment+=Comment)*)?
        (annotation+=Annotation (annotation+=Annotation)*)?
    '}')?
    ;

Action returns tdl::Action:
	Action_Impl | Function;

ActionReference returns tdl::ActionReference:
	'perform' 'action'
	action=[tdl::Action|Identifier]
	('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?
	('on' componentInstance=[tdl::ComponentInstance|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)* ';' )?
	'}')?
	';'
	;

Action_Impl returns tdl::Action:
	{tdl::Action}
	'Action'
	name=Identifier
	('(' formalParameter+=FormalParameter ( "," formalParameter+=FormalParameter)* ')' )?
	(':' body=String0)?
	('with'
	'{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
	'}')?
	';';

AlternativeBehaviour returns tdl::AlternativeBehaviour:
	'alternatively'
	block+=Block ('or' 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)*)?
	'}'
	)?
	;

Annotation returns tdl::Annotation:
	key=[tdl::AnnotationType|Identifier]
	(':' value=String0)?
	(
	'with'
	  '{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		(name=Identifier)?
	'}')?
	';';

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

AnyValueOrOmit returns tdl::AnyValueOrOmit:
	{tdl::AnyValueOrOmit}
	//('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?
	(
	'with'
	  '{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
	'}')?
	;

AnyValue returns tdl::AnyValue:
	{tdl::AnyValue}
	name='?'
	//TODO: remove dataTypeAssociation?
	(':' dataType=[tdl::DataType|Identifier])?
	//('(' argument+=ParameterBinding ( "," argument+=ParameterBinding)* ')' )?	
	(
	'with'
	  '{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		//('name' name=Identifier)?
	'}')?
	;

ParameterBinding returns tdl::ParameterBinding:
	parameter=[tdl::Parameter|Identifier]
	'=' 
	dataUse=DataUse
	(
	'with'
	  '{'
		(comment+=Comment (comment+=Comment)*)?
		(annotation+=Annotation (annotation+=Annotation)*)?
		('name' name=Identifier)?
	'}')?
	;

Assertion returns tdl::Assertion:
	{tdl::Assertion}
	'assert'
	condition=DataUse
    ('on' componentInstance=[tdl::ComponentInstance|Identifier])?
	('otherwise' 'set' 'verdict' 'to' otherwise=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)* ';' )?
	'}')?
	';';

Assignment returns tdl::Assignment:
	//DONE: shall be mandatory -> updated MM superclass
	//(componentInstance=[tdl::ComponentInstance|Identifier] '->')?
	variable=VariableUse
	'=' 
	expression=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)* ';' )?
	'}')?
	';';


Behaviour returns tdl::Behaviour:
  TimerStart 
| TimerStop 
| TimeOut 
| Wait 
| Quiescence 
| PeriodicBehaviour 
| AlternativeBehaviour 
| ParallelBehaviour 
| BoundedLoopBehaviour 
| UnboundedLoopBehaviour 
| ConditionalBehaviour 
| CompoundBehaviour 
| OptionalBehaviour 
| DefaultBehaviour 
| InterruptBehaviour 
| VerdictAssignment 
| Assertion 
| Stop 
| Break 
| Assignment 
| InlineAction 
| ActionReference 
| TestDescriptionReference 
| Interaction
Loading
Loading full blame…