Skip to content

adaminsky/ll1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculate First and Follow sets for a CFG

Running the following in a repl will give the first set of non-terminal symbol "D" in the following grammar. Calling the followSet function instead will return the follow set of "D".

firstSet (Grammar [
            Rule { lhs = (N"A"), rhs = [[N"B", N"C"], [N"B", N"C", N"D", T"w"]] },
            Rule { lhs = (N"B"), rhs = [[T"y"], [Epsilon]] },
            Rule { lhs = (N"C"), rhs = [[T"x"], [Epsilon]] },
            Rule { lhs = (N"D"), rhs = [[T"z"]] }
          ]
         ) (N "D")

About

First and Follow calculator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published