compiler for java [closed]
how create a compiler for java using a java program
Since Java 1.6 there is actually a compiler API built into the standard API:
- Java SE 6 Compiler API
You could have a look at these classes / interfaces for instance
Compiler
JavaCompiler.CompilationTask
- Understand the theorem on compiler construction
- Implement your own compiler in java. See how MiniJava was formed.
This will be a very hard job. My advice: Don't do it. Search for an existing one on the web.
If you're using Java to build a Java compiler, first you'll need an existing Java compiler. If you have an existing Java compiler, then you don't need to build one in the first place, unless you really want to. In that case, look at other people's answers and know that building a compiler isn't trivial.
Well, you can call java compiler from java program with JavaCompiler class.
精彩评论