/sysprog

The scanner and parser we had to develop for our module 'Systemnahes Programmieren' at HSKA Karlsruhe

Primary LanguageC++

Systemnahes Programmieren

Build Status Codacy Badge

This is our compiler that we had to program for the course Systemnahes Programmieren at Hochschule Karlsruhe.

You might want to check out the course's webpage. The project's tasks are in the folder Aufagbenstellung.

The first part is writing a scanner, that analyzes a given input file and tokenizes it. It checks for errors and will print those with line and row number. The recognized tokens will be saved in a specified output file.

It is highly recommended to check out the documentation.

Installation & Requirements

Requirements

In order to build the project, you need the following

  • git
  • gcc
  • make
  • cmake

Installation

git clone https://www.github.com/TobsCore/sysprog.git
cd sysprog
mkdir cmake-build-debug
cd cmake-build-debug
cmake ..

This creates a makefile, which can be used to compile the sources. From sysprog/cmake-build-debug run the following

make all

This will create the unit tests and the resulting program. If you want to only create the program, run make sysprogMain. If you want to create only the unit tests, run make unitTests. After these commands finished without errors, you can run the program by entering:

./sysprogMain path/to/filename
./unitTests

Use project in Eclipse

Eclipse doesn't support CMake support, but CMake can convert the project into an Eclipse project. Assume you haven't cloned the repository yet and want to use it in Eclipse.

There is a small shell script that should ease the transition by setting up the project structure.

git clone https://www.github.com/TobsCore/sysprog.git
cd sysprog
./init_eclipse.sh

Done.

Now you need to import the project to Eclipse. Under File -> Import select General -> Existing projects into workspace.

Select the location that has been printed by the script (should be called something like cmake-build-debug) as _Root Directory` and make sure that Copy projects into workspace is not selected.

You can now double click on the build targets to compile and link the project. I.E the unit tests can be run by double clicking on BuildTargets -> [exe] unitTests.

In project explorer there's a new file called unitTests - [x86_64/le] which you can run by right clicking it and then selecting Run As -> Local C/C++ Application.

Generating the documentation

To generate the documentation, you need to install LaTeX. Then simply run:

make docu