Skip to content

Commit d9056e8

Browse files
committed
Documentation done
1 parent 0b6cd68 commit d9056e8

File tree

1 file changed

+89
-5
lines changed

1 file changed

+89
-5
lines changed

README.md

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,106 @@
1-
# Implementing a JIT Compiled Language with Haskell
1+
[![CircleCI](https://circleci.com/gh/IITH-SBJoshi/haskell-11/tree/master.svg?style=svg&circle-token=72b4ba1854966fc5f4e58b1e3d0fc5a05cf4ad66)](https://circleci.com/gh/IITH-SBJoshi/haskell-11/tree/master)
2+
3+
# Implementing a JIT Compiled Language with Haskell
24

35
## About
46

7+
The aim of the project was to implement a simple procedural language.
8+
We named it **HASKULL** :-)
9+
The frontend is written in Haskell and the backend it managed LLVM-hs-pure package.
10+
The project extensively uses Monads, State Monads, Applicative functors and Transformers.
11+
512
### Built With
613

7-
### Installing
14+
You will need GHC 7.8 or newer as well as LLVM 4.0.
15+
16+
### Installation
17+
18+
Clone the repository:
19+
20+
```
21+
git clone "https://github.com/IITH-SBJoshi/haskell-11.git"
22+
```
23+
24+
Browse to the directory where all the files of this repository are located.
25+
26+
Run the following command to build the project.
27+
28+
```
29+
stack build
30+
```
31+
# Usage
32+
33+
Run the following command to get an interactive console.
34+
35+
```
36+
stack repl
37+
```
38+
Type "main" in the interactive console.
39+
40+
Write any code using following Syntax rules
41+
42+
```
43+
Syntax rules:
44+
[A] means optional arg. of type A .
45+
46+
All the symbol starting with lower-case letter are terminal(lexer units).
47+
All the operators are left associative
48+
49+
Command = Expr ;
50+
Expr : DeclarationStmt | FuncCallStmt | LiteralStmt | Var | ifthenStmt | (Expr)
51+
52+
DeclarationStmt : ExternDecl | VarDecl
53+
54+
ExternDecl : extern Name([ArgList]) : Type
55+
VarDecl : Type VList
56+
57+
Type : int | string
58+
VList: Name[, VList]
59+
60+
FuncCallStmt : Call
61+
Call : Name ( [Args] )
62+
63+
BinOpCallStmt : BinOpCall
64+
BinOpCall : Expr Op Expr
65+
66+
Op : + | - | * | / | ; | = | <
67+
reserved keywords: int char def extern string if then else
68+
Args : Expr[, Args]
69+
70+
LiteralStmt : StrLiteral | IntLiteral
71+
IntLiteral : integer
72+
StrLiteral : string
73+
74+
Name : ident
75+
ArgList : Type Name[, ArgList]
76+
77+
Func : def Name([ArgList]) : Type { Command-list }
78+
Command-list = Command [Command-list]
79+
80+
Command = Expr ;
81+
```
82+
For more insight on the language grammer, refer to Language.hs, Lexer.hs, Parser.hs files.
883

9-
On Linux
1084

1185
### Documentation
1286

1387
This project is documented under [Haddock](https://www.haskell.org/haddock/#Documentation) Documentation
1488

89+
To generate documentation run:
90+
91+
```
92+
stack haddock
93+
```
94+
1595
### Authors
1696

17-
* [**Vijay Tadikamalla**](https://github.com/vijayphoenix)
97+
* [**Vijay Tadikamalla**](https://github.com/vijayphoenix)
98+
* [**Anjani Kumar**](https://github.com/anjani-1)
99+
* [**Anupam Saini**](https://github.com/anupamsaini98)
100+
* [**Yogesh Singh**](https://github.com/yo5sh)
18101

19102
#### License
103+
* [LICENSE](https://github.com/IITH-SBJoshi/haskell-11/blob/master/LICENSE)
20104

21105
#### Acknowledgments
22-
* [Haskell LLVM JIT Compiler Tutorial](http://www.stephendiehl.com/llvm)
106+
* [Haskell LLVM JIT Compiler Tutorial](http://www.stephendiehl.com/llvm)

0 commit comments

Comments
 (0)