Import Grammar
In this tutorial we will go over how to import a grammar.
- The following grammar is the one we will be importing in this demo. Copy and paste the grammar into a file named
example.txt
. The syntax of the grammar file was designed to feel familiar to users, as it is very similar to how a grammar would be written on paper.
E -> T EP
EP -> "+" T EP | "-" T EP | ε
T -> F TP
TP -> "*" F TP | "/" F TP | ε
F -> "(" E ")" | "id"
- Click the Import Button in the top right of the Main Navigation Bar.
- Select the
example.txt
file.
- That's it! In the grammar input side panel you should notice that the production inputs have updated to include the rules in the file. Each line in the grammar file will get its own production input.
note
Remember: The result panel will not update until you hit the save button in the grammar input side panel.