What is symbol table?

50 %
50 %
Information about What is symbol table?
Software

Published on October 12, 2014

Author: ShubhamShah001

Source: slideshare.net

Description

Symbol table what does it mean and its program

1. Walchand Institute of Technology Seminar On Symbol Table Genearation Presented by…… Name Shikha Gajul Pooja Kingi Kavita NamaBabita Pobatti Vaishali

2. What is Symbol Table ? The compiler has to identifier used in source program. It has to collect information about them like storage allocation for an identifier it’s type, scope where in program they are valid and in procedure name information about the : Type of its argument, Method of passing of this arguments , Type returned. All this is stored in data structure called Symbol Table. A symbol table is a necessary component because  Declaration of identifiers appears once in a program  Use of identifiers may appear in many places of the program text

3. USE OF SYMBOL TABLE Symbol table information is used by the analysis and synthesis phases. To verify that used identifiers have been defined (declared). To verify that expressions and assignments are semantically correct – type checking. To generate intermediate or target code.

4. #include<stdio.h> #include<conio.h> #include<string.h> void check_var(); FILE *fp; char ch; int i,j,k,m,ptr; char *str1[]={"int","float","char"}; void main() { char *word; clrscr(); printf("ntData type tLengthttSymbolttAddress"); fp=fopen("c:turboc3s.c","r"); if(fp==NULL) { printf("nCan't open a file."); return; }

5. while((ch=fgetc(fp))!=EOF) { i=0; *word=NULL; while((ch!='n')&(ch!=' ')&(ch!=EOF)) { word[i]=ch; ch=fgetc(fp); i++; } m=strlen(word); if(m!=i) { word[i]='0'; } for(k=0;k<3;k++) { ptr=strcmp(&(str1[k][0]),word); if(ptr==0) check_var(word); } } getch(); }

6. void check_var(char *word) { char word1[10]; int n; ch=fgetc(fp); while((ch!=';')&&(ch!='n')&&(ch!=EOF)) { printf("nnt"); fputs(word,stdout); if(k==0) fputs("tt2 bytes",stdout); else if(k==1) fputs("tt4 bytes",stdout); else if(k==2) fputs("tt1 byte ",stdout); n=0;

7. while((ch!=',')&&(ch!=';')&&(ch!=EOF)) { word1[n]=ch; ch=fgetc(fp); n++; } m=strlen(word1); if(m!=n) { word1[n]='0'; } printf("tt%s",word1); printf("tt%ld",*word1); ch=fgetc(fp); } return; }

8. INPUT

Add a comment

Related presentations

Speaker: Matt Stine Developing for the Cloud Track Marc Andressen has famou...

This presentation explains how to develop a Web API in Java using (JAX-RS or Restl...

1 App,

1 App,

November 10, 2014

How to bring innovation to your organization by streamlining the deployment proces...

Cisco Call-control solutions can handle voice, video and data

Nathan Sharp of Siemens Energy recently spoke at the SAP Project Management in Atl...

Related pages

Unicode®-Zeichentabelle - unicode-table.com

Alle Unicode-Zeichen auf einer Seite mit den Namen und Beschreibungen ...
Read more

Symbol table - Wikipedia

In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier in a program ...
Read more

c++ - What is a symbol table? - Stack Overflow

What is a symbol table? up vote 56 down vote favorite. 26. Can someone describe what a symbol table is within the context of C and C++? c++ c symbol-table.
Read more

Compiler Design - Symbol Table - Tutorialspoint

Compiler Design Symbol Table - Learn Compiler Designs basics along with Overview, Lexical Analyzer, Syntax Analysis, Semantic Analysis, Run-Time ...
Read more

Symbol Table (Linker and Libraries Guide) - Oracle

Symbol Table. An object file's symbol table holds information needed to locate and relocate a program's symbolic definitions and references. A symbol table ...
Read more

Debugging with GDB - Examining the Symbol Table

Examining the Symbol Table. The commands described in this section allow you to inquire about the symbols (names of variables, functions and types) defined ...
Read more

Adaptable Symbol Table Management by Meta Modeling and ...

Adaptable Symbol Table Management by Meta Modeling and Generation of Symbol Table Infrastructures Katrin Holldobler¨ Pedram Mir Seyed Nazari Bernhard Rumpe
Read more

c - gdb: "No symbol table is loaded" - Stack Overflow

(gdb) exec-file test (gdb) b 2 No symbol table is loaded. Use the "file" command. (gdb) ... GDB says “no symbol table,” but nm shows file has debug ...
Read more

SYMBOL TABLE - New Age International

SYMBOL TABLE SYMBOL TABLE CHAPTER HIGHLIGHTS 9.1 Operation on Symbol Table 9.2 Symbol Table Implementation 9.3 Data Structure for Symbol Table 9.3.1 List
Read more

HTML Symbols - W3Schools

HTML Symbol Entities. HTML entities were described in the previous chapter. Many mathematical, technical, and currency symbols, are not present on a normal ...
Read more