blob: 4392eb8b3eb119ea1f84fa51722137e14d2510ed [file] [log] [blame]
grammar org.eclipse.xtext.example.fowlerdsl.Statemachine with org.eclipse.xtext.common.Terminals
generate statemachine "http://www.eclipse.org/xtext/example/fowlerdsl/Statemachine"
Statemachine :
{Statemachine}
('events'
events+=Event+
'end')?
('resetEvents'
resetEvents+=[Event]+
'end')?
('commands'
commands+=Command+
'end')?
states+=State*
;
Event:
name=ID code=ID
;
Command:
name=ID code=ID
;
State:
'state' name=ID
('actions' '{' actions+=[Command]+ '}')?
transitions+=Transition*
'end'
;
Transition:
event=[Event] '=>' state=[State]
;