Code Monkey home page Code Monkey logo

c--compiler's Introduction

C--Compiler

C--Compiler is an attempt to make, by hand, a very basic compiler to translate C++ into assembly for educational purposes. The aim to begin with, is for the compiler to be able to process a relatively small subset of C++, hence the name C--. This project has nothing to do with the C-- proramming language despite what the name of this project might suggest.
This project was part of a final year dissertation. the final_year_proj_june2020 branch reflects the project as it stood on submission

## Getting Started

Prerequisites

  • Dear ImGui Intermediate Mode GUI.

  • SFML as the rendering backend.

  • SFML-Bindings Dear ImGui SFML bindings - Can optionally use any other rendering backend Note sfml bindings do not support imgui docking.

  • ImGuiColorTextEdit Dear ImGui Text Editor Extension/Widget.

  • ImGuiFileDialog Dear ImGui Extension/Widget for file dialogs.

  • spdlog for formating and sinking to window (and potentially files).

  • magic_enum for stringifying enums.

  • treant-js can optionally be used to visualize the Abstract Syntax Tree produced by the parser using a web browser (required for the dissertation branch).

  • C++17

Current Features

  • Lexical Analysis (Mostly complete but some tokens, while they will be tokenized, they wont be recongized leading the parser to throw an error)
  • Parsing (declaration, declaration-assignment, assignment, if-elseif-else, while-dowhile, arithmetic-logical expressions, return statements)
  • Semantic Analysis (Checks for variable being declared or redefined in the current scope, nested scopes, symbols, symbol tables)
  • Partial integration in this branch | Intermediate code generation (TAC) for the language constructs mentioned above.
  • Partial integration in this branch | Some, possibly incorrect 'assembly'.

In Progress

Authors

  • Dimitrios Kazakos - Initial work - Gast91

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.