A fuzzy animal compiler
This project is a (soon-to-be) compiler written in Haskell for CSC 312.
Clone the repository onto your host computer. The project has not been tested on non-Linux machines. The project requires that Haskell Stack is installed on the host machine.
To build the project type
stack build
from the root directory of the project.
To run the project type
stack exec aardvark-exe -- the arguments you wish to invoke
with any arguments you wish to invoke on the program.
Use the --help flag to explore additional commands.
To run the included tests type
stack test
from the root of the project.
Syntax:
e ::= n | e1 + e2 | e1 - e2 | e1 * e2) | e1 / e2
| true | false | (<= e1 e2) | if e1 e2 e3 | func (var :: t1) :: t2 -> e
| fix var (var :: t1) :: t2 -> e | e1~e2 | (tuple) | [] :: t | e : [t]
| head [t] | tail [t] | empty [t] | ref e | !e | while e1 do e2 end | e1 <- e2
| e1 ; e2 | record | get record | nth int e
tuple ::= e | e, tuple
record ::= record var :: t = e with record | recordEnd
[t] means a list of elements of type t.
t ::= bool | int | float | t1 -> t2 | [t] | <t>
Where n is a number of the form of an integer or float and var is an alphabetical string for a variable name.
- Record types added
- Variadic tuples added
- Added tests for both new features
- while loop
- Updated tests for while loop
- Background state for pointer/reference types
- Fixed a <= evaluation bug and if expression bug
- N/A
- Addition of lists, pairs and typechecking
- Made testing scripts better
- Added tests for new features
- Addition of functions and fix functions
- Revamped test suite
- Implemented small-step semantics
- Addition of if statements
- No longer using LISP-like syntax
- Can use lexer and parser flags to see lexer and parser output
- Updated Tests
- Position information in AST
- Syntax has been changed
- Alex and Happy for lexing and parsing
- N/A
- Basic compilation and evaluation of LISP-like expressions
- Input strings to the program now are compiled and evaluated with the evaluation printed to the screen
- Removed old command-line functionality
- Current extrinsic tests are not longer relevant and need to be updated
- Basic command-line functionality
- Extrinsic test foundation added
- N/A
- N/A