Treffer: Translating c into java bytecode / ; C kalba parašytų programų transliavimas į Java JVM baitų kodą.
Weitere Informationen
In chemo-informatics several popular libraries exist: OpenBabel [GCC*20], written in C++, and CDK [CYS*03], OpenChemLib [Joe18], Jumbo [Bob97], all written in Java. There is a need to process data from files with crystallographic information in these libraries. Crystallographic Information File/Framework (CIF) [HWS*06, BBB*16] specifies a standardized file format for the archiving and distribution of crystallographic information. It is promoted by the International Union for Crystallography (IUCr) [FWB*06]. To read information into programs from CIF files a COD CIF parser is needed. Unfortunately, there does not exist a high-quality parser for CIF files for Java language. Therefore, it is desirable to port existing CIF parsers written in C to a pure Java environment without using Java Native Interface (JNI). This thesis will investigate how to create a C to Java bytecode compiler. The thesis investigates possible ways to translate C into Java bytecode. The main challenge is to simulate the C memory inside JVM, for that, we propose a single class which will simulate behavior of malloc() and free() functions. Those functions are custom and implemented only in this work. The developed compiler cannot compile entire COD CIF parser into Java bytecode, but it solves the gap between C and Java. The supported features of developed compiler are enough to cover pointers, functions, structures, method calls and successfully translate them into bytecode.