Completing basic operations in basic.ml for primitives float, And, Or, Xor, fmod...
[Faustine.git] / interpretor / lexer.mll
index a3a4746..4f2f525 100644 (file)
@@ -1,18 +1,72 @@
-{open Parser}
+{
+open Parser
+open Types
+}
 
 rule token = parse
 
 rule token = parse
-  [' ' '\t' '\n' ]                                                     { token lexbuf }
-| ['a'-'z' 'A'-'Z']+ as x                                              { IDENT x }
-| ['+' '*' '-' '/' '!' '_' '#' 
-   '@' '<' '>' '%'] as x                       { IDENT (String.make 1 x) }
-| "[]"                                      { IDENT "[]" }
-| ['0'-'9']+ as a                                                                    { CONST a }
-| '.'                                       { POINT }
-| '('                                                          { LPAR }
-| ')'                                                    { RPAR }
-| ','                                                                                              { PAR }
-| ':'                                                                                          { SEQ }
-| "<:"                                                                                         { SPLIT }
-| ":>"                                                                                         { MERGE }
-| "~"                                                                                          { REC }
-| eof                                                                                          { EOF }
+  [' ' '\t' '\n' ]                     { token lexbuf }
+
+| "+"                                   { IDENT Add}
+| "-"                                   { IDENT Sub}
+| "*"                                   { IDENT Mul}
+| "/"                                   { IDENT Div}
+| "^"                                  { IDENT Power}
+| "_"                                   { IDENT Pass}
+| "!"                                   { IDENT Stop}
+| "&"                                  { IDENT And}
+| "|"                                  { IDENT Or}
+| "xor"                                        { IDENT Xor}
+| "mem"                                 { IDENT Mem}
+| "@"                                   { IDENT Delay}
+| "floor"                               { IDENT Floor}
+| "ceil"                               { IDENT Ceil}
+| "rint"                               { IDENT Rint}
+| "int"                                 { IDENT Int}
+| "float"                              { IDENT Float}
+| "sin"                                 { IDENT Sin}
+| "asin"                               { IDENT Asin}
+| "cos"                                 { IDENT Cos}
+| "acos"                               { IDENT Acos}
+| "tan"                                        { IDENT Tan}
+| "atan"                                { IDENT Atan}
+| "atantwo"                                    { IDENT Atan2}
+| "exp"                                        { IDENT Exp}
+| "sqrt"                                { IDENT Sqrt}
+| "log"                                        { IDENT Ln}
+| "logten"                             { IDENT Log10}
+| "pow"                                        { IDENT Power}
+| "abs"                                        { IDENT Abs}
+| "fmod"                               { IDENT Fmod}
+| "%"                                   { IDENT Mod}
+| "remainder"                          { IDENT Remainder}
+| "vectorize"                           { IDENT Vectorize}
+| "#"                                   { IDENT Vconcat}
+| "[]"                                  { IDENT Vpick }
+| "serialize"                           { IDENT Serialize}
+| '>'                                   { IDENT Greater}
+| '<'                                   { IDENT Less}
+| ">="                                 { IDENT Gore}
+| "<="                                 { IDENT Lore}
+| "=="                                 { IDENT Equal}
+| "!="                                 { IDENT Different}
+| "max"                                        { IDENT Max}
+| "min"                                        { IDENT Min}
+| "prefix"                              { IDENT Prefix}
+| "selecttwo"                           { IDENT Select2}
+| "selectthree"                         { IDENT Select3}  
+| "rdtable"                             { IDENT Rdtable}
+| "rwtable"                            { IDENT Rwtable}
+
+
+| ['0'-'9']+ as a                      { CONST a }
+| '.'                                   { POINT }
+
+
+| '('                                  { LPAR }
+| ')'                                  { RPAR }
+| ','                                  { PAR }
+| ':'                                  { SEQ }
+| "<:"                                 { SPLIT }
+| ":>"                                 { MERGE }
+| "~"                                  { REC }
+| eof                                  { EOF }