- 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:
您可能关注的文档
最近下载
- 基于NSA2860的参考方案设计.PDF VIP
- Roland罗兰乐器AX-Edge 肩背式合成器[Chinese] AX-Edge Owner's Manual用户手册.pdf
- 人力资源合规管理与风险管控 自查手册(361个风险点)-2025更新.pdf
- 日本工业标准JISL19022002.pdf VIP
- gb50974-2014消防给水及消火栓系统技术规范讲解..ppt VIP
- 《数字电子技术基础》课后习题及参考答案7810.pdf VIP
- 苏州市房地产经纪与信用管理平台‐备案经纪机构信息复核操.PDF
- 第十六届“高教杯”机械类试卷(机械手)、(台灯).pdf VIP
- 中医骨科护理疑难病例讨论.pptx VIP
- 浙江省宁波市慈溪市2024-2025学年六年级下学期期末数学试卷及答案解析.docx VIP
原创力文档

文档评论(0)