This repository contains an implementation of a compiler for a subset of the C Programming Language.
- Create a branch with a meaningful name. Ex. implementing-lexer;
- Clone the repository:
git clone https://github.com/ArturAssisComp/c--.git
- Change to the desired branch:
cd c--
git checkout <branch-name>
- For each meaningful change, make a commit; -> Fist, add the files that were changed:
git add <filename1> <filename2> ... <filenameN>
-> Commit the changes:
git commit -m "Implemented function foo()"
- Push the changes:
git push origin <name-of-the-branch>
- If more changes are necessary, go to 4. Else, go to 7;
- Create a pull request and assign someone to review the changes that were made in the branch;
=> Other useful commands:
Check the history of commits
git log
Check the status of the repository
git status
Get changes from remote repository from branch master
git pull origin master
Run the following command in the terminal in the root directory of the c-- project:
make
The compiled executable (named cmm) will be saved into the folder build.
Usage: cmm <filename>
or: cmm
Executing cmm without argument makes stdin to be the input.
To clean, run:
make clean
In order to run all examples:
make run_examples
In order to run a specific example file (the default value for EXAMPLE_FILENAME is debug.c):
make run_example_file EXAMPLE_FILENAME=<filename>
Before testing, install the necessary files:
make install
After installation, compile the test files and run them:
make test
./build/test/*
Before testing
flex-devel 2.6.4
flex 2.6.4
make 4.3
gcc 12.1.1