Which of the following is a data structure that is used to hold information about source code during compilation process?
Which of the following is a data structure that is used to hold information about source code during compilation process? Correct Answer Symbol table
The symbol table is a data structure that is used to hold information about source code during the compilation process.
Concept:-
Symbol Table:- In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier, constant, procedures, and function in a program's source code are associated with information relating to its declaration.
Key Points
- The symbol table is used to store the information about the occurrence of various entities such as objects, classes, variable name, interface, function name, etc.
- The assembler creates the symbol table section for the object file. It makes an entry in the symbol table for each symbol that is defined or referenced in the input file and is needed during linking.
Additional InformationIntermediate code:- It is used to translate the source code into the machine code. Intermediate code lies between the high-level language and machine language.
Context-free grammar:- A context-free grammar (CFG) is a formal grammar that is used to generate all the possible patterns of strings in a given formal language.
Lexical analyzer:- The purpose of lex is to generate lexical analyzers. The lexical analyzer breaks these syntaxes into a series of tokens, by removing any whitespace or comments in the source code.