https://github.com/b72u68/simpl
A simple programming language introduced in CS 536: Science of Programming at Illinois Tech
https://github.com/b72u68/simpl
Last synced: 3 months ago
JSON representation
A simple programming language introduced in CS 536: Science of Programming at Illinois Tech
- Host: GitHub
- URL: https://github.com/b72u68/simpl
- Owner: b72u68
- Created: 2022-02-01T21:33:32.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-21T03:03:24.000Z (over 1 year ago)
- Last Synced: 2025-01-20T00:41:39.755Z (5 months ago)
- Language: OCaml
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SimPL: CS 536 Programming Language
A simple programming language designed for CS 536: Science of Programming course
at Illinois Tech.## Overview
I created this parser for fun and to check whether given expressions in
the homework are valid or not, which could easily be done by hand in 15 minutes.
But why dot that when I could spend 24 hours to make a parser to automate it. It
would be fun! (It wasn't).## Syntax
The syntax of SimPL language is described by the BNF grammar below:
```
op = + | - | * | / | > | < | >= | <= | = | && | ||const = int | true | false
expr =
| const
| var
| const list
| var[expr]
| (expr)
| expr op expr
| expr ? expr : expr
| max(expr, expr)
| min(expr, expr)
| size(expr)stmt =
| x := expr
| var[expr] := expr
| if expr then { stmt } else { stmt }
| while expr { stmt }
| stmt; stmt
| skipvalue = const | const list
```## Compiling and Running
```
# build executable for the parser
$ make# parse given file
$ dune exec simpl# open libaries in top level
$ make utop# remove/clean build
$ make clean
```## TODO
- [ ] Implement automated testing using `dune`
- [ ] Implement verification system
- [x] ~~Include position in error message~~
- [x] ~~Add array to the grammar~~
- [x] ~~Typecheck?~~
- [x] ~~Implement small-step and big-step evaluation~~