diff options
author | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-11 16:41:43 +0200 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ansys.com> | 2014-06-11 16:41:43 +0200 |
commit | 36f98d819756ada119e696729e40d8e8e427b5f0 (patch) | |
tree | cacac900a6923e68911756c335f0dfaa61fcfba5 /libs/util.ml | |
download | scade-analyzer-36f98d819756ada119e696729e40d8e8e427b5f0.tar.gz scade-analyzer-36f98d819756ada119e696729e40d8e8e427b5f0.zip |
Initial commit: parser for tiny subset of SCADE language...
Diffstat (limited to 'libs/util.ml')
-rw-r--r-- | libs/util.ml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/util.ml b/libs/util.ml new file mode 100644 index 0000000..30cf5bf --- /dev/null +++ b/libs/util.ml @@ -0,0 +1,20 @@ +exception TypeError + +module VarMap = Mapext.Make(String) + +let rec fix equal f s = + let fs = f s in + if equal fs s + then fs + else fix equal f fs + +let (@@) f x = f x + +let print_list x l = + Format.printf "%s: " x; + let rec aux = function + | [] -> () + | [a] -> Format.printf "%s" a + | p::q -> Format.printf "%s, " p; aux q + in + Format.printf "["; aux l; Format.printf "]@."; |