A simple grammar analyzer written in Python.
Usage:
./analyze.py <path to grammar json> <input string>
Examples:
./analyze.py grammars/grammar1.json "a#b"
./analyze.py grammars/grammar1.json ""
-
All rules in the grammar must have a terminal as the first symbol on the right hand side of the rule.
-
No variable in the grammar can have two rules with the same terminal as the first symbol on the right hand side.