X-Git-Url: https://svn.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/06159b51a934937f647ec7119b47cb466d8e50b1..e1705e136ab823be2e76e63728db1a5359d5d443:/interpretor/faustexp.ml?ds=inline diff --git a/interpretor/faustexp.ml b/interpretor/faustexp.ml index 5904569..6b324a0 100644 --- a/interpretor/faustexp.ml +++ b/interpretor/faustexp.ml @@ -8,15 +8,77 @@ open Types;; open Value;; -(* EXCEPTIONS *) -(** Exception raised in beam matching of faust expressions.*) -exception Beam_Matching_Error of string;; - -(** Exception raised in case that the branch under call hasn't yet been programed.*) exception NotYetDone;; + +class virtual expression : expression_type = + fun (exp_init : faust_exp) -> + object + val exp = exp_init + val dim = new dimension + val delay = 0 + method get_exp = exp + method get_dim = dim + method get_delay = delay + method to_string = "NotYetDone" + method virtual evaluate : beam_type -> beam_type +end;; + + +class exp_const = + object + inherit expression + method evaluate = fun b1 -> + + end;; + + +class exp_ident = + object + inherit expression + + end;; + + +class exp_par = + object + inherit expression + + end;; + + +class exp_split = + object + inherit expression + + end;; + + +class exp_merge = + object + inherit expression + + end;; + +class exp_seq = + object + inherit expression + + end;; + +class exp_rec = + object + inherit expression + + end;; + + + + + + (* PROCESS DELAY ESTIMATION *) (** val delay : faust_exp -> int, returns the number of delays estimated staticly. @@ -39,10 +101,6 @@ let rec delay exp_faust = match exp_faust with |Floor -> 0 |Int -> 0 |Sin -> 0 - |Cos -> 0 - |Atan -> 0 - |Atantwo -> 0 - |Sqrt -> 0 |Rdtable -> 100000 (* danger! *) |Mod -> 0 |Larger -> 0 @@ -163,10 +221,6 @@ returns the dimension tree of constructor(e1, e2).*) |Floor -> End (1, 1) |Int -> End (1, 1) |Sin -> End (1, 1) - |Cos -> End (1, 1) - |Atan -> End (1, 1) - |Atantwo -> End (2, 1) - |Sqrt -> End (1, 1) |Rdtable -> End (3, 1) |Mod -> End (2, 1) |Vectorize -> End (2, 1)