四川大学编译原理期末复习(金军版)

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

4. Show the grammar is ambiguous. Remove ambiguity in the rules (rewrite the grammar).
5. Write regular expression, convert to NFA (use Thompson’s Construction ), convert to DFA (use Subset Construction), minimizing the DFA.
2. Write regular expressions for descriptions of languages; Write descriptions of languages generated by regular expressions. 3. Write rightmost or leftmost derivation, draw parse tree and abstract syntax tree.
P168(First sets) P173(Follow sets) P155(LL(1) parsing) P207(LR(0) parsing) P210(SLR(1) parsing)
P220(LR(1) parsing)
Refer to examples, exercises.
Construห้องสมุดไป่ตู้t Show
7. Given the grammar, ……
Construct Construct Show
the DFA of LR(0) or LR(1) or LALR(1) items; LR(0) or SLR(1) or LR(1) or LALR(1) parsing table. the grammar LR(0)(or SLR(1)) or not? If not, describe the conflict.
Show Show
the grammar LR(1)(or LALR(1)) or not? If not, describe the conflict. the parsing steps of an LR(0) or SLR(1) parser
8. Algorithms
P63(DFA code)
6. Given the grammar, ……
Left
factor, remove the left recursion
First and Follow sets the LL(1) table the grammar is LL(1) or not the parsing actions
Construct Show
Review
1. Concepts (1)The phases of a compiler. (2)Analysis part, synthesis part (3)Front end, back end (4)passes (one pass, more passes) (5)The task of a scanner, parser (6)interpreter, compiler
(7)regular expressions, regular set (8)Context-free grammar (9)parsing tree , abstract syntax tree (10)bottom-up and top-down parsing (11)Why Left factor, remove left recursion
相关文档
最新文档