Ignore:
Timestamp:
Oct 10, 2011, 2:17:02 PM (8 years ago)
Author:
tranquil
Message:

work on Cminor completed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/cminor/cminorPrinter.ml

    r1291 r1334  
    172172        (Primitive.print_sig sg)
    173173  | Cminor.St_seq (s1, s2) -> (print_body n s1) ^ (print_body n s2)
     174  | Cminor.St_ifthenelse (e, s1, Cminor.St_skip) ->
     175    Printf.sprintf "%sif (%s) {\n%s%s}\n"
     176    (n_spaces n)
     177    (print_expression e)
     178    (print_body (n+2) s1)
     179    (n_spaces n)
    174180  | Cminor.St_ifthenelse (e, s1, s2) ->
    175181      Printf.sprintf "%sif (%s) {\n%s%s}\n%selse {\n%s%s}\n"
     
    211217                  let lbl = CostLabel.string_of_cost_label lbl in
    212218      Printf.sprintf "%s%s:\n%s" (n_spaces n) lbl (print_body n s)
     219        | Cminor.St_ind_0 (i, s) ->
     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) i
    213223
    214224let print_internal f_name f_def =
     
    255265  | Cminor.St_goto(_) -> "goto"
    256266  | Cminor.St_cost(_,_) -> "cost"
     267        | Cminor.St_ind_0 _ -> "index"
     268        | Cminor.St_ind_inc _ -> "increment"
Note: See TracChangeset for help on using the changeset viewer.