programming language compiler
Go to file
servostar 8bd4898440
Merge pull request #12 from Servostar/8-add-github-action-for-code-check
8 add GitHub action for code check (#12)
reviewed by @flixm16 @SirTalksalot75
2024-04-14 13:54:33 +00:00
.github/workflows added target for code checking in CMakeLists.txt 2024-04-12 23:06:10 +02:00
sdk added canonical project structure 2024-02-04 16:23:32 +01:00
src Merge pull request #12 from Servostar/8-add-github-action-for-code-check 2024-04-14 13:54:33 +00:00
.gitignore added build directory to gitignore 2024-02-13 23:13:43 +01:00
CMakeLists.txt added target for code checking in CMakeLists.txt 2024-04-12 23:06:10 +02:00
Dockerfile added canonical project structure 2024-02-04 16:23:32 +01:00
LICENSE added GPLv2.0 license 2024-04-10 13:44:50 +02:00
README.md added development section about vscode to readme 2024-02-14 20:38:46 +01:00

README.md

Gemstone

Gemstone is a programming language compiler written in C with lex and yacc.

Development with VSCode/Codium

Recommended extensions for getting a decent experience are the following:

In order to remove false error messages from clangd CMake has to be run once in order generate compile_commands.json.

Build

The build pipeline is configured with CMake in the file CMakeLists.txt. In order to avoid dependency and configuration issues the recommended way to build is by using the provided docker containers. All tools required for building (cmake, make, gcc, lex, yacc) are installed inside the SDK container (see Dockerfile sdk/Dockerfile). For creating the build pipeline build the Dockerfile in the root folder of this repository. This takes the current SDK and copies the source files into the home of the build user. Then the make targets are generated. Running make release will build gemstone from source in release mode. The generated binaries can be found either in bin/release/gsc or bin/debug/gsc depending on the chosen target. The following graph visualizes the build pipeline:

                 SDK (environment)
                  │
                  │ configure build environment
                  │  cmake, make, gcc, yacc, lex
                  │
                  ▼
                 Devkit (pipeline)
                  │
                  │ create build pipeline
                  │  create make targets
                  ▼
                 Pipeline
     

yacc (generate files)    GCC (compile)   Extra Source Files (src/*.c)
│                             │                     │
├─ parser.tab.h ─────────────►│◄────────────────────┘
│                             │
└─ parser.tab.c ─────────────►│
                              │
lex (generate file)           │
│                             │
└─ lexer.ll.c  ──────────────►│
                              │
                              ▼
                             gsc

Docker images

Currently, the SDK is based on Almalinux 9.3, an open source distro binary compatible to RHEL 9.3.

The following images can be found in the offical repository at Docker Hub:

  • SDK
  • Devkit