清华大学:《编译原理》课程教学资源_(英文译文)Chapter 4.1 Top-Down Parsing by Recursive-Descent

COMPILER CONSTRUCTION Principles and practice Kenneth C. louden
COMPILER CONSTRUCTION Principles and Practice Kenneth C. Louden

4. Top-Dowm Parsing PART ONE
4. Top-Dowm Parsing PART ONE

The outline of this chapter
The outline of this chapter

Concept of Top-Down Parsing (1) It parses an input string of tokens by tracing out the steps in a leftmost derivation And the implied traversal of the parse tree is a preorder traversal and thus occurs from the root to the leaves The example number number. and corresponds to the parse tree number
Concept of Top-Down Parsing(1) • It parses an input string of tokens by tracing out the steps in a leftmost derivation. – And the implied traversal of the parse tree is a preorder traversal and, thus, occurs from the root to the leaves. • The example: – number + number, and corresponds to the parse tree exp exp op exp number + number

Concept of Top-Down Parsing(2) The example: number number, and corresponds to the parse tree The above parse tree is corresponds to the leftmost derivations d) exp=>exp op exp (2) number op exp (3) number exp (4) number+ number number
Concept of Top-Down Parsing(2) The example: number + number, and corresponds to the parse tree • The above parse tree is corresponds to the leftmost derivations: (1) exp => exp op exp (2) => number op exp (3) => number + exp (4) => number + number exp exp op exp number + number

Two forms of Top-Down Parsers Predictive parsers attempts to predict the next construction in the input string using one or more look-ahead tokens Backtracking parsers try different possibilities for a parse of the input backing up an arbitrary amount in the input if one possibility fails It is more powerful but much slower, unsuitable for practical compilers
Two forms of Top-Down Parsers • Predictive parsers: – attempts to predict the next construction in the input string using one or more look-ahead tokens • Backtracking parsers: – try different possibilities for a parse of the input, backing up an arbitrary amount in the input if one possibility fails. – It is more powerful but much slower, unsuitable for practical compilers

Two kinds of Top - Down parsing algorithms Recursive-descent parsing is quite versatile and suitable for a handwritten parser LLO parsing The first L refers to the fact that it processes the input from left to right The second"L refers to the fact that it traces out a leftmost derivation for the input string The number 1 means that it uses only one symbol of input to predict the direction of the parse
Two kinds of Top-Down parsing algorithms • Recursive-descent parsing: – is quite versatile and suitable for a handwritten parser. • LL(1) parsing: – The first “L” refers to the fact that it processes the input from left to right; – The second “L” refers to the fact that it traces out a leftmost derivation for the input string; – The number “1” means that it uses only one symbol of input to predict the direction of the parse

Other contents Look-Ahead sets First and Follow sets: are required by both recursive descent parsing and ll(1) parsing A TNY Parser It is constructed by recursive-descent parsing algorithm Error recovery methods ne error recovery methods used in iop-Down parsing e describe d
Other Contents • Look-Ahead Sets – First and Follow sets: are required by both recursivedescent parsing and LL(1) parsing. • A TINY Parser – It is constructed by recursive-descent parsing algorithm. • Error recovery methods – The error recovery methods used in Top-Down parsing will be described

Contents PART ONE 4. 1 Top-Down Parsing by recursive-Descent More 4.2Ll(I) Parsing More PART TWO 4.3 First and follow sets 4.4A Recursive-Descent Parser for the tiny anguage 4. 5 Error recovery in Top-Down Parsers
Contents PART ONE 4.1 Top-Down Parsing by Recursive-Descent [More] 4.2 LL(1) Parsing [More] PART TWO 4.3 First and Follow Sets 4.4 A Recursive-Descent Parser for the TINY Language 4.5 Error Recovery in Top-Down Parsers

4. 1 Top-Down Parsing by Recursive-Descent
4.1 Top-Down Parsing by Recursive-Descent
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 5.3 SLR(1)Parsing.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 5.1 Overview of Bottom-UpParsing.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8.6 Code Generation in Commercial Compilers:Two Case Studies.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8.1 Intermediate Code and Data.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8 Code Generation.ppt
- 《NFS报文分析》讲义.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)What makes a good manager.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)Ten attributes of a good employee.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:9 Project Procurement Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:8 Project Risk Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:7 Project Communication Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:6 Project HR Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:5 Project Cost Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:4 Project Time Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:3 Project Scope Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:2 Project The Project Management Context and Processes.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:1 Introduction to Project Management.ppt
- 深圳职业技术学院:《C语言程序设计》第九单元:共用体,枚举(乌云高娃).pdf
- 深圳职业技术学院:《C语言程序设计》第八单元:结构体(乌云高娃).pdf
- 深圳职业技术学院:《C语言程序设计》第八单元(3):指针与结构体(乌云高娃).pdf
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 4.1 Top-Down Parsing byRecursive-Descent.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 1.1 Why? A Brief History.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 7.1 Memory Organization During Program Execution.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 7.4 Dynamic Memory.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 6.1 Attributes and AttributeGrammars.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 6.3 The Symbol Table.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 3.1 The Parsing Process.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 2.1 The Scanning Process.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 2.4 From Regular Expression To DFAs.ppt
- 《多媒体技术》课程教学资源(PPT课件讲稿).ppt
- 《JAVA基础实例200题》Java例题(一).pdf
- 《JAVA基础实例200题》Java例题(二).pdf
- 《JAVA基础实例200题》Java例题(三).pdf
- 《JAVA基础实例200题》Java例题(四).pdf
- 《JAVA基础实例200题》Java例题(五).pdf
- 《JAVA基础实例200题》练习题.pdf
- 长江大学:《微型计算机技术及应用课件》第一章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第七章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第三章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第九章习题答案(李华贵).doc