0% found this document useful (0 votes)
242 views

Compiler

A compiler is a computer program that translates source code written in one programming language into another target language, such as assembly language or machine code. The most common reason for compiling source code is to create an executable program. A compiler typically performs operations like lexical analysis, preprocessing, parsing, semantic analysis, code generation, and code optimization to transform the source code accurately and efficiently. Ensuring a compiler's correctness is important as faults can be difficult to detect and address.

Uploaded by

priyeshdongre
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
242 views

Compiler

A compiler is a computer program that translates source code written in one programming language into another target language, such as assembly language or machine code. The most common reason for compiling source code is to create an executable program. A compiler typically performs operations like lexical analysis, preprocessing, parsing, semantic analysis, code generation, and code optimization to transform the source code accurately and efficiently. Ensuring a compiler's correctness is important as faults can be difficult to detect and address.

Uploaded by

priyeshdongre
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Compiler

This article is about the computing term. For the anime, see Compiler (anime).

A diagram of the operation of a typical multi-language, multi-target compiler


A compiler is a computer program (or set of programs) that transforms source code written in a programming language(the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for wanting to transform source code is to create an executable program. The name "compiler" is primarily used for programs that translate source code from a high-level programming languageto a lower level language (e.g., assembly language or machine code). If the compiled program can run on a computer whose CPU or operating system is different from the one on which the compiler runs, the compiler is known as a cross-compiler. A program that translates from a low level language to a higher level one is a decompiler. A program that translates between high-level languages is usually called a language translator, source to source translator, or language converter. A language rewriter is usually a program that translates the form of expressions without a change of language.

A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis (Syntax-directed translation), code generation, and code optimization. Program faults caused by incorrect compiler behavior can be very difficult to track down and work around; therefore, compiler implementors invest significant effort to ensure the correctness of their software. The term compiler-compiler is sometimes used to refer to a parser generator, a tool often used to help create the lexerand parser.

You might also like