Add sinwave, fft and fft2d examples.
[Faustine.git] / interpretor / symbol.ml
index 68f5d5f..bdfa410 100644 (file)
@@ -40,6 +40,8 @@ let dimension_of_symbol : symbol -> int * int =
     |Serialize  ->  (1, 1)
     |Larger     ->  (2, 1)
     |Smaller    ->  (2, 1)
+    |Max         ->  (2, 1) 
+    |Min         ->  (2, 1)
     |Prefix     ->  (2, 1)
     |Select2    ->  (3, 1)
     |Select3     ->  (4, 1);;
@@ -66,6 +68,8 @@ let delay_of_symbol : symbol -> int =
     |Mod        ->     0
     |Larger     ->     0
     |Smaller    ->     0
+    |Max         ->     0      
+    |Min         ->     0
     |Vectorize  ->     vectorize_memory_length
     |Vconcat    ->     0
     |Vpick      ->     0
@@ -73,3 +77,36 @@ let delay_of_symbol : symbol -> int =
     |Prefix     ->     1
     |Select2    ->     0
     |Select3     ->    0;;
+
+let string_of_symbol : symbol -> string = 
+  fun (s : symbol) ->
+    match s with
+    |Add        ->     "Add"
+    |Sub        ->     "Sub"           
+    |Mul        ->     "Mul"
+    |Div        ->     "Div"
+    |Pass       ->     "Pass"
+    |Stop       ->     "Stop"
+    |Mem        ->     "Mem"
+    |Delay      ->     "Delay" 
+    |Floor      ->     "Floor"
+    |Int        ->     "Int"
+    |Sin        ->     "Sin"
+    |Cos        ->     "Cos"
+    |Atan       ->     "Atan"
+    |Atan2      ->     "Atan2"
+    |Sqrt       ->     "Sqrt"
+    |Rdtable    ->     "Rdtable"
+    |Mod        ->     "Mod"
+    |Larger     ->     "Larger"
+    |Smaller    ->     "Smaller"
+    |Max         ->     "Max"
+    |Min         ->     "Min"
+    |Vectorize  ->     "Vectorize"
+    |Vconcat    ->     "Vconcat"
+    |Vpick      ->     "Vpick"
+    |Serialize  ->     "Serialize"
+    |Prefix     ->     "Prefix"
+    |Select2    ->     "Select2"
+    |Select3     ->    "Select3";;