A browser-based tool that computes FIRST and FOLLOW sets for a context-free grammar, shows the derivation step by step, and can optionally build the LL(1) parsing table.
No build step, no server needed. Just open index.html in a browser.
first-follow-project/
├── index.html # page structure
├── css/
│ └── style.css # all styling
├── js/
│ └── app.js # grammar parsing + FIRST/FOLLOW/LL(1) logic
└── README.md
One production per line:
A -> alpha1 | alpha2
- Arrows:
->,→, or::= - Symbols separated by spaces
- Epsilon:
ε,eps,epsilon, orλ - Any symbol starting with a capital letter is treated as a non-terminal; everything else is a terminal.
- FIRST sets — via fixed-point iteration over all productions until no set changes.
- FOLLOW sets — same fixed-point approach, seeded with
$on the start symbol. - LL(1) parsing table (optional, toggle in the results panel) — flags conflicting cells if the grammar isn't LL(1).
Every rule application is logged to the trace panel so you can follow (or double-check) the reasoning by hand.