Skip to content

C compiler under development with lexer, parser, and code generation, based on Jeff Lee’s C grammar.

License

Notifications You must be signed in to change notification settings

andersonprizzi/ZenithCompilerProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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.


File structure

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.

Build

On Windows, to build the project, run:

./scripts/build_on_windows.bat

If 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.


Run

On Windows, to execute the compiler, run:

./scripts/run_on_windows.bat

Usage

The 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!

About

C compiler under development with lexer, parser, and code generation, based on Jeff Lee’s C grammar.

Resources

License

Stars

Watchers

Forks

Releases

No releases published