Home » Java Compiler and How it works

Java Compiler and How it works

What is a compiler

A compiler is basically itself a program that reads a program written in the high level object oriented programming language and converts it into the machine or computer readable binary codes or language and at the same time, it also reports the errors in the program if any. Java compiler either converts the complete source code in one go or may take multiple passes to do so. However finally, the user gets the compiled code that is prepared to execute. This compiler generated target code file could be run with many alternative inputs, over and over. But you don't need or use the compiler for the sequent reruns. To know in detail about the Java compiler and more about Java, we recommend anyone to take up Java course.

Usually, the source code could be a high level language than the destination form, like when converting the C language to machine language. However converting from JavaScript 8 to JavaScript 5 is also a form of compilation.

Compiler usually operates on phases and numerous stages which are often classified into 2 phases that are:

  • Analysis phase of the compiler is also known as the front end operation during which program is split into fundamental constituent components and checks grammar, linguistics and syntax of the code once that intermediate code is generated. Analysis part includes lexical analyzer, linguistics analyzer, and syntax analyzer.
  • Synthesis phase of the compiler is also referred to as the back end during which intermediate code is optimized, and therefore the target code is generated. Synthesis part includes code optimizer and code generator.
Email Address
Mobile Number