Symbol Table: Introduction

Symbol Table: Introduction

Subject: Compiler Design Symbol Table: Introduction It is a data structure of the compiler 2)Source code-> compiler-> targetcode 3)source code-> enters into front end also called Analysis(Lex.Ana, symantic and syntax analysis)-> generation intermediate code-> backend(synthesis) Compiler role: it consist all the data structure(variables(name, types, attributes,scopes,states) ->accumulated in the symbol table),that contain the source program and it also convey information of the source code Symbol table creation is done at the beginning of the front end How symbol table help us? It gives name of all the identifiers of the SC Associated information related to the name and variable How we can access the related information *What all attributes related to an identifier is provided by the symbol table-> procedure call,type,record etc. Who creates this table? 1)this symbol is created at the analysis part by the help of the scanner. This scanner collects information and enters the data into the symbol table Note: It enters data that is not present before in the symbol table What is the use? 1) Used by both front end and back end 2) Just to check the identifiers present the source 3) To check the assignment and expression statements 4) To generate intermediate and target code Implementation of the symbol table: Operations used: Insert()-> to insert value in the table , lookup()-> to search avalue in a symbol table 1)Hash table 2)Binary Search tree 3)Link list Int a LB1 UB1 Symbol table scope: Whenever we declare an element in a program then that elements scope and their areas of implementation applies A C B Block Global: Real, integer,A,B Block A: Real , integer Block B: Real, integer Block A and B are nested to global .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us