Code Monkey home page Code Monkey logo

c202-assembly's Introduction

c202-assembly

C compiler written in Elixir for the Compilers class at National Autonomous University of Mexico School of Engineering.

Project Development

Entire documentation:

Requirements

  • Elixir
  • Mix

Usage

  • Clone this repository

    git clone https://github.com/hiphoox/c202-assembly
    cd c202-assembly/assembly
    
  • Compile it

    mix escript.build
    
  • Run it (just an example)

    ./assembly examples/test.c
    

    Note: if you want to run your own C example just pass the path to that file after ./assembly <path-to-your-file>

  • Test it

    mix test
    

    Set of tests for this stage

What is a compiler?

Compilers are computer programs that translate a program written in one language into a program written in another language

​ [Cooper, Torczon] (pg. 1)

compiler

Light project description

In this project, we will be building a C compiler written in Elixir that compiles into x86 assembly code. The compiler will recognize the following C program structure:

int main() {
  return "<exp>"; //"<exp>" will be substituted by several expressions.
}

The expressions the compiler will recognize are the following:

  1. Integers

    int main() {
    	return 23;
    }
  2. Unary operators

    int main() {
      return -23; //negation (-), bitwise complement (~), logical negation (!)
    }
  3. Binary operators

    int main() {
      return 2 + 3; //addition (+), multiplication (*), division (/)
    }
  4. More binary operators

    int main() {
      return 2 && 3; //logical AND (&&), logical OR (||), equal to (==), not equal to (!=), less than (<), less than or equal to (<=), greater than (>), greater than or equal to (>=)
    }

Statement of work

  1. Teams of 4 members.
  2. Everything delivered through Git and Github.
  3. 30 minute working demo to the class.

Roles

Néstor Martínez

  • Project manager: sets the project schedule, holds weekly meetings, mantains a project log and makes sure the project deliverables get done on time.

Mario Garrido

  • System Architect: defines the compiler architecture, modules and interfaces.

Enrique Hernández

  • System Integrator: defines the system development platforms and tools, the integration environment, and a build file to ensure the compiler components work together -> he needs to use Git correctly.

Alejandro Bondi

  • Tester: defines the test plan and AUTOMATED TESTS. Each team member is expected to execute the test suites as the compiler is being developed to make sure the compiler meets the language specification.

Norberto

  • Domain expert: helps explain compiler concepts, characteristics, how they work and the best way to interpret them.
  • Customer: defines what he wants, in this specific case, the compiler features.

Resources

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.