2014compiler课件Ch4_3章节(526KB).pptVIP

  • 12
  • 0
  • 约8.3千字
  • 约 27页
  • 2018-04-01 发布于未知
  • 举报
Chapter 4 Top-Down Parsing Problems with LL(1) Parsing Computer Science Technology Harbin Engineering University Theorem A grammar in BNF is LL(1) if the following conditions are satisfied. 1. For every production A - α1 | α2 |…| αn, First(αi) ∩ First(αj) is empty for all i and j, 1 ≤ i, j ≤ n, i ≠ j. 2. For every nonterminal A such that First(A) contains ε, First(A)∩Follow(A) is empty. Compiler * Example 4.15 Compiler * First(exp) = { ( , number} First (addop) = {+, - } First(term) = { ( , number} First(mulop) = { * } First(factor) = { ( , number} Follow(exp) = { $ , +, -, ) }

文档评论(0)

1亿VIP精品文档

相关文档