Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.
/ CS335A Public archive

Repository for CS335A (Compiler Design) project

Notifications You must be signed in to change notification settings

rharish101/CS335A

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS335A: Compiler Design - Project

This is the repository for the group project for CS335A: Compiler Design

Group Members

Info

  • Source Language: Go (modified)
  • Target Language: MIPS (using the SPIM simulator)
  • Implementation Language: Python 3.7

Features

  • Most basic C-like features, like:
    • Native datatypes
    • Variables and expressions
    • Control statements (for, while, if-else)
    • Arrays
    • Functions (including recursion)
    • Pointers
    • Structs
    • Libraries (using file imports)
    • Basic I/O (println, scanln)
  • Composite literals
  • Struct embedding, a.k.a composition of structs
  • Typedefs and aliases (kept separate)
  • Overloading of "+" for string concatenation
  • Multi-level pointers (***ptr)
  • Multiple returns from functions
  • Multiple assignments on the same line (eg. a, b = b, a)
  • Switch statements
  • Short declarations (for automatic type inference)
  • Short-circuit evaluation

All Golang features not mentioned above are not implemented.

Source Modifications

  • All for loops, if statements and switch statements must have their clause inside brackets.
  • During embedding of structs, the embedded struct should be accessed as a struct attribute only.
    For example:
    type struct foo {
      a int
    }
    type struct bar {
      foo
      b int
    }
    item := bar{foo{a: 3}, b: 5}
    
    Here, item.foo.a is valid, but item.a is INVALID

About

Repository for CS335A (Compiler Design) project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages