9659a41f1d133f5237efbdbcf42602f19f9ba676
[Faustine.git] / interpretor / lexer.mll
1 {
2 open Parser
3 open Types
4 }
5
6 rule token = parse
7 [' ' '\t' '\n' ] { token lexbuf }
8
9 | "+" { IDENT Add}
10 | "-" { IDENT Sub}
11 | "*" { IDENT Mul}
12 | "/" { IDENT Div}
13 | "^" { IDENT Power}
14 | "_" { IDENT Pass}
15 | "!" { IDENT Stop}
16 | "&" { IDENT And}
17 | "|" { IDENT Or}
18 | "xor" { IDENT Xor}
19 | "mem" { IDENT Mem}
20 | "@" { IDENT Delay}
21 | "floor" { IDENT Floor}
22 | "ceil" { IDENT Ceil}
23 | "rint" { IDENT Rint}
24 | "int" { IDENT Int}
25 | "float" { IDENT Float}
26 | "sin" { IDENT Sin}
27 | "asin" { IDENT Asin}
28 | "cos" { IDENT Cos}
29 | "acos" { IDENT Acos}
30 | "tan" { IDENT Tan}
31 | "atan" { IDENT Atan}
32 | "atantwo" { IDENT Atan2}
33 | "exp" { IDENT Exp}
34 | "sqrt" { IDENT Sqrt}
35 | "log" { IDENT Ln}
36 | "logten" { IDENT Lg}
37 | "pow" { IDENT Power}
38 | "abs" { IDENT Abs}
39 | "fmod" { IDENT Fmod}
40 | "%" { IDENT Mod}
41 | "remainder" { IDENT Remainder}
42 | "vectorize" { IDENT Vectorize}
43 | "#" { IDENT Vconcat}
44 | "[]" { IDENT Vpick }
45 | "serialize" { IDENT Serialize}
46 | '>' { IDENT Gt}
47 | '<' { IDENT Lt}
48 | ">=" { IDENT Geq}
49 | "<=" { IDENT Leq}
50 | "==" { IDENT Eq}
51 | "!=" { IDENT Neq}
52 | "max" { IDENT Max}
53 | "min" { IDENT Min}
54 | "prefix" { IDENT Prefix}
55 | "selecttwo" { IDENT Select2}
56 | "selectthree" { IDENT Select3}
57 | "rdtable" { IDENT Rdtable}
58 | "rwtable" { IDENT Rwtable}
59
60
61 | ['0'-'9']+ as a { CONST a }
62 | '.' { POINT }
63
64
65 | '(' { LPAR }
66 | ')' { RPAR }
67 | ',' { PAR }
68 | ':' { SEQ }
69 | "<:" { SPLIT }
70 | ":>" { MERGE }
71 | "~" { REC }
72 | eof { EOF }