Bugs fixed for stdin and stdout.
[Faustine.git] / interpreter / 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 Pass}
14 | "!" { IDENT Stop}
15 | "&" { IDENT And}
16 | "|" { IDENT Or}
17 | "^" { IDENT Xor}
18 | "mem" { IDENT Mem}
19 | "@" { IDENT Delay}
20 | "floor" { IDENT Floor}
21 | "ceil" { IDENT Ceil}
22 | "rint" { IDENT Rint}
23 | "int" { IDENT Int}
24 | "float" { IDENT Float}
25 | "sin" { IDENT Sin}
26 | "asin" { IDENT Asin}
27 | "cos" { IDENT Cos}
28 | "acos" { IDENT Acos}
29 | "tan" { IDENT Tan}
30 | "atan" { IDENT Atan}
31 | "atantwo" { IDENT Atan2}
32 | "exp" { IDENT Exp}
33 | "sqrt" { IDENT Sqrt}
34 | "log" { IDENT Ln}
35 | "logten" { IDENT Lg}
36 | "powf" { IDENT Power}
37 | "abs" { IDENT Abs}
38 | "fmodf" { IDENT Fmod}
39 | "%" { IDENT Mod}
40 | "remainder" { IDENT Remainder}
41 | "vectorize" { IDENT Vectorize}
42 | "#" { IDENT Vconcat}
43 | "[]" { IDENT Vpick }
44 | "serialize" { IDENT Serialize}
45 | '>' { IDENT Gt}
46 | '<' { IDENT Lt}
47 | ">=" { IDENT Geq}
48 | "<=" { IDENT Leq}
49 | "==" { IDENT Eq}
50 | "!=" { IDENT Neq}
51 | "<<" { IDENT Shl}
52 | ">>" { IDENT Shr}
53 | "max" { IDENT Max}
54 | "min" { IDENT Min}
55 | "prefix" { IDENT Prefix}
56 | "selecttwo" { IDENT Select2}
57 | "selectthree" { IDENT Select3}
58 | "rdtable" { IDENT Rdtable}
59 | "rwtable" { IDENT Rwtable}
60 | "button" { IDENT Button}
61 | "checkbox" { IDENT Checkbox}
62 | "vslider" { IDENT Vslider}
63 | "hslider" { IDENT Hslider}
64 | "vgroup" { IDENT Vgroup}
65 | "hgroup" { IDENT Hgroup}
66 | "tgroup" { IDENT Tgroup}
67 | "hbargraph" { IDENT Hbargraph}
68 | "vbargraph" { IDENT Vbargraph}
69 | "nentry" { IDENT Nentry}
70 | "attach" { IDENT Attach}
71
72 | ['0'-'9']+ as a { CONST a }
73 | '.' { POINT }
74
75 | '(' { LPAR }
76 | ')' { RPAR }
77 | ',' { PAR }
78 | ':' { SEQ }
79 | "<:" { SPLIT }
80 | ":>" { MERGE }
81 | "~" { REC }
82 | eof { EOF }