Last active
August 29, 2015 13:56
-
-
Save patrickt/9024887 to your computer and use it in GitHub Desktop.
simple syntax tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Lit | |
= StrLit String | |
| IntLit Int | |
| Ident String | |
deriving (Show, Eq) | |
data Expr | |
= Index Expr Expr | |
| Call [Expr] | |
| Unary String Expr | |
| Binary Expr String Expr | |
| Paren Expr | |
| Literal Lit | |
deriving (Show, Eq) | |
data Stmt | |
= Break | |
| Continue | |
| Empty | |
| IfElse Expr [Stmt] [Stmt] | |
| Return (Maybe Expr) | |
| While Expr [Stmt] | |
| Expression Expr | |
deriving (Show, Eq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment