summaryrefslogtreecommitdiff
path: root/_khb_experiment/khs_ast.ml
blob: f5b2c8dc198deab417aec63ea15588986c1de747 (plain) (blame)
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
type khs_binop =
    | PLUS    | MINUS
    | TIMES   | DIV     | MOD
    | EQUAL   | NEQUAL
    | GT | LT | GE | LE
    | AND | OR | XOR

type khs_unop =
    | MINUS | NOT

type khs_expr =
    | EEmpty
    | EInt of int
    | EStr of string
    | EBool of bool
    | EFrame
    | ELocal of string
    | EBinary of khs_expr * khs_binop * khs_expr
    | EUnary of khs_unop * khs_expr
    | ETernary of khs_expr * khs_expr * khs_expr
    | ECat of khs_expr * khs_expr
    | ELoad of khs_expr
    | ENewChan

type khs_stmt =
    | SLabel of string
    | SSet of khs_expr * khs_expr
    | SGoto of khs_expr
    | SPar of khs_expr
    (* RECV and SEND do a load on their second argument (the chan),
        (ie they expect an address and not a value) *)
    | SRecv of khs_expr * khs_expr  
    | SSend of khs_expr * khs_expr
    | SUnset of khs_expr list
    | SExit