Skip to content
Cyclops

LL(1) grammar analysis, worked out in full

Cyclops computes FIRST sets, FOLLOW sets and the LL(1) parse table for any grammar you give it, names every conflict that stops a grammar being LL(1) — and will hand the table back empty so you can fill it in and have it checked cell by cell.

What Cyclops does

FIRST and FOLLOW, with provenance

Every member of every set is tagged with the rule that put it there, so a wrong answer points at the rule you misapplied rather than just being wrong.

A parse table you fill in

Type production numbers into the grid and have them checked cell by cell. Blank is a real answer — it means the parser reports an error there.

Conflicts explained, not just flagged

When a grammar is not LL(1), Cyclops names the competing productions and says whether the clash is FIRST/FIRST or FIRST/FOLLOW — and calls out left recursion by name.

Step-by-step parsing

Watch the stack, the remaining input, and the production applied at each step, all the way to accept or to the exact token that failed.

A grammar and its table

The grammar Cyclops ships with, and the table it produces. Cell [A, b] is the interesting one: A derives ε, and b is in FOLLOW(A), so production 3 goes there by the second table rule.

Productions

  1. 1S → A b B
  2. 2A → a A b
  3. 3A → ε
  4. 4B → b B
  5. 5B → ε

Parse table

Non-terminalab$
S11
A23
B45