Skip to content

Basic parts of a compiler for the subset of C++ language using LR(1) grammar

License

Notifications You must be signed in to change notification settings

splinter89/scompiler

Repository files navigation

sCompiler

Basic parts of a compiler for the subset of C++ language using LR(1) grammar.

What's implemented: lexical, syntactic, and semantic analysis.

Installation

  1. Update paths to your Qt/MinGW
    • in scripts\deploy_dynamic.bat
    • and scripts\windows-build-qt-static.ps1
  2. Install UPX.
  3. Download clang-format binary from this page. Activate Beautifier plugin in Qt Creator and customize its options: set "Clang Format"->"Use predefined style" to "File", check "Enable auto format on file save."
  4. Configure your builds:
dynamic static
build directory ..\scompiler-build-desktop ..\scompiler-build-desktop-static
configurations debug, release release
extra build step (release) cmd /C "%{sourceDir}\scripts\deploy_dynamic.bat" cmd /C "%{sourceDir}\scripts\deploy_static.bat"

Static Builds

Use this guide: https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW

To compile static Qt, run the following in Windows PowerShell:

Set-ExecutionPolicy RemoteSigned
.\scripts\windows-build-qt-static.ps1
o                               // use the Open Source Edition
y                               // accept the license offer
...                             // wait ☕
Set-ExecutionPolicy Restricted  // restore the policy

Todo

  • "unknown" data type
  • Reverse Polish notation (poliz)
    • cycle 1: syntax, symbol/block tables
    • cycle 2: rpn, semantics

Links

C++ Language Tutorials

Qt Creator Keyboard Shortcuts

License

This project is licensed under the terms of the MIT license.

About

Basic parts of a compiler for the subset of C++ language using LR(1) grammar

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages