Skip to content

ArturAssisComp/c--

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c--

This repository contains an implementation of a compiler for a subset of the C Programming Language.

How is a contribution made?

  1. Create a branch with a meaningful name. Ex. implementing-lexer;
  2. Clone the repository:
git clone  https://github.com/ArturAssisComp/c--.git
  1. Change to the desired branch:
cd c--
git checkout <branch-name>
  1. 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()"
  1. Push the changes:
git push origin <name-of-the-branch>
  1. If more changes are necessary, go to 4. Else, go to 7;
  2. 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

How to use the makefile?

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>

Testing

Before testing, install the necessary files:

make install

After installation, compile the test files and run them:

make test
./build/test/*

Before testing

Requirements:

flex-devel 2.6.4

flex 2.6.4

make 4.3

gcc 12.1.1

About

This repository contains an implementation of a compiler for a subset of the C Programming Language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published