| 1 | (* ----------------------------------------------------------------------- *) |
| 2 | (* Entry point *) |
| 3 | |
| 4 | let in_file = ref "" |
| 5 | let out_file = ref "" |
| 6 | |
| 7 | let anonymous s = |
| 8 | if !in_file = "" then in_file := s else out_file := s |
| 9 | |
| 10 | let speclist = [] |
| 11 | |
| 12 | let usage = |
| 13 | Printf.sprintf |
| 14 | "Usage: %s [options] <in_filename> <out_filename> \nOptions are:" |
| 15 | (Filename.basename Sys.argv.(0)) |
| 16 | |
| 17 | let main _ = |
| 18 | Arg.parse speclist anonymous usage; |
| 19 | if !in_file = "" then failwith "in_filename required"; |
| 20 | let (ast_lists,ua) = Parse_cocci.process !in_file None false in |
| 21 | Ctltotex.totex !out_file ast_lists (List.map2 Asttoctl.asttoctl ast_lists ua) |
| 22 | |
| 23 | let _ = main () |