Giter VIP home page Giter VIP logo

compiler's Introduction

Compiler, Spring 2017

This is the final project for my Spring 2017 Compiler Theory course, a compiler built using Lex and Yacc.

Full details for the assignment are available in CompilerFinalProject.pdf

Full documentation for the VSL (very simple langauge) that this is a compiler for is available in VSL Programming Language.pdf

VSL_Lex.l is the lexical analyzer written in Lex, which after being run through Lex outputs lex.yy.c, the final lexical analyzer written in C. This simply gets the next token and returns the appropriate value to the parser.

VSL_YACC.y is the parser written in Yacc using Backus–Naur form, which after being run through Yacc outputs y.tab.c, the final compiler written in C. This requests the next token from the lexical analyzer, then decides what to do with it. The code is generated directly during the parsing here.

y.tab.h is the list of token definitions for use in both parts of this program.

The main final program is y.tab.c, but again all C portions of this project were generated by Lex and Yacc. I only wrote the Lex and Yacc code, and made some slight edits to the C code.

This compiler generates assembly code which can be assembled into binary instructions by my Two Pass Assembler, which can be run on my Virtual Machine, each in their own repository.

compiler's People

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.