Brutus is a C compiler written in C++11 that supports :
- The following types :
void
,char
(1 byte),int
(8 bytes),int16_t
(2 bytes),int32_t
(4 bytes),int64_t
(8 bytes). - Conditonnal structures :
if
,else
,while
,for
. - The following operators with associativity and precedence :
=
,+
,-
,*
,/
,%
,||
,&&
,|
,&
,^
,~
,==
,!=
,<
,<=
,>
,>=
,!
,++
(prefix only),--
(prefix only). - Order of evaluation of
||
and&&
. - Char litterals including
\a
,\b
,\f
,\n
,\r
,\t
,\v
,\'
,\"
,\?
. - Function definitions and calls with more than 6 paramaters.
- Abstract Syntax Tree (AST) and Intermediate Representation (IR).
- x86_64 asm generation.
- Warnings : uninitialized variables, unused variables/parameters, implicit declaration of function.
You need GCC >= 5, cmake and git.
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
./Brutus [-o <output_file>] <input_file>
./Brutus --help
./compile.sh [-o <output_file>] <input_file>
make test
./customTests.sh
./moodleTests.sh # Not all the tests succeed because of missing features
H4111