Get me outta here!

Saturday, April 16, 2022

First and follow Rules (Compiler)

First Set

1st Rule: if terminal, then insert terminal on set

2nd Rule: if ∈, then insert ∈ on set

3rd Rule: if non-terminal, then check the productions and insert the production elements.

-----------------------------------------------------------------------

Follow Set

1st Rule: For start variable, input $

2nd Rule: if A → αBβ, then follow(B) = first(β)

3rd Rule: if A → αB, then follow(B)= follow(A)



0 comments:

Post a Comment