|
|
|
|
|
|
Re: How to handle left-recursive Call graphs in xtext? [message #1695416 is a reply to message #1695413] |
Thu, 14 May 2015 11:47 |
|
you basically miss tons of assignments
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
ruleLanguage:
'if ['timeInMs=INT']('conds=CONDITIONS')then('actions=ACTIONS')';
/* There can be as many conditions as the user wants to */
/* link to another */
CONDITIONS returns Expression:
SCOND ({CONDITIONS.left=current} '&' right=SCOND)*;
/* This is how one condition is set up: */
/* name << value */
/* for example: */
/* sensor1.temperature << 100°C */
SCOND returns Expression:
sname=ID COMP value=INT;
/* These are the possible operators (comparison only) */
COMP:
'<<' | '>>' | '==' | '<=' | '>=';
/* The conditions defined earlier can also have as many */
/* actions as the user wants */
ACTIONS returns Expression:
ACTION ({ACTIONS.left=current}'&' right=ACTION)*;
/* An action has a name and gets a parameter list, e.g.:*/
/* sendEmail ("example@googlemail.com") */
ACTION returns Expression:
fname=ID '(' params=PARLIST ')';
/* Whatever comes here should just be given to the */
/* called function of the main program */
PARLIST returns Expression:
MOREPAR ({PARLIST.left=current} ',' right=MOREPAR)*;
MOREPAR returns Expression:
{MOREPAR}MOREPARValue=MOREPARValue ;
MOREPARValue returns ecore::EString:(INT | ID);
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.04342 seconds