Giter Site home page Giter Site logo

nalaka1693 / cool-compiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from afterthat97/cool-compiler

0.0 1.0 0.0 8.97 MB

Stanford CS1/CS143 Compilers Course Project - Cool compiler

Makefile 1.39% Cool 0.74% Lex 0.43% C++ 94.71% Shell 1.19% Yacc 0.85% C 0.69%

cool-compiler's Introduction

Stanford CS1/CS143 Compilers Course Project - Cool

Stanford online course of CS143 Compilers: Link

Introduction

The full name of "Cool" is "The Classroom Object-Oriented Language". It is a small language designed for use in an undergraduate compiler course project by Stanford University. Cool has many of the features of modern programming languages, including objects, automatic memory management, and strong static typing. It generates code for a MIPS simulator.

More info:

Installing & Setup

There are two ways to configure the environment. One is to use the provided pre-configured Linux system via VirtualBox VM, the other is to install directly on your own installation of Linux (Debian-based system required). I prefer the second choice because the download is only 5.5MB, otherwise you would need to download the whole VM image which is over 700MB.

Assignments

  • PA2 - Lexical Analysis: Done
  • PA3 - Parsing: Done
  • PA4 - Semantic Analysis: Done
  • PA5 - Code Generation: Skipped

Troubleshooting

spim: No such file or directory

This is because you are running a 64-bit linux, which does not have the 32-bit libc installed.

For Ubuntu 16.04, you can fix it with:

sudo apt-get install libc6-i386

libfl.so: undefined reference to 'yylex'

  • Set the line %option noyywrap in the cool.flex file
  • Remove the -lfl part of the LIB= line in the makefile

cool-compiler's People

Contributors

afterthat97 avatar

Watchers

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.