Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8140885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:18:52+00:00 2026-06-06T12:18:52+00:00

I am writing a simple little DSL for specifying constraints on messages, and Have

  • 0

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:

grammar org.xtext.businessrules.BusinessRules with org.eclipse.xtext.xbase.Xbase
//import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
generate businessRules "http://www.xtext.org/businessrules/BusinessRules"

Start:
    rules+=Constraint*;

Constraint:
    {Constraint}
    'FOR' 'PAYLOAD' payload=PAYLOAD 'ELEMENT' element=ID 'CONSTRAINED BY' constraint=XExpression;



PAYLOAD:
    "SimulationSessionEvents"
    |"stacons"
    |"any"
;



Range:
    'above' min=INT ('below' max=INT)?
    |'below' max=INT ('above' min=INT)?
;

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.

edit:
The buildpath for the project is the following:

C:\Program Files\eclipse\plugins\org.eclipse.xtext_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.ecore.xmi_2.7.0.v20120127-1122.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.ecore_2.7.0.v20120127-1122.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.common_2.7.0.v20120127-1122.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtext.util_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\com.google.guava_10.0.1.1.jar
C:\Program Files\eclipse\plugins\com.google.inject_3.0.0.no_aop.jar
C:\Program Files\eclipse\plugins\javax.inject_1.0.0.v20091030.jar
C:\Program Files\eclipse\plugins\org.antlr.runtime_3.2.0.v201101311130.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe.core_1.2.1.v201112070431.jar
C:\Program Files\eclipse\plugins\org.apache.commons.cli_1.2.0.v201105210650.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe2.runtime_2.2.0.v201112070431.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe.utils_1.2.1.v201112070431.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtext.xbase_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtext.common.types_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.apache.log4j_1.2.15.v201012070815.jar
C:\Program Files\eclipse\plugins\org.apache.commons.logging_1.0.4.v201101211617.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtext.generator_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtend_1.1.0.v201108020519.jar
C:\Program Files\eclipse\plugins\com.ibm.icu_4.4.2.v20110823.jar
C:\Program Files\eclipse\plugins\org.eclipse.xpand_1.1.0.v201108020519.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtend.typesystem.emf_1.0.1.v201108020519.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.codegen.ecore_2.7.0.v20120130-0943.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.codegen_2.6.0.v20120130-0943.jar
C:\Program Files\eclipse\plugins\de.itemis.xtext.antlr_2.0.0.v201108011202.jar
C:\Program Files\eclipse\plugins\org.antlr.generator_3.2.0.v201108011202.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe2.lib_2.2.0.v201112070431.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtext.xbase.lib_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.eclipse.xtend2.lib_2.2.1.v201112130541.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe2.launch_2.2.0.v201112071250.jar
C:\Program Files\eclipse\plugins\org.eclipse.emf.mwe2.language_2.2.0.v201112071250.jar
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:18:53+00:00Added an answer on June 6, 2026 at 12:18 pm

    Problem fixed, it turns out you need to include the xbase.lib jar on the build path of the project that actually declares models of your DSL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have question... iam writing simple html page with little bit of css. EVERYTHING
Hi I'm writing a pretty simple little instagram plugin that allows you to embed
I have been writing my scripts for FF but was hoping with little work
I'm trying to learn a little more on vectormath through writing a simple ray
I am writing a simple little piece of code to draw pixels wherever the
I'm teaching myself C++, and in the process I'm writing simple little programs to
I'm writing a simple little game for my kids - it doesn't really matter
I'm writing a simple little ocaml program that reads an algebraic statement in from
I'm writing a simple ini file parser and I'm having a little problem with
I'm learning Rails, and got into a little problem. I'm writing dead simple app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.