GUI jars depending on overture Values
Is there any way we can change the dependencies in the jar lib/graphics.jar in the example project "BuslinesPP" such that it is dependent on the VDMJ Values and not the Overture Values?
Same for project "BuslinesWithDBPP"
If we have the Java sources, then of course we can change them and rebuild. But this is an annoying problem for several Overture/VSCode users: they have developed native libraries that are not portable to the new environment.
It might be possible to write some sort of "bridge" jar, with org.overturetool.interpreter.Values that delegate to VDMJ Values. But the problem would then be how to construct the bridge Values. Or it might be possible to write a visitor that converts one to the other, but again you would have to call something new, so you still end up re-compiling code.
Is it possible to create a jar that has the same package name. E.g. export as "org.overture.interpreter.values.IntergerValue" then that links to the VDMJ lib? I would think that you don't need to recompile then?
List of projects that have jars that needs an update, when we figure out what to do:
- [ ] PP/BuslinePP
- [ ] PP/BuslinesWithDBPP
- [ ] PP/CodegenPP
- [ ] PP/MSAWseqPP
Will update as I go through the examples
It's easy to create a jar with Overture class names, but you can't link those using the VDMJ jar because its classes have their own package built in. That's what I meant above: you can create such a bridge, but you can't construct the bridge class Values without changing the user code somehow. For example, if they have a native method that is passed an Overture value, who constructs that Overture/bridge Value? VDMJ would have to look for different method signatures and convert them... which is pretty ugly :-(
I think the bottom line here is that we can't easily fix native Overture examples. The simplest solution is to drop them from the examples (and perhaps supply new ones with VDMJ native calls).