Preview

Compiler Phases

Good Essays
Open Document
Open Document
306 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Compiler Phases
The compiler has a number of phases plus symbol table manager and an error handler.

Input Source Program ↓ Lexical Analyzer ↓ Syntax Analyzer ↓
Symbol Table Manager Semantic Analyzer Error Handler ↓ Intermediate Code Generator ↓ Code Optimizer ↓ Code Generator ↓ Out Target Program
The cousins of the compiler are

Preprocessor.
Assembler.
Loader and Link-editor.
Front End vs Back End of a Compilers. The phases of a compiler are collected into front end and back end.

The front end includes all analysis phases end the intermediate code generator.

The back end includes the code optimization phase and final code generation phase.

The front end analyzes the source program and produces intermediate code while the back end synthesizes the target program from the intermediate code.

A naive approach (front force) to that front end might run the phases serially.

Lexical analyzer takes the source program as an input and produces a long string of tokens.
Syntax Analyzer takes an out of lexical analyzer and produces a large tree.
Semantic analyzer takes the output of syntax analyzer and produces another tree.
Similarly, intermediate code generator takes a tree as an input produced by semantic analyzer and produces intermediate code.
Minus Points

Requires enormous amount of space to store tokens and trees.
Very slow since each phase would have to input and output to and from temporary disk
Remedy

use syntax directed translation to inter leaves the actions of phases.
Compiler construction tools.
Parser Generators:
The specification of input based on regular expression. The organization is based on finite automation.
Scanner Generator:
The specification of input based on regular expression. The organization is based on finite automation.
Syntax-Directed Translation:
It walks the parse tee and as a result

You May Also Find These Documents Helpful

  • Satisfactory Essays

    5. In process window select check syntax for checking the syntax shown in figure 5. After successful completion of check syntax generate syntax report in…

    • 419 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    In this phase a token is generated against all the lexemes in the source code. These lexemes and tokens are stored in the Symbol Table. Tokens against the lexemes are generated based on some patterns or rules.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Homework Week 2

    • 743 Words
    • 3 Pages

    A compiler translates one computer language into another. It also pics up errors in the program being put together.…

    • 743 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    pt1420 exam review

    • 738 Words
    • 3 Pages

    What is used to translate high level language programs to machine language (or machine code)? Compiler…

    • 738 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Mis 302 Flowchart

    • 262 Words
    • 2 Pages

    Complete Java Program to accept the required input and accordingly produce the output as expected.…

    • 262 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Accounting Midterm

    • 1771 Words
    • 10 Pages

    In an automated system, the entering of data and transferring of information is done by following the same steps as in a manual system.…

    • 1771 Words
    • 10 Pages
    Satisfactory Essays
  • Powerful Essays

    MSCD600 Course Project

    • 1578 Words
    • 18 Pages

    Therefore automation deals with problems related to manual file systems and tries to remove them in the best suitable fashion. The new system will cater to the need of the salespersons of any supermarket so that they can manage the system efficiently.…

    • 1578 Words
    • 18 Pages
    Powerful Essays
  • Satisfactory Essays

    Inch and Lt

    • 1077 Words
    • 5 Pages

    2. What does a compiler do? What kinds of errors are reported by a compiler?…

    • 1077 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    The following information will introduce general knowledge in basic programming concepts. It shall discuss basic types of computer programming languages as-well-as program development. There are three basic types of computer programming languages that will be discussed in a simple and easy to understand manner. We shall also describe the program development cycle and discuss why it is important to use a structured and organized process to create a computer programming language.…

    • 1318 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Week 1 Homework

    • 843 Words
    • 5 Pages

    2. What does a compiler do? What kinds of errors are reported by a compiler?…

    • 843 Words
    • 5 Pages
    Good Essays
  • Good Essays

    The compiler adds a symbol table to the executable so that variable names from the source code can be understood. The compiler avoids optimizing operations so that lines of code in the executable can be related to the original lines of source code.…

    • 567 Words
    • 3 Pages
    Good Essays
  • Better Essays

    Symbol Table

    • 1792 Words
    • 8 Pages

    A compiler uses a symbol table to keep track of scope and binding information about names.…

    • 1792 Words
    • 8 Pages
    Better Essays
  • Satisfactory Essays

    Passport Automation System

    • 2050 Words
    • 9 Pages

    To develop the passport automation system software using UML language. It is the interface between applicant and authority responsible for issue the passport. It aims at improving efficiency and reducing complexities.…

    • 2050 Words
    • 9 Pages
    Satisfactory Essays
  • Powerful Essays

    Pharmacy Management System

    • 1772 Words
    • 8 Pages

    This system is developed to automate data for the organization named Bete Zata Voluntary Counseling and Testing in Awassa town. The system that is going to be developed is concerned with different tasks. For example, it automates data on patients; it records blood test result, records data on trainees etc. It revolves about how patients get service and counseling. It also stores data like patient data, trainees’ data, counselor data, trainer data, etc.…

    • 1772 Words
    • 8 Pages
    Powerful Essays
  • Powerful Essays

    There are hundreds of programming languages, including Perl, Java, Visual Basic, FORTRAN, Apple Script and D, which most programmers specialize in several families. This stage of software development is commonly done solo, though multiple programmers might work on different aspects of large computer programs. When the initial software is completed it goes through a debugging stage. Bugs are flaws in the program that cause it to fail, crash, hang, return a false result, or behave in an undesirable fashion. Debugging is a very intense stage of development that can take hundreds of hours. After a stable release has been issued, the attention turns to…

    • 3923 Words
    • 16 Pages
    Powerful Essays

Related Topics