Code Monkey home page Code Monkey logo

wacc-compiler's Introduction

WACC-Compiler

This group project is developed for Imperial College London's Year 2 Compilers module, which converts WACC code to ARM assembly code using Kotlin and ANTLR4.

WACC

WACC (pronounced "whack") is a simple variant on the While family of languages encountered in many program reasoning/verification courses (in particular in the Models of Computation course taught to our 2nd year undergraduates). It features all the common language constructs you would expect of a no-ops. It also features a rich set of extra constructs, such as simple types, functions, arrays and basic tuple creation on the heap.

The WACC language is intended to help unify the material taught in our more theoretical courses (such as Models of Computation) with the material taught in our more practical courses (such as Compilers). The core of the language should be simple enough to reason about.

You could look at the full language specification at wacc_examples/WACCLangSpec.pdf.

Workflow

  1. ANTLR4 is used to parse the code lexically, producing tokens which is then applied syntactic analysis to check for syntax validity.
  2. The compiler performs semantic analysis to produce resulting intermediate representation (more on this later).
  3. Optimsations are performed on the intermediate representation to reduce code generated.
  4. Finally, the compiler generates code in assembly that targets the ARM instruction set.

wacc-compiler's People

Contributors

trubby22 avatar emil-filip-dev avatar khemichew avatar boringblobking avatar

Watchers

 avatar

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.