Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XBase extension works! But only with manual classpath.(How to create a DSL that extends Xbase.)
XBase extension works! But only with manual classpath. [message #723748] Fri, 09 September 2011 10:50
Mark Utting is currently offline Mark UttingFriend
Messages: 9
Registered: August 2011
Junior Member
I'm creating a DSL that extends Xbase, and for the last month or so, I've been having trouble getting access to the predefined operators of XBase like '+'.

When I use my DSL (which is just a copy of PureXBase at the moment) as an Eclipse application, it can parse and evaluate expressions like:

"abcdef".substring(2,5)
// cde

but not:

1+2 // error: Couldn't resolve reference to JvmIdentifiableElement '+'.


Today I discovered that if I manually add org.eclipse.xtext.xbase.lib_2.0.1*.jar to the Java project that contains my example DSL file (in runtime-EclipseApplication), it finds the '+' (which lives in org.eclipse.xtext.xbase.lib.IntegerExtensions)!
Seems an obvious thing to try, in *retrospect*! Smile.

But presumably this IntegerExtensions class should be added to the classpath automatically somehow? It shouldn't be necessary for every user of my DSL to manual configure their project's classpath by adding this jar file?

What's the best way of adding the necessary .jar files to the DSL project classpath automatically?

Or do I need to write an Eclipse plugin that implements a 'new custom project' functionality? And if so, how should that plugin get hold of the correct .jar file to add it? What are all the .jar files that an XBase-based DSL will need?


(I'd been assuming that because my MANIFEST.MF has org.eclipse.xtext.xbase.lib in the Require-Bundle list, it would automatically be in the classpath of my DSL projects. But I can see that it is useful for the projects that use a plugin to have different classpaths from that plugin, in general.)


Thanks
Mark

Previous Topic:Xtend and XPand
Next Topic:Using ModifyListener in XtextEditor
Goto Forum:
  


Current Time: Fri Apr 26 15:33:53 GMT 2024

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

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

Back to the top