Git Product home page Git Product logo

blang's Introduction

This is a simple compiler for a toy C-like language. It is built in C using Flex and Bison to generate the lexer and parser. This is the compiler I was supposed to write for my compilers class in spring 2006. I finally got around to it on a few random weekends in 2010 and 2011.

Information about the language is available here: http://www.cse.nd.edu/~dthain/courses/cse40243/fall2008/

(Note that this is the course site for a more recent iteration of the class.)

I've renamed my version of the language to 'blang' just in case this project is still in use. (I.e. so current students don't stumble upon it.)

I've added a few modifications to the language description. My version supports type inference of variables that are initialized during declaration. This is done via the keyword 'var' a la C#.

Another modification is a series of optimization passes. In particular, many constant expressions can be reduced, and some unused variables can be excised from the output assembly.

The test dir contains a few test cases, but these are not close to being exhaustive. test/generate probably contains the most useful examples.

(I should also note that the hash table implementation here was not written by me. It was provided as part of the assignment.)

blang's People

Contributors

sdevlin avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.