Add logical shift left (<<) and logical shift right (>>) to faustine.
[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 | "<<" { IDENT Shl}
53 | ">>" { IDENT Shr}
54 | "max" { IDENT Max}
55 | "min" { IDENT Min}
56 | "prefix" { IDENT Prefix}
57 | "selecttwo" { IDENT Select2}
58 | "selectthree" { IDENT Select3}
59 | "rdtable" { IDENT Rdtable}
60 | "rwtable" { IDENT Rwtable}
61
62 | ['0'-'9']+ as a { CONST a }
63 | '.' { POINT }
64
65 | '(' { LPAR }
66 | ')' { RPAR }
67 | ',' { PAR }
68 | ':' { SEQ }
69 | "<:" { SPLIT }
70 | ":>" { MERGE }
71 | "~" { REC }
72 | eof { EOF }