Loading operator extension from Jar file [message #1734022] |
Fri, 03 June 2016 06:43 |
|
Dear all.
I'm writing an library that is providing math primitives such as vectors, matrices, etc.
Currently, I have hard-coded the Xbase operators in the primitives by creating functions like:
public Vector operator_plus(Vector a) {
Vector v = new Vector(this);
v.add(a);
return v;
}
The use of the operators in my DSL is working.
Now, I would like to move these functions into a static utility class similar to the MapExtensions provided by Xtext.
The problem is:
is it possible for the DSL compiler to automatically load this extension when the Jar file of my math library is present in the classpath of the compiled project?
I would like to find some automatic approach that do not requires to change neither the compiler's configuration nor its code.
I know how to add an extension in the DSL compiler. But I would like to know if the Xtext provides tools for dynamic loading.
All the best.
Stéphane.
|
|
|
|
Re: Loading operator extension from Jar file [message #1734160 is a reply to message #1734149] |
Sun, 05 June 2016 14:34 |
|
Thank you for your reply.
Are the ImplicityImportedFeatures or StaticImplicitMethodsFeatureForTypeProvider able to dynamically load the extensions by reading the MANIFEST file of a JAr file in the classpath.
In other words, is it possible to implicitly load features stored in a Jar file, just by adding this Jar file.
If not, I should specialize ImplicityImportedFeatures or StaticImplicitMethodsFeatureForTypeProvider in my DSL compiler.
All the best.
Stéphane.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04355 seconds