This project is a web-based tool for calculating the First and Follow sets of a context-free grammar (CFG). It takes user input in the form of a CFG and computes these sets, showing the results with a typewriter animation.
- Grammar Input: Input context-free grammar in a textarea with production rules.
- Symbols: Use buttons or shortcut keys to input symbols like β, |, and Ξ».
- Syntax Checking: Basic validation to check if the grammar syntax is correct.
- First & Follow Calculation: Computes the First and Follow sets using predefined rules.
- Typewriter Animation: Displays results in a typewriter style for a better user experience.
- Enter the grammar in the text area in the format:
S β ACB | Cbb | Ba
A β da | BC
B β g | Ξ»
C β h | Ξ»
- Use shortcuts to insert special symbols:
- 1 : β
- 2 : |
- 3 : Ξ»
- Press the Check Grammar button to calculate the First and Follow sets.
- Clone the repository:
git clone https://github.com/RezaTaheri01/first-follow-compiler.git
- Open index.html in your browser.
This project is licensed under the MIT License.