El proyecto para el curso Compiladores consiste en escribir un compilador para un lenguaje llamado Decaf. Decaf es un lenguaje similar a C o Pascal.
- Python 3
python Compiler.py <file_name> -flag
Ejemplo:
python Compiler.py ejemplo -target hola
python Compiler.py simple -target parse -debug parse:scan -o out
python Compiler.py semantic -target semantic -debug ast:semantic
python Compiler.py eje -target semantic -debug semantic
python Compiler.py irt2 -target irt
python Compiler.py final -target codegen -debug irt
💡 IMPORTANTE
- El archivo debe de estar en la carpeta decafs y debe de tener la extensión .decaf
-o <outname> Escribir el output a <outname>
-target <stage> <stage> es uno de los siguientes elementos: scan, parse, ast, semantic, irt, codegen
-opt <opt_stage> <opt_stage> es uno de: constant, algebrai
-debug <stage> Debugging <stage>
- Scanner
- Parser
- Semantic Check
- IRT
- Code Gen
- Python && ASM