method vstmt s =
let reserved rstr =
update_val_incr rstr operator_tbl.reserved_tbl;
Cil.DoChildren;
in
match s.Cabs.stmt_node with
| BLOCK _ ->
update_val_incr "{" operator_tbl.otherop_tbl;
update_val_incr "}" operator_tbl.otherop_tbl;
Cil.DoChildren;
| SEQUENCE _ ->
print_string "seq\n";
update_val_incr ";" operator_tbl.otherop_tbl;
Cil.DoChildren;
| IF _ -> self#add_paren (); reserved "if";
| WHILE _ -> self#add_paren (); reserved "while";
| DOWHILE _ ->
update_val_incr "do" operator_tbl.reserved_tbl;
self#add_paren ();
reserved "while";
| FOR _ ->
self#add_paren ();
update_val 2 ";" operator_tbl.otherop_tbl;
reserved "for";
| BREAK _ -> reserved "break";
| CONTINUE _ -> reserved "continue";
| RETURN _ -> reserved "return";
| SWITCH _ -> self#add_paren (); reserved "switch";
| CASE _ -> reserved "case";
| CASERANGE _ ->
update_val_incr "..." operator_tbl.otherop_tbl;
update_val 2 ";" operator_tbl.otherop_tbl;
reserved "case";
| DEFAULT _ -> reserved "default";
| LABEL _ ->
update_val_incr ":" operator_tbl.otherop_tbl;
Cil.DoChildren;
| GOTO (s, _) ->
let lname = Format.sprintf "label_%s" s in
update_val_incr lname operand_tbl.var_tbl;
reserved "goto";
| COMPGOTO _ ->
update_val_incr "*" operator_tbl.otherop_tbl;
reserved "goto";
| DEFINITION _ -> Cil.DoChildren;
| ASM _ -> reserved "asm";
| TRY_EXCEPT _ ->
update_val_incr "except" operator_tbl.reserved_tbl;
reserved "try";
| TRY_FINALLY _ ->
update_val_incr "finally" operator_tbl.reserved_tbl;
reserved "try";
| _ -> Cil.DoChildren;