Recursive descent parser: how to find the FIRST, FOLLOW, and PREDICT sets?

爱⌒轻易说出口 提交于 2019-12-04 12:50:30

Try Programming Language Pragmatics, by Michael L. Scott (Morgan Kaufmann). Parsing is covered in chapter 2. Recursive-descent parsing is described in section 2.2.3; first and follow sets in 2.2.5.

You can automatically calculate first, follow, and predict sets using Calculate Predict, First, and Follow Sets from BNF (Backus Naur Form) Grammar Specification without having to download anything. It's a good way to verify answers or automate the tedium.

If you want to do it manually, the Dragon Book (2nd ed) covers it on pages 221-222.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!