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 logCheck the status of the repository
git statusGet changes from remote repository from branch master
git pull origin masterRun the following command in the terminal in the root directory of the c-- project:
makeThe 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 cleanIn order to run all examples:
make run_examplesIn 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 installAfter 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