编译原理与实践 第三章 答案.docVIP

  • 213
  • 0
  • 约4.94千字
  • 约 5页
  • 2016-12-03 发布于河南
  • 举报
编译原理与实践 第三章 答案

The exercises of Chapter Three 3.2 Given the grammar A→AA|(A)|ε a. Describe the language it generates; b. Show that it is ambiguous. [Solution]: a. Generates a string of balanced parenthesis, including the empty string. b. parse trees of (): 3.3 Given the grammar exp ( exp addop term | term addop ( + | - term ( term mulop factor| factor mulop ( * factor ( ( exp ) | number Write down leftmost derivations, parse trees, and abstract syntax trees for the following expression: a. 3+4*5-6 b. 3*(4-5+6) c. 3-(4+5*6) [Solution]: The leftmost derivations for the expression 3+4*5-6:

文档评论(0)

1亿VIP精品文档

相关文档