This is a basic compiler project where i try and build my first compiler, this will mainly serve as a learning process
This compiler project aims to cover the fundamental concepts of compiler design, including lexical analysis, parsing, semantic analysis, intermediate code generation, optimization, and target code generation. This step-by-step guide follows the examples and exercises from the book "Modern Compiler Implementation in Java".
The compiler will include the following features:
- Lexical analysis (scanner) for tokenizing the input source code
- Syntax analysis (parser) for constructing parse trees
- Semantic analysis for type-checking and symbol table management
- Intermediate code generation using three address code representation
- Optimization techniques, such as constant folding and common subexpression elimination
- Target code generation, translating the intermediate code to the target language (e.g., assembly or machine code)
To get started with this project, you need to have Java Development Kit (JDK) installed on your system. You can download and install the JDK from the official Oracle website.
The compiler will be implemented using Java and follow the principles and techniques presented in the book "Modern Compiler Implementation in Java". Each component of the compiler, such as the lexer, parser, semantic analyzer, and code generator, will have its own package within the src/
directory.
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.