正在加载图片...
Top-Down Parsing The parse tree is created top to bottom. ·Top-down parser Recursive-Descent Parsing Backtracking is needed(If a choice of a production rule does not work,we backtrack to try other alternatives.) It is a general parsing technique,but not widely used. ·Not efficient Predictive Parsing ·no backtracking ·efficient needs a special form of grammars(LL(1)grammars). Recursive Predictive Parsing is a special form of Recursive Descent parsing without backtracking. Non-Recursive(Table Driven)Predictive Parser is also known as LL(1)parser. CS308 Compiler Theory 2Top-Down Parsing • The parse tree is created top to bottom. • Top-down parser – Recursive-Descent Parsing • Backtracking is needed (If a choice of a production rule does not work we backtrack to try other Backtracking is needed (If a choice of a production rule does not work, we backtrack to try other alternatives.) • It is a general parsing technique, but not widely used. • Not efficient Not efficient – Predictive Parsing • no backtracking • effi i t fficient • needs a special form of grammars (LL(1) grammars). • Recursive Predictive Parsing is a special form of Recursive Descent parsing without backtracking. • Non-Recursive (Table Driven) Predictive Parser is also known as LL(1) parser. CS308 Compiler Theory 2
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有