A Java-based compiler project that includes a suite of tools for lexical analysis, syntax analysis, and abstract syntax tree construction. This project is ideal for those interested in understanding the internals of compiler design and implementation.
- Lexical Analyzer: Tokenizes input source code into manageable pieces.
- Syntax Analyzer: Parses tokens to validate and construct syntax trees.
- Abstract Syntax Analyzer: Analyzes and optimizes abstract syntax representations.
- Compilation: End-to-end process to compile code.
- Java 11 or higher
- Maven (optional, for dependency management)
- Clone the repository:
git clone https://github.com/tranculent/Compiler.git cd Compiler - Compile the project:
javac -d bin src/*.java - Run the main program:
java -cp bin Compile
- Lexical Analysis: Use the LexicalAnalyser class to perform tokenization.
- Syntax Analysis: Utilize SyntaxAnalyzer for parsing tokens.
- Abstract Syntax: Analyze and manipulate abstract syntax using AbstractSyntaxAnalyser.
- src/: Contains source code files.
- bin/: Compiled Java bytecode.
- Compile.java: Main entry point for the compiler.
- Fork the repository.
- Create a new branch (feature/your-feature).
- Commit changes (git commit -am 'Add feature').
- Push to the branch (git push origin feature/your-feature).
- Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.