ATSyRA Studio

ATSyRA Building Language Reference

ATSyRA Building Language Reference
TODO list of Building language keyword and links to other section in the user guide

1. Building language textual syntax

Building comes with several concrete syntaxes, one of them is a textual syntax written with xText.

1.1. Building language XText grammar

Building xText grammar from fr.irisa.atsyra.building.xtext plugin :

building.xtext
// automatically generated by Xtext
grammar fr.irisa.atsyra.building.xtext.Building with org.eclipse.xtext.common.Terminals

import "http://www.irisa.fr/atsyra/building"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore


BuildingModel returns BuildingModel:
	{BuildingModel}
	(imports += Import)*
	(buildings += Building)* 
//	(buildingConfigurations+= BuildingConfiguration)* 
	;
Import returns Import:
    'import' importURI = EString;
    
Building returns Building:
	{Building}
	'Building'
	name=EString
	'{'
		( accesses+=Access | alarms+=Alarm |  attackers+=Attacker | items+=Item | zones+=Zone)*
	'}';

//BuildingConfiguration returns BuildingConfiguration:
//	{BuildingConfiguration}
//	'BuildingConfiguration'
//	'{'
//		( 	accessConfigurations+=AccessConfiguration |
//			alarmConfigurations+=AlarmConfiguration |
//			attackerConfigurations+=AttackerConfiguration| 
//			itemConfigurations+=ItemConfiguration  )*
//	'}';

EString returns ecore::EString:
	STRING | ID;

Zone returns Zone:
	{Zone}
	'Zone'
	name=EString
	'{'
		('alarms' '(' alarms+=[Alarm|EString] ( "," alarms+=[Alarm|EString])* ')' )?
	'}';

Alarm returns Alarm:
	{Alarm}
	'Alarm'
	name=EString
	'{'
		('location' location=[Zone|EString])?
	'}';

Access returns Access:
	Virtual | Door | Window | Badged
	;
	
Virtual returns Virtual:
	'Virtual' 'access'
	name=EString
	'{' 'zone1' zone1=[Zone|EString] 'zone2' zone2=[Zone|EString] '}';
	
Door returns Door:
	'Door'
	name=EString
	'{'
		('level' level=EInt)?
		('zone1' zone1=[Zone|EString])?
		('zone2' zone2=[Zone|EString])?
		('keys' '(' keys+=[Item|EString] ( "," keys+=[Item|EString])* ')' )?
		('alarms' '(' alarms+=[Alarm|EString] ( "," alarms+=[Alarm|EString])* ')' )?
	'}';
	
Window returns Window:
	'Window'
	name=EString
	'{'
		('level' level=EInt)?
		('inside' inside=[Zone|EString])?
		('outside' outside=[Zone|EString])?
		('alarms' '(' alarms+=[Alarm|EString] ( "," alarms+=[Alarm|EString])* ')' )?
	'}';
	
Badged returns BadgedDoor:
	'BadgedDoor'
	name=EString
	'{'
		('level' level=EInt)?
		('inside' inside=[Zone|EString])?
		('outside' outside=[Zone|EString])?
		('badges' '(' badges+=[Item|EString] ( "," badges+=[Item|EString])* ')' )?
		('alarms' '(' alarms+=[Alarm|EString] ( "," alarms+=[Alarm|EString])* ')' )?
	'}';

Item returns Item:
	{Item}
	'Item'
	name=EString;

Attacker returns Attacker:
	{Attacker}
	'Attacker'
	name=EString
	'{'
		('level' level=EInt)?
	'}';

//AlarmConfiguration returns AlarmConfiguration:
//	{AlarmConfiguration}
//	'Alarm'
//	alarm=[Alarm|EString]
//	'{'
//		((isEnabled?='isEnabled')? &
//		(wasTriggered?='wasTriggered')?)
//	'}';
//	
//AccessConfiguration returns AccessConfiguration:
//	{AccessConfiguration}
//	'Access'
//	access=[Access|EString]
//	'{'
//		((isOpen?='isOpen' )? &
//		(isLocked?='isLocked')?)
//	'}';
//ItemConfiguration returns ItemConfiguration:
//	{ItemConfiguration}
//	'Item'
//	item=[Item|EString]
//	'{'
//		(('localization' localization=[Zone|EString])? & 
//		('ownedBy' ownedBy=[Attacker|EString])?)
//	'}';
//AttackerConfiguration returns AttackerConfiguration:
//	{AttackerConfiguration}
//	'Attacker'
//	attacker=[Attacker|EString]
//	'{'
//		('localization' localization=[Zone|EString])?
//	'}';

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

EInt returns ecore::EInt:
	'-'? INT;