summaryrefslogtreecommitdiff
path: root/khb/ksh_print.ml
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 21:56:04 +0200
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 21:56:04 +0200
commit0140792c8111d2dd1cf9004f2e3e602ec34ed30a (patch)
treeedce9a1f3f65d1ad107e9e9dd2d28797e653a67d /khb/ksh_print.ml
parent8456506c0b9c8e78eec2cc464851cef36ca03398 (diff)
downloadSystemeReseaux-Projet-0140792c8111d2dd1cf9004f2e3e602ec34ed30a.tar.gz
SystemeReseaux-Projet-0140792c8111d2dd1cf9004f2e3e602ec34ed30a.zip
Cleanup.
Diffstat (limited to 'khb/ksh_print.ml')
-rw-r--r--khb/ksh_print.ml53
1 files changed, 0 insertions, 53 deletions
diff --git a/khb/ksh_print.ml b/khb/ksh_print.ml
deleted file mode 100644
index 6b0a7e3..0000000
--- a/khb/ksh_print.ml
+++ /dev/null
@@ -1,53 +0,0 @@
-open Khs_ast
-
-let rec expr_str = function
- | EEmpty -> "()"
- | EInt i -> string_of_int i
- | EStr s -> "\"" ^ s ^ "\""
- | EBool b -> if b then "true" else "false"
- | EFrame -> "#"
- | ELocal s -> "." ^ s
- | EBinary (e1, op, e2) ->
- "(" ^ expr_str e1 ^
- (match op with
- | PLUS -> " + "
- | MINUS -> " - "
- | TIMES -> " * "
- | DIV -> " / "
- | MOD -> " % "
- | EQUAL -> " == "
- | NEQUAL -> " != "
- | GT -> " > "
- | LT -> " < "
- | GE -> " >= "
- | LE -> " <= "
- | AND -> " && "
- | OR -> " || "
- | XOR -> " ^^ "
- ) ^ expr_str e2 ^ ")"
- | EUnary (op, e) ->
- (match op with
- | MINUS -> "-"
- | NOT -> "!"
- ) ^ expr_str e
- | ETernary(c, a, b) ->
- "(" ^ expr_str c ^ " ? " ^ expr_str a ^ " : " ^ expr_str b ^ ")"
- | ECat(x, y) -> expr_str x ^ "\\" ^ expr_str y
- | ELoad(v) -> "@" ^ expr_str v
- | ENewChan -> "<>"
-
-let print_stmt = function
- | SLabel s -> Format.printf "%s:@." s
- | SSet(k, v) -> Format.printf " %s := %s@." (expr_str k) (expr_str v)
- | SGoto l -> Format.printf " < %s >@." (expr_str l)
- | SPar l -> Format.printf " | %s |@." (expr_str l)
- | SRecv (e, c) -> Format.printf " %s << %s@." (expr_str e) (expr_str c)
- | SSend (e, c) -> Format.printf " %s >> %s@." (expr_str e) (expr_str c)
- | SUnset l ->
- let rec aux = function
- | [] -> " ~("
- | [a] -> " ~(" ^ (expr_str a)
- | a::b -> (aux b) ^ ", " ^ (expr_str a)
- in Format.printf "%s)@." (aux l)
- | SExit ->
- Format.printf " exit@."