aboutsummaryrefslogtreecommitdiff
path: root/src/Language/SimpleShell/AST/Expr.hs
blob: 53b33f4223e17996e9a7d712e7a753391b25724f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module Language.SimpleShell.AST.Expr
  ( Expr(..)
  , TypedExpr
  )
where


import Language.SimpleShell.AST.Name (FunName, VarName)
import Language.SimpleShell.AST.SimpleType (Typed)


-- | Pure expression (no side effects).
data Expr
  = IntLiteral Integer
  | StrLiteral String
  | BoolLiteral Bool
  | Var VarName
  | FunCall FunName [Expr]
  | And Expr Expr
  | Or  Expr Expr
  | Not Expr
  | Eq  Expr Expr
  | Neq Expr Expr
  | Gt  Expr Expr
  | Ge  Expr Expr
  | Lt  Expr Expr
  | Le  Expr Expr
  | Add Expr Expr
  | Sub Expr Expr
  | Mul Expr Expr
  | Div Expr Expr
  | UMinus Expr
  | Concat Expr Expr
  | Ternary Expr Expr Expr
  | Length Expr
  | IntCast Expr
  | StrCast Expr
 deriving (Show)

type TypedExpr = Typed Expr