This project, named Zenith Compiler, is a C language compiler currently under development. It incorporates lexer, parser, and intermediate code generation stages. It’s built on a custom grammar by the project author, inspired by Jeff Lee’s ANSI C grammar. The formal grammar specification is available in GRAMMAR.md.
Overview of the project’s directory layout, detailing how source code, headers, data, and scripts are structured.
headers/: Header files (.h) for the compiler modules.sources/: Source code files (.c) implementing compiler functionality.data/input/: Input source files for compilation.output/: Output files generated by the compiler.
scripts/: Build and run scripts for different platforms.
On Windows, to build the project, run:
./scripts/build_on_windows.batIf the build is successful, you will see the message:
Build successful.Otherwise, if the build fails, you will see:
Build failed.Note: Ensure that gcc is installed and available in your system's PATH environment variable.
On Windows, to execute the compiler, run:
./scripts/run_on_windows.batThe compiler expects two command-line arguments:
<compiler_executable> <input_source_file> <output_file>Contributions, bug reports, and suggestions are very welcome and appreciated. Feel free to open issues or submit pull requests. Every bit of help makes the project better!