不是LL(1)的LL(2)语言 [英] LL(2) language that is not LL(1)

查看:114
本文介绍了不是LL(1)的LL(2)语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了进一步理解语法分析器和语法,我正在寻找语言的(非常简单的)示例,该示例是LL(2),但不是LL(1).也就是说,一种语言可以由LL(2)语法生成,而不能由任何LL(1)语法生成.

In order to further my understanding of parsers and grammars, I'm searching for a (hopefully simple) example of a language that is LL(2) but not LL(1). That is, a language that can be generated by an LL(2) grammar but not by any LL(1) grammar.

该课程中是否有有用的语言?即我们可以想象一种计算机语言是LL(2)但不是LL(1)吗?

Are there useful languages in that class ? I.e could we imagine a computer language that is LL(2) but not LL(1) ?

推荐答案

解析技术,作者是Grune and雅各布斯举了一个例子.可以在

Parsing Techniques by Grune and Jacobs presents an example. An older version of this book is available online at

http://dickgrune.com/Books/PTAPG_1st_Edition/BookBody.pdf

示例见第181页.

这篇关于不是LL(1)的LL(2)语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆