Giter VIP home page Giter VIP logo

cs520's Introduction

GoLite Compiler

  • Justin Domingue – 260588454
  • Daniel Pham – 260526252
  • Seguei Nevarko – 260583807

Reference: https://golang.org/ref/spec

Code viewed:

Development

Compile

// In root directory
$ ./run

or

$ cd src/
$ make

Testing

Run the parser on all files in programs/

$ cd src
$ make test

Usage

Run parser

$ ./golite parse file

Run pretty printer

$ ./golite pretty file

Dump symbol table

$ ./golite symbol file

Run type checker

$ ./golite type file

Run type checker and pretty print with types

$ ./golite pptype file

Generate code

$ ./golite code file

For Vince

Everything can be done from the top directory

Compile

$ ./run

[-pretty] Pretty print the input file

$ ./run  -pretty file.go
$ ls outputs/
foo.pretty.go

[-pptype] Pretty print with expression types

$ ./run  -pptype file.go
$ ls outputs/
foo.pptype.go

[-dumpsymtab] Dump top-most frame of the symbol table each time a scope is exited

$ ./run  -dumpsymtab file.go
$ ls outputs
foo.symtab

[-code] Generate Code

$ ./run -code file.go
$ ls outputs/
file.cpp

Flags can be used together

$ ./run  -pptype -dumpsymtab file.go
$ ls outputs/
foo.symtab  foo.pptype.go

If no flags are provided, the run command will attempt to generate all the files

Comments

  • Errors will be emmitted to stderr
  • Calling ./run file.go [-pptype -dumpsymtab] will delete everything in output before proceeding with the command

Submited Files

programs/valids/sorting.go

programs/valids/calc.go

programs/valids/set2square.go

Notes

The complier tends to segfault randomly on POSIX machines (OS X)

Tested to run fine on the Trotier machines.

cs520's People

Contributors

danhp avatar justindomingue avatar serguein avatar gnuvince 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.