123456789101112131415161718192021222324252627282930(* Yoann Padioleau
*
* Copyright (C) 2010 Facebook
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation, with the
* special exception on linking described in file license.txt.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file
* license.txt for more details.
*)openCommontypename=stringtypelong_name=stringlist(* meant to be in a analyze_ml/basic/ at some point *)letmodule_name_of_filenamefile=let(_d,b,_e)=Common2.dbe_of_filenamefileinletmodule_name=String.capitalize_asciibinmodule_namelettop_module_of_node(s,kind)=ifs=~"^\\([A-Z][A-Za-z0-9_]*\\)"thenCommon.matched1selsefailwith(spf"could not find top module of %s"(Graph_code.string_of_node(s,kind)))