X-Git-Url: https://svn.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/06159b51a934937f647ec7119b47cb466d8e50b1..bad540d5d41694d5d6f347756273474b2a67195e:/interpretor/lexer.mll?ds=sidebyside diff --git a/interpretor/lexer.mll b/interpretor/lexer.mll index a3a4746..c6a7cb5 100644 --- a/interpretor/lexer.mll +++ b/interpretor/lexer.mll @@ -1,18 +1,48 @@ -{open Parser} +{ +open Parser +open Types +} 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 Sup} +| "*" { IDENT Mul} +| "/" { IDENT Div} +| "_" { IDENT Pass} +| "!" { IDENT Stop} +| "mem" { IDENT Mem} +| "@" { IDENT Delay} +| "floor" { IDENT Floor} +| "int" { IDENT Int} +| "sin" { IDENT Sin} +| "cos" { IDENT Cos} +| "atan" { IDENT Atan} +| "atantwo" { IDENT Atantwo} +| "sqrt" { IDENT Sqrt} +| "rdtable" { IDENT Rdtable} +| "%" { IDENT Mod} +| "vectorize" { IDENT Vectorize} +| "#" { IDENT Vconcat} +| "[]" { IDENT Vpick } +| "serialize" { IDENT Serialize} +| ">" { IDENT Larger} +| "<" { IDENT Smaller} +| "prefix" { IDENT Prefix} +| "selecttwo" { IDENT Selecttwo} +| "selectthree" { IDENT Selectthree} + + +| ['0'-'9']+ as a { CONST a } +| '.' { POINT } + + +| '(' { LPAR } +| ')' { RPAR } +| ',' { PAR } +| ':' { SEQ } +| "<:" { SPLIT } +| ":>" { MERGE } +| "~" { REC } +| eof { EOF }