freefika 0 Newbie Poster

Hello, im new here and i dint know where this message would go, so just posting it here! anyway i have an exam soon and i was solving this practice question and got stuck. In the question below, we have to find the first and follow functions of the grammar given. The first are easy, i have solved them below, but i have problems finding the follow set! I have tried to search the book "compilers tools and techniques" but havent found a clue to it.....plz help me...its urgent!!!

LL(1) GRAMMAR:

<Lexp> -> <Atom>|<List>

<Atom> -> num|id

<List> -> (<Lexp_seq>)

<Lexp_seq> -> <Lexp><L1>

<L1> -> ,<Lexp_seq>|epsilon


FIRST SETS: The characters/words in bold are the members of the set

FIRST(<Lexp>) = {num , id , ( }
FIRST(<Atom>) = {num , id}
FIRST(<List>) = {(}
FIRST(<Lexp_seq>) = {num , id, (}
FIRST(<L1>) = {, , epsilon}


Hoping for a quick response!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.