8
Q
什么是最左派生?
A
回答
10
语法规则被显示在左边与非终结符和终结符。非终结符号应该是大写字母,其他所有符号通常都是终端符号。在例子中,N和D是非终结符,0-9是终结符。最左派生总是让最左边的非终结符通过语法规则。试着格式化下面的例子。
N
=> N D --Replaces the first/left most/only (which is "N") with the N => N D rule
=> N D D --Replaces the first/left most nonterminal (which is "N") with the N => N D rule
=> D D D --Replaces the first nonterminal (which is "N") with the N => D rule
=> 1 D D --Replaces the first nonterminal ("D") with the D => 1 rule(our first terminal character!)
=> 1 2 D --Replaces the first nonterminal ("D") with the D => 2 rule
=> 1 2 3 --Replaces the first nonterminal ("D") with the D => 3 rule
-- Only terminal characters remain, derivation/reduction is complete.
相关问题
- 1. Eclipse中的派生文件是什么?
- 2. 什么?在Kotlin中是否指派任务的左侧?
- 3. 为什么委托类型是从MulticastDelegate类派生的,为什么不直接从委托类派生?
- 4. 将派生字段添加到Doctrine_Record子类的最佳方式是什么?
- 5. 为什么MovieClip派生类不会gotoAndStop?
- 6. 什么是最小叶生成树?
- 7. 派生类作为模板参数的用途是什么?
- 8. 为什么ObjectContext类不是从某个接口派生的?
- 9. 在python中派生类方法的正确方法是什么?
- 10. 为什么HttpContext不是从HttpContextBase派生的?
- 11. 在解析理论中,“派生”的反义词是什么?
- 12. 为什么UserRolesPartRecord不是从Orchard CMS的ContentPartRecord派生的?
- 13. 为什么有些MFC类不是从CObject派生的?
- 14. 什么是类图中的“派生属性”?
- 15. 为什么我的派生类是一个抽象类? C++
- 16. 为什么GetType()在显式地将派生类派生到基类后返回派生类?
- 17. 派生类析构函数发生了什么?
- 18. 什么是外生
- 19. 虚拟继承(钻石) - 做我为什么需要从最派生类
- 20. 什么是左移的jQuery代码
- 21. 什么是PostgreSQL中的左连接
- 22. 为什么数组不是左值?
- 23. 为什么左移是PHP和JavaScript
- 24. 多个LEFT连接 - 什么是“左”表?
- 25. 什么是右值和左值在C
- 26. gcc困惑什么是左值?
- 27. 什么是函数的左值引用?
- 28. 派生流的最佳组合
- 29. 歧义语法和最右派生
- 30. 那么“this”的类型是什么?为什么“这个”不是左翼?
我觉得最左边的派生意味着你总是将规则#应用到你可以应用它的最左边的地方。所以我可以说'规则N - > N D',你知道你可以在最左边的位置应用它。如果是RR分析器,它会将它应用于最右边的位置。 – Patashu 2013-03-04 03:34:40