answersLogoWhite

0

In very broad terms a compiler takes input in some computer programming language and converts it to a form that can be executed by a processor.

Generally there are four main phases

  1. Lexical analysis
  2. Syntax analysis
  3. Code generation
  4. Linking

Lexical analysis takes the input and converts it to a stream of "tokens" which stand for things like reserved words, numbers or symbols from the language in which the original program was written.

Syntax analysis takes the tokens and does two things: verifies that the stream of tokens conforms to the rules of the programming language, and builds a tree structure that represents what the program is doing.

Code generation takes the tree structure and generates executable machine code (or virtual machine code for virtual machines such as Java).

Linking takes the generated code and combines it with other compiled modules and/or run-time libraries to produce a final executable file or "image".

At some stages code optimisation may be done by some compilers.

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

How program relocation in assembly language works?

trick question. it doesnt work.


How does an assembly to binary converter work?

An assembly to binary converter works by translating assembly language instructions into binary code, which is the language that computers understand. Each assembly instruction is converted into a series of 1s and 0s that represent specific operations and data. This conversion process allows the computer to execute the instructions given in assembly language.


What computer language uses mnemonic names?

Assembly Language


Why should you develop a detailed algorith for a program before writing down any assembly language instructions?

So it works.


Is c language assembly language?

No.


What Programming language is one step above machine language?

I guess you're trying to refer to Assembly language.


Reserved word in assembly language program?

use of reserved word in assembly language


How would you define assembly language?

assembly language uses abbreviation called menmonics.it is a bit easier to write computer programs in assembly language as compared to machine language but still requires skill and experienci.A program called assembler is used to convert an assembly language into machine language.


Is Assembly language is a high-level language?

No.


What is the relationship of assembly language to computer architecture?

Each class of CPU has its own assembly language.


What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.


Which program translate assembly language into machine language?

Assembly langue is translated into machine language by an assembler.