1,535 views
3 votes
3 votes
Which of the following phases update the symbol table ?

Lexical analysis, syntax analysis and semantic analysis .

Please also tell what kind of updates a phase performs if it updates symbol table.

1 Answer

0 votes
0 votes

In Lexical analysis  symbol table created to store keywords inside it to get all information about their values and their properties.

Syntax analysis or parsing is the second phase of a compiler.

lexical analyzer cannot check the syntax of a given sentence due to the limitations of the regular expressions. Regular expressions cannot check balancing tokens, such as parenthesis. Therefore, this phase uses context-free grammar (CFG), which is recognized by push-down automata.

CFG, on the other hand, is a superset of Regular Grammar,

In Semantic analysis ,fill in information about the symbol later during semantic analysis when more information about the variable is known.

as Code generation uses the symbol table to output assembler directives of the appropriate size and type.

for more information read this:-

                                                                        https://web.cs.wpi.edu/~kal/courses/cs4533/module5/myst.html

edited by

Related questions

3 votes
3 votes
1 answer
1
Hira Thakur asked Aug 14, 2017
2,109 views
which DS takes less time to create Symbol table???a) Hash TableB) Linked Listis there is any other method to create Symbol table??what are the various option available t...
0 votes
0 votes
3 answers
2
dd asked Dec 13, 2016
3,675 views
A symbol is a compile time data structure. In which of the following phase/s a symbol is modified ?Only semantic analysisNone of theseOnly lexical analysisLexical analysi...
0 votes
0 votes
1 answer
3
dd asked Dec 13, 2016
2,547 views
Which of the following symbol table implementation is based on the property of locality of reference?Search TreeHash TreeSelf-organizing ListArray
2 votes
2 votes
1 answer
4
Akriti sood asked Dec 8, 2016
12,053 views
Which of the following symbol table implementation is based on the property of locality of reference? Self-organizing list Hash tree Search tree Array