Grammar Flow Analysis
Grammar Flow Analysis
– Wilhelm/Maurer: Compiler Design, Chapter 8 – Reinhard Wilhelm Universität des Saarlandes wilhelm@cs.uni-sb.de
- 2. November 2009
Grammar Flow Analysis Wilhelm/Maurer: Compiler Design, Chapter 8 - - PowerPoint PPT Presentation
Grammar Flow Analysis Grammar Flow Analysis Wilhelm/Maurer: Compiler Design, Chapter 8 Reinhard Wilhelm Universitt des Saarlandes wilhelm@cs.uni-sb.de 2. November 2009 Grammar Flow Analysis Notation Generic names for A , B , C ,
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
◮ is partially ordered by some relation ⊑, ◮ has a uniquely defined smallest element, ⊥, ◮ has a least upper bound, d1 ⊔ d2, for each two elements d1, d2 ◮ and has only finitely ascending chains,
Grammar Flow Analysis
Grammar Flow Analysis
i=1 Pr(p[i]) | p[0] = X} for all X ∈ VN
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
◮ The production F → id is applied when the current symbol is
◮ The production F → (E) is applied when the current symbol is
◮ The production T → F is applied when the current symbol is
Grammar Flow Analysis
◮ The production E ′ → ǫ is applied for symbols # and ) ◮ The production T ′ → ǫ is applied for symbols #, ) and +
Grammar Flow Analysis
Grammar Flow Analysis
T
X ∈ FIRSTk(X) ∈ FOLLOWk(X)
T # where
Grammar Flow Analysis
T , ⊆, ∅, ∪)
Grammar Flow Analysis
Grammar Flow Analysis
Grammar Flow Analysis
T#, ⊆, ∅, ∪)
Grammar Flow Analysis