Changes between Version 47 and Version 48 of j2p
- Timestamp:
- 11/06/23 10:12:36 (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
j2p
v47 v48 23 23 There are two main translation components in the core: 24 24 1. The translator that parses java file with [https://github.com/javaparser/javaparser Javaparser] and creates equivalent python code. 25 2. per-java-class translators that know how to translate all calls to any java class method or field into equivalent python code. This code is using introspection and assumes all used java classes are available, either through libraries or from the java compiler.25 2. per-java-class translators that know how to translate all calls to any java class method or field into equivalent python code. This code is using java-side code introspection to determine argument types, and therefore requires all referred java classes are actually available in compiled form, either through libraries or from the java compiler. 26 26 27 (1) generic and used for all java programs. It is currently pretty complete but details will be filled in over time as the need arises to support more java syntax.27 (1) is generic and used for all java programs. It is currently pretty complete but details will be filled in over time as the need arises to support more java syntax. 28 28 29 29 (2) is currently very partial. The reason is that there are a huge number of java classes and even more 3rd party libraries, and almost every field and function in it will need a specialized translator. This will grow slowly over time as needed. 30 30 31 31 32 The mechanism assumes a fixed mapping from java to python objects, as in the table below. This fixed mapping is needed to ensure the translator can be sure which objects will appear on the python side of the translation, so that proper actions can be taken to further the translation.32 The mechanism assumes a fixed mapping from java classes to python classes, as in the table below. Also it is assumed that the equivalent classes have roughly the same functionality, even if the actual function names and arguments may differ. This fixed mapping is needed to ensure the translator can be sure which classes will appear on the python side of the translation, so that proper actions can be taken to further the translation. 33 33 34 34 ==== constructs