- Timestamp:
- Oct 17, 2011, 2:08:27 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorPrinter.ml
r1334 r1392 137 137 let print_table n = 138 138 let f s (case, exit) = 139 Printf.sprintf "%s%scase %d: exit %d;\n" s (n_spaces n) case exit139 Printf.sprintf "%s%scase %d: goto %s;\n" s (n_spaces n) case exit 140 140 in 141 141 List.fold_left f "" … … 187 187 (print_body (n+2) s2) 188 188 (n_spaces n) 189 | Cminor.St_loop s ->189 (* | Cminor.St_loop s -> 190 190 Printf.sprintf "%sloop {\n%s%s}\n" 191 191 (n_spaces n) … … 198 198 (n_spaces n) 199 199 | Cminor.St_exit i -> 200 Printf.sprintf "%sexit %d;\n" (n_spaces n) i 200 Printf.sprintf "%sexit %d;\n" (n_spaces n) i *) 201 201 | Cminor.St_switch (e, tbl, dflt) -> 202 Printf.sprintf "%sswitch (%s) {\n%s%sdefault: exit %d;\n%s}\n"202 Printf.sprintf "%sswitch (%s) {\n%s%sdefault: goto %s;\n%s}\n" 203 203 (n_spaces n) 204 204 (print_expression e) … … 219 219 | Cminor.St_ind_0 (i, s) -> 220 220 Printf.sprintf "%sindex %d:\n%s" (n_spaces n) i (print_body n s) 221 | Cminor.St_ind_inc ( s, i) ->222 Printf.sprintf "%s %sincrement %d;\n" (print_body n s) (n_spaces n) i221 | Cminor.St_ind_inc (i,s) -> 222 Printf.sprintf "%sincrement %d:\n%s\n" (n_spaces n) i (print_body n s) 223 223 224 224 let print_internal f_name f_def = … … 257 257 | Cminor.St_seq(_,_) -> "seq" 258 258 | Cminor.St_ifthenelse(_,_,_) -> "ifthenelse" 259 | Cminor.St_loop(_) -> "loop"259 (* | Cminor.St_loop(_) -> "loop" 260 260 | Cminor.St_block(_) -> "block" 261 | Cminor.St_exit(_) -> "exit" 261 | Cminor.St_exit(_) -> "exit" *) 262 262 | Cminor.St_switch(_,_,_) -> "switch" 263 263 | Cminor.St_return(_) -> "return"
Note: See TracChangeset
for help on using the changeset viewer.