Skip to main content

Timeline for Symbol table usage

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
Jan 14, 2018 at 13:36 comment added Zephyr @fade2black No problem. Get well soon.
Jan 14, 2018 at 13:22 comment added fade2black @Zephyr I am sorry I cannot write now. I underwent a surgery oper. Will response later.
Jan 12, 2018 at 8:17 comment added Zephyr @fade2black we store the type of variables like int a during syntax directed translation right ? SDT happens in which phase, syntax analysis or semantic analysis?
Nov 29, 2017 at 15:43 comment added fade2black It depends on how you implement ICG. If you implement three-address statements using quadruples you will have to store temp variables in the ST. But you can avoid storing temporary names if you use triples. For more details see Dragon book Chapter 8 (ICG).
Nov 29, 2017 at 15:27 vote accept Sagar P
Nov 29, 2017 at 15:27 comment added Sagar P Ok got it. Will intermediate code generation phase add temporary variables into symbol table ? In ICG, symbol table is both used and updated right ?
Nov 29, 2017 at 15:21 comment added fade2black Please read the last paragraph of my post concerning your question "What more information is added by later phases like syntax, semantic and code generation?"
Nov 29, 2017 at 15:16 comment added fade2black But semantic analysis mainly concerns about type checking. I cannot think about a scenario where semantic analyzer would change information about identifiers, except it is used with interpreters for a dynamic typed language where you would change the type of the variable on type conversion.
Nov 29, 2017 at 15:15 comment added fade2black As I said "as necessary". There is no strict rule as "when and how" to use the symbol table. In fact, you could design a "useless" compiler which would not use the symbol table at all. So there is no a single and definite answer to your question. That said, during syntax analysis a compiler (for static typed languages such as C/C++) hove to store information about type of identifiers, for exampleint my_var;.
Nov 29, 2017 at 15:03 comment added Sagar P In dragon book there is a sentence, "Later phases of compilation may add more information to the entry present in symbol table" . I didn't quite understand this. What more information is added by later phases like sytax,semantic and code generation?
Nov 29, 2017 at 14:53 comment added Sagar P Is symbol table updated during syntax analysis and semantic analysis ?
Nov 29, 2017 at 14:12 history edited fade2black CC BY-SA 3.0
added 86 characters in body
Nov 29, 2017 at 14:02 history answered fade2black CC BY-SA 3.0