简体   繁体   中英

How to find the follow of the following grammar

Grammar

S->(A)
A->CB
B->;A|ε
C->x|S

I have find the First of the grammar:

First(S)={(}
First(B)={;,ε}
First(C)={x,(}
First(A)=First(C)={x,(}

I have trouble finding the Follow of the grammar.

The Follow sets are

Follow(S)={$,),;} Follow(B)={)}

Follow(C)={:,)}

Follow(A)={)}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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