search
Log In
0 votes
238 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
edited by
238 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


selected by
0
Anjali why set and reset can not be done
1

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

Operations of Symbol table – The basic operations defined on a symbol table include:

 

C is the Right Answer

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.

 

Related questions

1 vote
1 answer
1
153 views
Many compilers are divided into two largely independent parsers: a front- end, responsible for analyzing the source code, and a back -end, responsible for generating the target code. What is the most important motivation for this division into passes? 1It aids in ... division of labor when a compiler is build by a large team of programmers. 4.To minimize memory requirements on modern machines.
asked Dec 27, 2018 in Compiler Design Prince Sindhiya 153 views
1 vote
3 answers
2
534 views
Match the following with respect to activation record fields: A 1 → A, D; 2 → B, C B 1 → A, C; 2 → B, D C 1 → B, C; 2 → A, D D 1 → B, D; 2 → A, C Doubt:- Control link points to caller activation record.Can some one confirm?
asked Jan 25, 2018 in Compiler Design rahul sharma 5 534 views
2 votes
4 answers
3
395 views
Consider the following statements: S1 : Static allocation can not support recursive function. S2 : Stack allocation can support pointers but can not deallocate storage at run-time. S3 : Heap allocation can support pointers and it can allocate or deallocate storage at run-time. Which of the above statements are true? a S1 and S2 b S2 and S3 c S3 and S1 d S1, S2 and S3
asked Jan 24, 2018 in Compiler Design rahul sharma 5 395 views
1 vote
1 answer
4
259 views
Which of the Following is True ? A. Symbol table Construction is during the analysis part of the Compiler. B. Type checking is Done during Syntax Analysis phase C. SDD with only synthesized attribute have an order of evaluation D. Both A and C Please Explain the C part only rest are easy :)
asked Oct 8, 2018 in Compiler Design Na462 259 views
...