Compiler Construction



Download 1.49 Mb.
Page14/14
Date15.03.2021
Size1.49 Mb.
#56076
1   ...   6   7   8   9   10   11   12   13   14
Compiler Construction lec 01

Structure of compiler


Two main phases of Compiler

1. Analysis



2. Synthesis

Analysis phase of compiler

  • Also known as front end of compiler
  • The analysis part breaks up the source program into constituent pieces and imposes a grammatical structure on them.
  • It then uses this structure to create an intermediate representation of the source program
  • If the analysis part detects that the source program is either syntactically ill formed or semantically unsound, then it must provide informative messages, so the user can take corrective action.
  • And also checks and indicates the syntax and semantic errors of a source program.
  • The analysis part also collects information about the source program and stores it in a data structure called a symbol table, which is passed along with the intermediate representation to the synthesis part

Synthesis phase of compiler

  • The synthesis part constructs the desired target program from the intermediate representation and the information in the symbol table.
  • It will get the analysis phase input(intermediate representation and symbol table) and produces the targeted machine level code.
  • This is also called as the back end of a compiler.

Download 1.49 Mb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   14




The database is protected by copyright ©ininet.org 2024
send message

    Main page