简体   繁体   English

这是LL(1)语法吗

[英]Is This LL(1) grammar

It's really important to me, so please help me. 对我来说真的很重要,所以请帮助我。
Is this grammar LL(1)? 这是LL(1)语法吗?

S -> LAB
L -> d | ε
A -> dA | Ba
B -> Bb | ε

can anyone help me with LL(1) parsing table? 有人可以帮我LL(1)解析表吗?
Am I right about this? 我对吗?

first(S) = {a,b,d}
first(L) = {d}
first(A) = {b,d}
first(B) = {b}

follow(S) = {$}
follow(L) = {a,b,d}
follow(A) = {b,$}
follow(B) = {$}

I used the JFLAP tool on your grammar. 我在语法上使用了JFLAP工具 JFLAP does not think your grammar is LL(1), but can try and build a parse table for it. JFLAP认为您的语法不是LL(1),但是可以尝试为其构建一个解析表。

You could experiment with the grammar in JFLAP to make it LL(1) conformant. 您可以尝试使用JFLAP中的语法使它符合LL(1)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM