edited by
1,762 views
1 votes
1 votes

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

edited by

2 Answers

Best answer
1 votes
1 votes

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 votes
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

788
views
1 answers
1 votes
Prince Sindhiya asked Dec 27, 2018
788 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 ... a large team of programmers.4.To minimize memory requirements on modern machines.
1.8k
views
4 answers
2 votes
rahul sharma 5 asked Jan 24, 2018
1,832 views
Match the following with respect to activation record fields:A 1 → A, D; 2 → B, CB 1 → A, C; 2 → B, DC 1 → B, C; 2 → A, DD 1 → B, D; 2 → A, CDoubt:- Control link points to caller activation record.Can some one confirm?
3.2k
views
4 answers
2 votes
rahul sharma 5 asked Jan 24, 2018
3,163 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 : ... ?a S1 and S2b S2 and S3c S3 and S1d S1, S2 and S3
950
views
1 answers
1 votes
Na462 asked Oct 8, 2018
950 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 phaseC. ... evaluationD. Both A and CPlease Explain the C part only rest are easy :)