The Pytator Compiler is a Mini Python compiler designed to transform mini python's code to ASM. For now it only generates the AST of the code. (PCL1)
- DECIMA Ewan
- LICHTNER Marc
- SALQUEBERE Valentin
- VANRULLEN Lancelot
- Fast and efficient
- Cross-platform: Runs on any machine running java
- Error Reporting: Detailed syntax and lexical error messages
To run the jar file, you need to have Java installed on your machine. You can download it from the official website.
To run the web interface (that runs the jar), you juste need Docker/Docker compose installed on your machine. You can download it from the official website.
To compile a Mini Python source file:
$ java -jar pytator.jar -ast -f dot -i source.py- -ast,--abstract-syntax-tree Generate the AST
- -cst,--syntax-tree Generate the syntax tree
- -f,--format Output format (e.g., dot)
- -i,--input-file Input file path
- -o,--output-file Output file
- -x,--exclusive Only display the resulting tree
Anyone can run the AST builder on their machine using Docker. To do so, you can use one of the following :
cd utils/web_interface && docker compose up --builddocker run -p 5000:5000 lentslow/pcl-interfaceThen access localhost:5000 in your browser.
Here are some sample programs you can compile using Pytator :
- Hello World:
java -jar pytator.jar -ast -f dot -i examples/hello_world.pyprint("Hello, World!")For more examples, refer to the examples/ directory.
To run tests, make sure you have JUnit in the classpath :
In IntelliJ, right click on tests > Run 'All Tests'.
If you encounter any issues or have feature requests, please open an issue on the Gitlab repository.
- IntelliJ IDEA, Flask, Docker used in this project
