A compiler to subset of C programming language by C++
On Ubuntu 20.04LTS:
- Install dependency
sudo apt-get install libgtest-dev
sudo apt-get install cmake # install cmake
- Download the source code of gtest, then cd into the top-level directory.
git clone https://github.com/google/googletest.git
- Enter the command as follows:
# Compile the source code
sudo cmake CMakeLists.txt
sudo make
cd lib
# Copy or symlink libgtest.a and libgtest_main.a to your /usr/lib folder
sudo cp *.a /usr/lib
After these steps, you have installed gtest as link library locally.
The easiest way is to click run button in CLion. Or maybe you can try to comile by CLI.
Enter the command as follows:
cd build
sudo cmake ../
sudo make
Then you will find out an ELF formatted file named simple-C-compiler. Run it:
./simple-C-compiler
And you will see the result.
- symtab
- a syntex-directed translator
- intermedia code generator
- linker ...
Welcome to communicate.