SlideShare a Scribd company logo
Walchand Institute of Technology 
Seminar On 
Symbol Table Genearation 
Presented by…… 
Name 
Shikha 
Gajul Pooja 
Kingi Kavita 
NamaBabita 
Pobatti Vaishali
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
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.
#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; 
}
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(); 
}
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;
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; 
}
INPUT

More Related Content

PPTX
Compiler and symbol table
PPTX
Compiler Engineering Lab#5 : Symbol Table, Flex Tool
PPTX
Symbol table design (Compiler Construction)
PPT
Symbol table management and error handling in compiler design
PDF
Symbol table in compiler Design
PPTX
compiler ppt on symbol table
PPTX
Symbol Table
Compiler and symbol table
Compiler Engineering Lab#5 : Symbol Table, Flex Tool
Symbol table design (Compiler Construction)
Symbol table management and error handling in compiler design
Symbol table in compiler Design
compiler ppt on symbol table
Symbol Table

What's hot (20)

DOCX
Yacc topic beyond syllabus
PDF
Compiler unit 4
PPTX
Lex & yacc
PPTX
6 compiler lab - Flex
PPTX
Intermediate code- generation
PDF
Handout#08
PDF
Handout#09
PDF
Compiler Design File
PPS
Clanguage
PDF
Assignment4
PPTX
Lexical analysis-using-lex
PPTX
Lexical analyzer generator lex
PPT
Symbol Table, Error Handler & Code Generation
PDF
Assignment2
PPTX
C language ppt
PDF
C intro
PDF
Assignment5
PDF
Unit iii
PPSX
Complete C programming Language Course
PPT
Yacc topic beyond syllabus
Compiler unit 4
Lex & yacc
6 compiler lab - Flex
Intermediate code- generation
Handout#08
Handout#09
Compiler Design File
Clanguage
Assignment4
Lexical analysis-using-lex
Lexical analyzer generator lex
Symbol Table, Error Handler & Code Generation
Assignment2
C language ppt
C intro
Assignment5
Unit iii
Complete C programming Language Course
Ad

Similar to What is symbol table? (20)

PPTX
C programming(part 3)
PPTX
Programming_in_C_language_Unit5.pptx course ATOT
PPTX
C data type format specifier
PPTX
Unit 2 CMath behind coding.pptx
PDF
C,c++ interview q&a
PPTX
programming in C and Datastructures deepdive
PDF
programming in C & Data structures an easy approach
DOC
Functions struct&union
PPSX
Esoft Metro Campus - Certificate in c / c++ programming
DOCX
OOP project report cipher c++ .docx
PPT
presentation_functions_1443207686_140676.ppt
PDF
CP Handout#2
PDF
Module_1_Introduction-to-Problem-Solving.pdf
PPTX
data_structure (1).pptx
PPTX
OOC MODULE1.pptx
PPTX
C Programming - Basics of c -history of c
PPTX
Language design and translation issues
PPTX
C_Progragramming_language_Tutorial_ppt_f.pptx
PPTX
Functions.pptx, programming language in c
PPT
Fundamental of C Programming Language and Basic Input/Output Function
C programming(part 3)
Programming_in_C_language_Unit5.pptx course ATOT
C data type format specifier
Unit 2 CMath behind coding.pptx
C,c++ interview q&a
programming in C and Datastructures deepdive
programming in C & Data structures an easy approach
Functions struct&union
Esoft Metro Campus - Certificate in c / c++ programming
OOP project report cipher c++ .docx
presentation_functions_1443207686_140676.ppt
CP Handout#2
Module_1_Introduction-to-Problem-Solving.pdf
data_structure (1).pptx
OOC MODULE1.pptx
C Programming - Basics of c -history of c
Language design and translation issues
C_Progragramming_language_Tutorial_ppt_f.pptx
Functions.pptx, programming language in c
Fundamental of C Programming Language and Basic Input/Output Function
Ad

More from Satyamevjayte Haxor (18)

DOCX
Processes and threads
PPTX
PPT
Uml class Diagram
DOCX
Uml Common Mechanism
PPTX
Types and roles
DOCX
States machine
PPTX
PPTX
sCode optimization
PPTX
Single Pass Assembler
PPTX
Nested micro
PPTX
Multiplier control unit
PPTX
Control unit design
PPTX
Direct linking loaders
PPTX
Two pass Assembler
PPTX
PPTX
Keyword Presentation
PPTX
Linking in MS-Dos System
Processes and threads
Uml class Diagram
Uml Common Mechanism
Types and roles
States machine
sCode optimization
Single Pass Assembler
Nested micro
Multiplier control unit
Control unit design
Direct linking loaders
Two pass Assembler
Keyword Presentation
Linking in MS-Dos System

Recently uploaded (20)

PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
AutoCAD Professional Crack 2025 With License Key
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Cost to Outsource Software Development in 2025
PPTX
L1 - Introduction to python Backend.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Oracle Fusion HCM Cloud Demo for Beginners
CHAPTER 2 - PM Management and IT Context
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
17 Powerful Integrations Your Next-Gen MLM Software Needs
Designing Intelligence for the Shop Floor.pdf
AutoCAD Professional Crack 2025 With License Key
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Why Generative AI is the Future of Content, Code & Creativity?
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Cost to Outsource Software Development in 2025
L1 - Introduction to python Backend.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Salesforce Agentforce AI Implementation.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Reimagine Home Health with the Power of Agentic AI​
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY

What is symbol table?

  • 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; }