How to embed XBase expressions in an Xtext DSL [message #891853] |
Tue, 26 June 2012 09:48 |
Marcus Mathioudakis Messages: 18 Registered: June 2012 |
Junior Member |
|
|
I am writing a simple little DSL for specifying constraints on messages, and Have been trying without success for a while to embed XBase expressions into the language.
The Grammar looks like this:
Start:
rules+=Constraint*;
Constraint:
{Constraint}
'FOR' 'PAYLOAD' payload=PAYLOAD 'ELEMENT' element=ID 'CONSTRAINED BY' constraint=XExpression;
PAYLOAD:
"SimulationSessionEvents"
|"stacons"
|"any"
;
When trying to parse a file such as:
FOR PAYLOAD SimulationSessionEvents ELEMENT matrix CONSTRAINED BY ...
I can't get it to work for ... = any kind of Arithmetic expression, although it works for ...= loop or if expression, or even just a number. As soon as I do something like '-5' or '4-5' it says `Couldn't resolve reference to JvmIdentifiableElement '-'`, even though the Xbase.xtext Grammar looks like it allows these expressions.
I don't think I'm missing any Jars, as it doesn't complain when I run the mwe workflow, but only when trying to parse the input file.
Any help would be much appreciated.
Note: I have removed links due to "You cannot use links until you have posted more than 25 messages."
[Updated on: Tue, 26 June 2012 09:49] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04321 seconds