HBAL Typechecker
Examples:
test_arith.hbal
test_call.hbal
test_jumps.hbal
test_list_paper.hbal
test_move.hbal
test_move_macro.hbal
test_parser.hbal
test_trees.hbal
(* parser test file * doesn't typechecks of course ! *) sign label3 : { r2:int+ } label1 : { r2:int+, r23:[int+*int+]+, r2:<> } (* types can omit init flags in which case they default to false * inside contexts, the toplevel flag is forced to true * so these 2 statements are equivalent : * label2 : { r2:int+, r23:[int+*int+]+, r2:<> } * label2 : { r2:int, r23:[int+*int+], r2:<> } *) label2 : { r2:int, r23:[int+*int+], r2:<> } <> load r2 <- r5[12]; store r767[42] <- r0; arithi r2 <- r2 + 23; arithi r2 <- r2 - 23; arithi r2 <- r2 * 23; arithi r2 <- r2 / 23; arith r5 <- r2 + r8; arith r5 <- r2 - r8; arith r5 <- r2 * r8; arith r5 <- r2 / r8; arith r5 <- sp / r8; label1: label2: bnz r4 label; bez r2 label; jmp label; call this_label; ret label; label3: use r23 code; use r23 int+; use r23 [int+]+; use r23 int+*int+; use r23 L(int+); use r23 T(int+); use r23 <>; discard r56; (* reuse not allowed anymore *) (* reuse r5[12] as [int+]+; *) salloc int+; (* new syntax for sfree *) sfree 4; (* the old one is still supported *) sfree int+; foldnil int+, r3[5]; foldcons int+, r3[5]; foldleaf int+, r3[5]; foldnode int+, r3[5]; caselist int+, r3[5], label; casetree int+, r3[5], label; move r6[3] <- r2[8], [int+ * int+]+; <>