开发者

compiler for java [closed]

开发者 https://www.devze.com 2023-01-24 04:03 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, v开发者_运维问答ague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
It's difficult to tell what is being asked here. This question is ambiguous, v开发者_运维问答ague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消