Git Product home page Git Product logo

ee2-compiler's Introduction

Hey, I'm Jaafar ๐Ÿ‘‹

๐Ÿ‡ฑ๐Ÿ‡ง From Lebanon!

๐ŸŽ“ Electronics & Information Engineering @ Imperial College 22'

โ—๏ธ Full-time FDSE / SWE @ Palantir
๐Ÿ”™ Former Co-founder @DeltaCrypt
๐Ÿ”™ Former Full-time SWE & Sales @ Terra (YC 21)
๐Ÿ”™ Former FDSE Intern @ Palantir
๐Ÿ”™ Former Founder @CloseRangeTechnologie
๐Ÿ”™ Former Hardware Engineering Intern @ ARM Holdings
๐Ÿ”™ Former SWE Intern @ Schlumberger

๐Ÿ”— https://www.jaafarrammal.com

I'm interested in:

  • Robotics ๐Ÿค–
  • Full Stack Dev ๐Ÿ’ป
  • Augmented Reality ๐Ÿ‘“
  • Hardware Design ๐Ÿ“Ÿ
  • Computer Vision ๐ŸŽจ

ee2-compiler's People

Contributors

jaafarrammal avatar raphaelbharel avatar

Stargazers

 avatar

Forkers

raphaelbharel

ee2-compiler's Issues

Types

  • variables of double, float, char, unsigned, and pointer types
  • the typedef keyword
  • the sizeof(...) function (which takes either a type or a variable)
  • change the operations from slt to sltu for example for unsigned
  • fix globals (about 11 cases)

Project management

Keep this issue open and drop in any comments on project management / time distribution

General testing

Wickerson's tests:

  • array
  • control flow
  • default
  • float
  • functions
  • integer
  • local variables
  • misc
  • pointer
  • programs
  • string
  • struct
  • types

Extended testing suite:

  • 30%
  • 40%
  • 50%
  • 60%
  • 70%
  • 80%
  • 85%
  • 90%
  • 95%
  • 100%

Implement IR terminology

If statements
Int variables
while loops
arithmetic expressions
logical expressions
local variables

Arrays and Incrementation

  • arrays declared globally (i.e. outside of any function in your file)
  • int a[x];
  • int a[x] = {1, 2, 3 .... x}
  • int a[x] = {1}
  • int a[x] = {1,2}
  • multidimensional arrays?
  • arrays declared locally (i.e. inside a function
  • reading and writing elements of an array
  • support expression indexing :/

Characters

  • character literals, including escape sequences like \n
  • strings (as NULL-terminated character arrays)
  • finalize implementation with STO
  • fix for pointers

Functions and invocations

  • function definition
  • return statement
  • functions that take up to four parameters
  • files containing multiple functions that call each other (requires symbol table)
  • recursive function calls

Pointers

  • taking the address of a variable using the & operator
  • dereferencing a pointer-variable using the * operator
  • Pointer arithmetic
  • Pointer indexing
  • Check GCC policy for char pointers / arrays (is it by bytes or buy words)
  • Multi-depth pointers
  • float / double arrays

ANTLR Setup

Setup ANTLR for C++ with a basic grammar and tree-traversal:

  • Configure ANTLR with C++
  • Implement a basic grammar
  • Traverse the AST and output basic translation

Testing

Enhanced testing for the translator:

  • Make sure all tests pass
  • Add edge cases tests
  • Use other people's tests

Fix bugs from tests

  • implement unary (-4 is assigned as 4, etc...)
  • debug z= x<=y;
  • implement ++ and --
  • one line conditional (cond ? true_exec : false_exec)
  • local variables: add symbol table extension for compoundStatement (aka {list})
  • debug function call failures (0 param + mutual recursion)

Symbol table update

  • Create the symbol table objects (enum, variable, array, function)
  • Implement the objects
  • Implement global declarations for integers

Independent features

  • switch statements
  • for loops
  • the break and continue keywords
  • switch: skip the pre-case scope
  • for: all combinations of emptiness
  • the enum keyword

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.