Symbol Table Management by Compiler An essential function of a compiler is to record the identifiers used in the source program and collect information various attributes of each identifier. These attribute may provide information about the storage allocated for an identifier, its type, and its scope. In the case of procedure names, it also provide information such as the number and types of arguments, the method of passing each argument, and the type returned, if any. A symbol table is a data structure containing a record for each identifier, with fields for the attributes of the identifier. This data structure allows us to find the record for each identifier quickly and to store or to retrieve data quickly. The symbol table is created by entering identifier entry during Lexical Analysis phase. The remaining phases update or use identifier information from the Symbol Table. When an identifier in the source program is detected by the lexical analyzer, the identifier is entered into the symbol table. However, the attributes of an identifier cannot normally be determined during lexical analysis. i.e.: in PASCAL declaration like, Var position, initial, rate : real; The type real is not known when position, initial, and rate are seen by the lexical analyzer.
Symbol Table Management by Compiler An essential function of a compiler is to record the identifiers used in the source program and collect information various attributes of each identifier. These attribute may provide information about the storage allocated for an identifier, its type, and its scope. In the case of procedure names, it also provide information such as the number and types of arguments, the method of passing each argument, and the type returned, if any. A symbol table is a data structure containing a record for each identifier, with fields for the attributes of the identifier. This data structure allows us to find the record for each identifier quickly and to store or to retrieve data quickly. The symbol table is created by entering identifier entry during Lexical Analysis phase. The remaining phases update or use identifier information from the Symbol Table. When an identifier in the source program is detected by the lexical analyzer, the identifier is entered into the symbol table. However, the attributes of an identifier cannot normally be determined during lexical analysis. i.e.: in PASCAL declaration like, Var position, initial, rate : real; The type real is not known when position, initial, and rate are seen by the lexical analyzer.
SS%20Unit-1%2026-2-2015%2005-30%20PM.docx