sic2 / SCC

(S)t andrews (C)ase (C)ompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PLDI - A Compiler to JVM Bytecode

Student: 100003610

Case Language

<program> ::= <expr> "."

<expr> ::= <int>
		| <bool> 
		| <string> 
		| <id> <expr>* 
		| “case” <expr> “of” <alts> 
		| “for” <id> "in" <expr> “do” <expr> 
		| <expr> <op> <expr> 
		| “{” <expr> “;” ... ";" <expr> “}” 
		| <typedef> | <id> "::" <type> "=" <expr>


<alts> ::= <alt> "|" ... "|" <alt> 
<alt> ::= <type>+ "->" <expr>

<op> ::= “+” | “*” | “-” | “div”| “<”| “==” | ".." | "or" | "and"

<typedef> ::= "type" <id> <args> "=" <constr> <constrs> 
<constrs> ::= ( "|" <constr> ) * 
<constr> ::= <id> <type>*

<type> ::= "int" | "bool" | "string" | "(" <id> <type>* ")"

HOW to run

$ make
$ ./Case

TODO

[] Finish implementing ADT Pattern matching for Case statements
[] For-Loops
[] Range ".."

Requirements

Tested Targets:

i686-apple-darwin10

Other:

Boost 1.54
Location assumed: ~/usr/include/boost/

gcc 4.2.1

About

(S)t andrews (C)ase (C)ompiler


Languages

Language:C++ 78.4%Language:Objective-J 15.0%Language:Java 4.5%Language:C 2.1%