Skip to content

Instantly share code, notes, and snippets.

@rpplusplus
Created January 19, 2015 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpplusplus/162511c2264808b5ac70 to your computer and use it in GitHub Desktop.
Save rpplusplus/162511c2264808b5ac70 to your computer and use it in GitHub Desktop.
EX5-2
S-> a|^|(T)
T-> ST'
T'->,ST'|ε
First(S) = {a, ^, (}
First(T) = {a, ^, (}
First(T') = {, , ε}
Follow(S) = {, , $}
Follow(T) = {) , , , $}
Follow(T') = {, , $}
M[S, a]=S-> a|^|(T)
M[S, ^]=S-> a|^|(T)
M[S, (] = S-> a|^|(T)
M[T, a] = T-> ST'
M[T, ^] = T-> ST'
M[T, (] = T-> ST'
M[T', ,] = T'->,ST'
M[T', ,] = T'->ε
M[T', $] = T'->ε
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment