混淆语法

Confusion in finding follow of Gammar

我在寻找语法的后续方面感到困惑

S->(L)|a
L->L,S|S

关注(L)={$ ,} 或关注(L)= {$}
哪一个是正确的,为什么?

两者都不正确。

FOLLOW(A) of non-terminal A is the set of terminal symbols 
that can follow in the derivation sequence

FOLLOW(L),检查它出现在作品右侧的位置。它在

             S->(L)  

推导这个产生式时,L后面是).

            L->L,S

同理,当推导这个产生式时,L后面是,.

           FOLLOW(L) = {),,}