Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to embed XBase expressions in an Xtext DSL
How to embed XBase expressions in an Xtext DSL [message #891853] Tue, 26 June 2012 09:48 Go to next message
Marcus Mathioudakis is currently offline Marcus MathioudakisFriend
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

Re: How to embed XBase expressions in an Xtext DSL [message #891858 is a reply to message #891853] Tue, 26 June 2012 10:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Make sure xbase.lib is on the class path of the project containing
the model file


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to embed XBase expressions in an Xtext DSL [message #892135 is a reply to message #891858] Wed, 27 June 2012 07:49 Go to previous message
Marcus Mathioudakis is currently offline Marcus MathioudakisFriend
Messages: 18
Registered: June 2012
Junior Member
Many Thanks! that fixed the problem
Previous Topic:Grammar causing outofmemory error
Next Topic:resolving links in tests
Goto Forum:
  


Current Time: Fri Mar 29 08:47:26 GMT 2024

Powered by FUDForum. Page generated in 0.02769 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top