A parser for Tiny language
- Make instance of it as following where
tiny_codeis the input code
s = TinyScanner(tiny_code) - You can scan the code using
scanfunction which returns a string of (tokenvalue, tokentype)
output_str = s.scan() - You can save the output to a file using
createOutputFilefunction
s.createOutputFile('out.txt')
- You need to have python 3 up and running
- You need to install the libraries in the requirements.txt file. You can install them via
pipusing the following command
pip install -r requirements.txt - You need to install Graphviz
- For ubuntu, write this command in terminal
sudo apt-get install graphviz - For windows, download from this link
http://www.graphviz.org/Download_windows.php and then add the following folder to the path in your environment variables
C:\Program Files (x86)\Graphviz2.38\bin\