The Gateway to Computer Science Excellence
0 votes
103 views

The two basic operations that are often performed with the symbol table are:

1.

Set and reset

 

2.

Set and insert

 

3. 

Insert and lookup

 

4.

Reset and lookup

in Compiler Design by Loyal (5.7k points)
edited by | 103 views
0
insert and lookup

2 Answers

+1 vote
Best answer

Symbol table is an important data structure created and maintained by compilers in order to store information about the occurrence of various entities such as variable names, function names, objects, classes, interfaces, etc. Symbol table is used by both the analysis and the synthesis parts of a compiler.

A symbol table may serve the following purposes depending upon the language in hand:

  • To store the names of all entities in a structured form at one place.

  • To verify if a variable has been declared.

  • To implement type checking, by verifying assignments and expressions in the source code are semantically correct.

  • To determine the scope of a name (scope resolution).

So the basic operations that are performed are insert and look up i.e option 3

by Loyal (5.6k points)
selected by
0
Anjali why set and reset can not be done
0

Symbol tables (also called identifier tables and name tables) assist two important functions in the translation process: in checking for semantic (i.e., context-sensitive) correctness and aiding in the proper generation of code. Both of these functions are achieved by inserting into, and retrieving from the symbol table, attributes of the variables used in the source program.So the basic operstions are insert and look up .Regarding set and reset.. these are not performed by the symbol table.. as far as I know

0 votes

Answer : Insert and lookup

1.Insert(lexeme,token) : save lexeme and token and return pointer.

2.Lookup(lexeme) : return index of entry for lexeme or 0 if lexeme is not found.

 

by (425 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,644 questions
56,505 answers
195,555 comments
101,057 users