Answered step by step
Verified Expert Solution
Question
1 Approved Answer
BCSE 3 0 7 P - COMPILER DESIGN LAB Date: 2 3 . 0 1 . 2 0 2 4 Aim : To write a
BCSEP COMPILER DESIGN LAB
Date:
Aim : To write a CProgram to create symbol table
Detailed Description of Exercise
A Symbol table is a data structure used by the compiler, where each identifier in program's soure code is stored along with information associated with it relating to its declaration. It stores identifier as well as it's associated attributes like scope, type, linenumber of occurrence, etc. Write a program to construct symbol table for an input program.
Test case
Sample Input:
Enter Program $ for termination:
void main
i
int ;
printfa a;
Sample Output:
tableNameType,Size,Addressaint,
Test case
Sample Input:
Enter Program $ for termination:
void main
int numnumsum;
scanfdd&num&num
sumnumnum;
printf dsum;
is
Sample Output:
tableNameType,Size,Address
tablenumint,numint,sumint,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started