Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.
/ bcc Public archive

[Course project - I4IRIM11] Basic C Compiler

License

Notifications You must be signed in to change notification settings

Manah7/bcc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This directory contains a basic C compiler (BCC), developed as part of the
computer system course of the fourth year of computer and network studies at
INSA Toulouse.

This compiler supports a simplified syntax of the C language, including
mathematical operations, loops and functions. It makes it possible to produce
assembly code and/or a binary object executable by the associated FPGA. The
assembly instruction set used is specific to the project and is used by the
cross-assembler to produce the object code. The compiler is implemented in Lex,
Yacc and C; the cross-assembler is developed in Python. The cross-assembler also
performs code optimization operations in two passes and allows the use of
registers. An interpreter is available to execute the assembly code produced by
the compiler. A limited management of errors is also implemented, allowing a 
verbose output in most error cases.

To get started and compile one of the examples (see Makefile and examples/),
use:

$ make example

To compile a given source file use:

$ make
$ ./bcc <source_file>
$ ./ca.py <asm_file>

You can also use the given interpreter to run the compiled assembly code:

$ make demo

To test the error detection, use:

$ make error

The vhdl/ folder contains all the source code used on the target FPGA. This part
is independent of the compiler itself, but is the main target for the compiler.


GNU General Public License, version 3 (GPLv3), see <license>.

Manah <[email protected]> 
Enjmateo <[email protected]>