Project
Chris's Simple Compiler
The Simple Compiler project focuses on developing a code translator that converts a custom language into Python code. The project involves tokenizing the input text and generating Python code based on the provided tokens.
The compiler uses regular expressions to match and identify different components of the custom language, such as operators, variables, and special statements like “prints” and “printSort.” The tokenization process ensures that each part of the code is recognized and processed correctly.
The generated Python code incorporates the defined tokens from the custom language, mapping them to their Python equivalents. The compiler handles various operations, including mathematical calculations, variable assignments, and print statements. It also provides functionality to sort and print lists of characters.
The project demonstrates the process of transforming a custom language into working Python code, highlighting the importance of lexical analysis and syntax checking to ensure the validity and accuracy of the translated code.