Enter a grammar below and click "Analyze", and the First/Follow/Predict sets for the grammar will be shown on the right. The syntax for grammars is:

  1. One rule per line (where a rule looks like exp -> exp OPA term), terminals, non-terminals and -> all have to be space separated from one another.
  2. An empty right-hand side is indicated with epsilon, which means that the one reserved word is epsilon. You can't use that as a terminal or non-terminal.

Input Grammar       Output