How to handle left-recursive Call graphs in xtext? [message #1695265] |
Wed, 13 May 2015 02:39  |
Eclipse User |
|
|
|
Hello Community,
I am currently working on a project for the university and I need to implement a language that can be used by schooled personel. That means: I need to give them a short introduction to the language and they should know how to use it.
The project is about CEP (Complex event processing), but the time we have only allows a simple IF - THEN architecture.
So here is the grammar (I already put it in xtext like this, so if you want to know the exact problems you may simply add it into your eclipse editor):
/* The general appearance of the language */
ruleLanguage:
'if ['timeInMs=INT']('CONDITIONS')then('ACTIONS')';
/* There can be as many conditions as the user wants to */
/* link to another*/
CONDITIONS:
SCOND | CONDITIONS '&' SCOND;
/* This is how one condition is set up: */
/* name << value */
/* for example: */
/* sensor1.temperature << 100°C*/
SCOND:
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:
ACTION | ACTIONS '&' ACTION;
/* An action has a name and gets a parameter list, e.g.: */
/* sendEmail ("example@googlemail.com") */
ACTION:
fname=ID '(' PARLIST ')';
/* Whatever comes here should just be given to the */
/* called function of the main program */
PARLIST:
'(' INT ')' | '(' ID ')';
I already googled this of course, but I don't understand the answers or at least don't know how to tailor them to my problem.
I would be deeply grateful for your help.
Greetings,
Dominik Reinert
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04677 seconds