Cheat sheets

CD-15Cheat sheet1 pageIn a paid pack

Intermediate Representations

The intermediate forms GATE asks about, side by side on the same expressions: syntax trees and DAGs with node counts, postfix notation, three-address code instruction kinds, quadruples, triples and indirect triples with their trade-offs, and static single assignment form with φ-functions. Script-produced TAC with and without common-subexpression reuse, temporary counts, and the value-numbering method that builds a DAG.

Diagrams from CD-15

CD-16Cheat sheet1 pageIn a paid pack

Control Flow and Backpatching

Syntax-directed generation of three-address code for expressions and assignments, array addressing with the row-major offset formula and its variants, code layouts for if, if-else and while, short-circuit (jumping) code for Boolean expressions, and backpatching with truelist, falselist and nextlist on a fully traced example that the script generated instruction by instruction. Includes a solved past question on one-pass translation.