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

  • 5
  • 0
  • 约5.57千字
  • 约 7页
  • 2024-01-10 发布于黑龙江
  • 举报

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

TheexercisesofChapterThree

3.2GiventhegrammarA→AA|(A)|ε

a.Describethelanguageitgenerates;

b.Showthatitisambiguous.

[Solution]:

a.Generatesastringofbalancedparenthesis,includingthe

emptystring.

b.parsetreesof():

3.3Giventhegrammar

exp→expaddopterm|term

addop→+|-

term→termmulopfactor|factor

mulop→*

factor→(exp)|number

Writedownleftmostderivations,parsetrees,andabstract

syntaxtreesfor

文档评论(0)

1亿VIP精品文档

相关文档