Arithmetic Expression Compiler Using Python And LLVM
Аннотация
This paper presents the implementation of a compiler that translates arithmetic expressions into native machine code using the LLVM compiler infrastructure's Python API. This work demonstrates a complete compilation pipeline. It converts high-level arithmetic expressions into native assembly code using llvmlite, which is the Python binding for LLVM. The compiler performs several tasks. It handles lexical analysis, parsing with operator precedence, constructing the abstract syntax tree, and generating LLVM IR. By connecting native execution and interpreted Python code, the system allows for compilation without the delays of interpretation. This work sets the stage for future experiments in Python-to-native compilation. It also helps us understand how to access modern compiler infrastructures programmatically.
Ҳали таржима қилинмаган