Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Deriving model from binary class files
Deriving model from binary class files [message #1821381] Wed, 12 February 2020 03:40
Eclipse UserFriend
I've been working on a JVM-based programming language for a while. The language is somewhat similar to Java, but has some extensions and some restrictions compared to plain Java. Notably, due to some of the extensions, the source code cannot generally be translated to Java source code, and there is a compiler back end that directly produces JVM bytecode from the AST/domain model.

Now, in addition to the primary source files, I want to incorporate pre-compiled libraries, just like one would include additional JARs on the class path (in fact, the libraries are just that, plain JARs). To compile source code against these JARs I somehow need to infer, at least partially, the domain model and AST based on the content of the JAR. I basically need classes and method signatures (no method implementations), so that the scope provider can resolve cross-references to elements that are defined in the library.

For some reason, I'm having a hard time finding existing examples of this kind of mechanism in other Xtext languages. I already have a simple implementation of IJvmModelInferrer, but since I'd like to infer domain elements (not JVM types) this does not seem the right spot for what I'm trying to do. IResourceServiceProvider and its related interfaces (e.g., IResourceDescription.Manager) seem more promising, but I can't quite put all the pieces together.

I am also wondering if I'm not making all this too complicated, and there is already some brilliantly simple mechanism to facilitate what I'm trying to do (as there often is with Xtext and EMF :-) )

Long story short: what is the recommended or standard mechanism to generate models/ASTs for binary libraries (that don't come with sources) so that they can be linked with another model that is generated from source?
Previous Topic:Xtext will drop support for the old generator in 2.22 / 2020-06
Next Topic:Programmatically set target platform to manage external libraries
Goto Forum:
  


Current Time: Fri Jul 04 09:02:26 EDT 2025

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

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

Back to the top