Questions
- Does it make sense to add three address instructions for doing input and output? Why or why not?
- Explain the relationship between semantic rules, such as those shown in Figure 9.4, and tree traversal methods, such as
genAddExpr()
. - Why might some compiler writers be insistent about computing the semantic attributes for instruction labels during the same tree traversal that generates code? Is that possible in a general case?
- In this chapter, whenever a new local variable is required, the code generator just calls
genlabel()
to obtain one. In the absence of optimization, what effect might this have on the program?
Join our community on Discord
Join our community’s Discord space for discussions with the authors and other readers: