|
|
|
|
|
Re: cross references and the next rule without keyword [message #1013024 is a reply to message #1013019] |
Fri, 22 February 2013 16:13 |
|
then there must be something else in your grammar here is my test
Model:
states+=StateDeclaration*
vars+=Variable*
trans+=Transition
;
StateDeclaration:
"state" name=ID
;
Variable:
"var" name=ID
;
Transition:
'from'( initial+=InitialState)*
action=StatementSequence
;
InitialState:
origin=[StateDeclaration] (read ?= '?')?
;
StatementSequence returns Statement:
Statement ({StatementSequence.statements+=current} ';' statements+=Statement)*
;
Statement:
NullStatement //start with 'null'
| ToStatement //start with 'to'
| PatternStatement ;
NullStatement:
{NullStatement}'null'
;
ToStatement:
{ToStatement} 'to'
;
PatternStatement:
var=[Variable] ':=' exp=ID
;
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Powered by
FUDForum. Page generated in 0.03077 seconds