T
T
timonestudio2021-11-27 13:34:05
Java
timonestudio, 2021-11-27 13:34:05

How to make a SI compiler in Java?

And so, I need a C to Java compiler. I am writing an Editor of C code for the Android platform. How to make a C compiler?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
Wataru, 2021-11-27
@wataru

Are you sure? To create a C compiler from scratch, even a very trivial one, even using all sorts of parser generators, is several months of work by a whole team of specialists.
You need to understand assembler, have knowledge of the theory of compilers (there are many books), the theory of languages.
If you just need to tie the compilation to your editor, then, like many other IDEs, you will only need to run a third-party compiler (be it gcc, clang, visual studio, or something else).
They all have a console application that can be passed files as arguments on the command line. You just have to figure out how to run applications in Java.

V
Vasily Bannikov, 2021-11-27
@vabka

You don't need to write your compiler in Java.
You can bring a ready-made one with you - at least gcc, at least tcc, at least clang.
https://stackoverflow.com/questions/11852187/how-t...
But if you want to do it yourself from scratch - just like in any other language.

A
AlexVWill, 2021-11-27
@AlexVWill

I hope you understand that Android uses a JAVA virtual machine?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question