This project is part of the Embarked Systems Course from the department of Mechatronics of the University of São Paulo (USP). It is a G code parser built with ANTLR in Python. The main goals of the project were to learn to build a language parser and test it.
- ANTLR — is a powerful parser generator for reading, processing, executing, or translating structured text or binary files
- unittest — unit testing framework
- Java 1.7 or higher;
- ANTLR installed and set up.
To install and setup (and get a better understanding of ANTLR if you want) ANTLR refer to this guide, which is a complete guide on ANTLR.
- To parse the "testeG.txt" file into "output.txt" file:
python main.py testeG.txt- To test the parser:
python -m unittest testcode2Parser.pyYou can check my report (in Portuguese) for more details on the project.