New directory tree, with preprocessor/ inside interpretor/.
[Faustine.git] / interpretor / parser.ml
1 type token =
2 | CONST of (string)
3 | IDENT of (Types.symbol)
4 | LPAR
5 | RPAR
6 | SEQ
7 | SPLIT
8 | MERGE
9 | PAR
10 | REC
11 | EOF
12 | POINT
13
14 open Parsing;;
15 let _ = parse_error;;
16 # 1 "parser.mly"
17
18 open Types
19 # 20 "parser.ml"
20 let yytransl_const = [|
21 259 (* LPAR *);
22 260 (* RPAR *);
23 261 (* SEQ *);
24 262 (* SPLIT *);
25 263 (* MERGE *);
26 264 (* PAR *);
27 265 (* REC *);
28 0 (* EOF *);
29 266 (* POINT *);
30 0|]
31
32 let yytransl_block = [|
33 257 (* CONST *);
34 258 (* IDENT *);
35 0|]
36
37 let yylhs = "\255\255\
38 \001\000\002\000\002\000\002\000\002\000\002\000\002\000\002\000\
39 \002\000\002\000\002\000\000\000"
40
41 let yylen = "\002\000\
42 \002\000\001\000\002\000\003\000\001\000\003\000\003\000\003\000\
43 \003\000\003\000\003\000\002\000"
44
45 let yydefred = "\000\000\
46 \000\000\000\000\000\000\005\000\000\000\012\000\000\000\000\000\
47 \000\000\000\000\000\000\000\000\000\000\000\000\001\000\004\000\
48 \006\000\000\000\000\000\000\000\000\000\011\000"
49
50 let yydgoto = "\002\000\
51 \006\000\007\000"
52
53 let yysindex = "\255\255\
54 \008\255\000\000\024\255\000\000\008\255\000\000\012\000\032\255\
55 \023\255\008\255\008\255\008\255\008\255\008\255\000\000\000\000\
56 \000\000\016\255\253\254\253\254\011\255\000\000"
57
58 let yyrindex = "\000\000\
59 \000\000\000\000\001\000\000\000\000\000\000\000\000\000\007\000\
60 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
61 \000\000\022\000\023\000\026\000\018\000\000\000"
62
63 let yygindex = "\000\000\
64 \000\000\003\000"
65
66 let yytablesize = 286
67 let yytable = "\001\000\
68 \002\000\010\000\011\000\012\000\013\000\014\000\003\000\009\000\
69 \003\000\004\000\005\000\015\000\018\000\019\000\020\000\021\000\
70 \022\000\007\000\013\000\014\000\010\000\010\000\008\000\013\000\
71 \014\000\009\000\017\000\010\000\011\000\012\000\013\000\014\000\
72 \016\000\008\000\000\000\000\000\000\000\000\000\000\000\000\000\
73 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
74 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
75 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
76 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
77 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
78 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
79 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
80 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
81 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
82 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
83 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
84 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
85 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
86 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
87 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
88 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
89 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
90 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
91 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
92 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
93 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
94 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
95 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
96 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
97 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
98 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
99 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
100 \000\000\000\000\000\000\000\000\002\000\002\000\002\000\002\000\
101 \002\000\002\000\003\000\003\000\003\000\003\000\003\000\003\000\
102 \010\000\011\000\012\000\013\000\014\000\007\000\007\000\007\000\
103 \007\000\010\000\008\000\010\000\010\000\009\000"
104
105 let yycheck = "\001\000\
106 \000\000\005\001\006\001\007\001\008\001\009\001\000\000\005\000\
107 \001\001\002\001\003\001\000\000\010\000\011\000\012\000\013\000\
108 \014\000\000\000\008\001\009\001\005\001\000\000\000\000\008\001\
109 \009\001\000\000\004\001\005\001\006\001\007\001\008\001\009\001\
110 \001\001\010\001\255\255\255\255\255\255\255\255\255\255\255\255\
111 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
112 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
113 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
114 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
115 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
116 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
117 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
118 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
119 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
120 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
121 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
122 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
123 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
124 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
125 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
126 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
127 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
128 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
129 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
130 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
131 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
132 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
133 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
134 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
135 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
136 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
137 \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
138 \255\255\255\255\255\255\255\255\004\001\005\001\006\001\007\001\
139 \008\001\009\001\004\001\005\001\006\001\007\001\008\001\009\001\
140 \005\001\006\001\007\001\008\001\009\001\004\001\005\001\006\001\
141 \007\001\004\001\004\001\006\001\007\001\004\001"
142
143 let yynames_const = "\
144 LPAR\000\
145 RPAR\000\
146 SEQ\000\
147 SPLIT\000\
148 MERGE\000\
149 PAR\000\
150 REC\000\
151 EOF\000\
152 POINT\000\
153 "
154
155 let yynames_block = "\
156 CONST\000\
157 IDENT\000\
158 "
159
160 let yyact = [|
161 (fun _ -> failwith "parser")
162 ; (fun __caml_parser_env ->
163 let _1 = (Parsing.peek_val __caml_parser_env 1 : 'faust_exp) in
164 Obj.repr(
165 # 16 "parser.mly"
166 ( _1 )
167 # 168 "parser.ml"
168 : Types.faust_exp))
169 ; (fun __caml_parser_env ->
170 let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
171 Obj.repr(
172 # 17 "parser.mly"
173 ( Const(N (int_of_string _1)) )
174 # 175 "parser.ml"
175 : 'faust_exp))
176 ; (fun __caml_parser_env ->
177 let _1 = (Parsing.peek_val __caml_parser_env 1 : string) in
178 Obj.repr(
179 # 18 "parser.mly"
180 ( Const(R (float_of_string _1)) )
181 # 182 "parser.ml"
182 : 'faust_exp))
183 ; (fun __caml_parser_env ->
184 let _1 = (Parsing.peek_val __caml_parser_env 2 : string) in
185 let _3 = (Parsing.peek_val __caml_parser_env 0 : string) in
186 Obj.repr(
187 # 19 "parser.mly"
188 ( Const(R (float_of_string (_1 ^ "." ^ _3))) )
189 # 190 "parser.ml"
190 : 'faust_exp))
191 ; (fun __caml_parser_env ->
192 let _1 = (Parsing.peek_val __caml_parser_env 0 : Types.symbol) in
193 Obj.repr(
194 # 20 "parser.mly"
195 ( Ident(_1) )
196 # 197 "parser.ml"
197 : 'faust_exp))
198 ; (fun __caml_parser_env ->
199 let _2 = (Parsing.peek_val __caml_parser_env 1 : 'faust_exp) in
200 Obj.repr(
201 # 21 "parser.mly"
202 ( _2 )
203 # 204 "parser.ml"
204 : 'faust_exp))
205 ; (fun __caml_parser_env ->
206 let _1 = (Parsing.peek_val __caml_parser_env 2 : 'faust_exp) in
207 let _3 = (Parsing.peek_val __caml_parser_env 0 : 'faust_exp) in
208 Obj.repr(
209 # 22 "parser.mly"
210 ( Par(_1,_3) )
211 # 212 "parser.ml"
212 : 'faust_exp))
213 ; (fun __caml_parser_env ->
214 let _1 = (Parsing.peek_val __caml_parser_env 2 : 'faust_exp) in
215 let _3 = (Parsing.peek_val __caml_parser_env 0 : 'faust_exp) in
216 Obj.repr(
217 # 23 "parser.mly"
218 ( Split(_1,_3) )
219 # 220 "parser.ml"
220 : 'faust_exp))
221 ; (fun __caml_parser_env ->
222 let _1 = (Parsing.peek_val __caml_parser_env 2 : 'faust_exp) in
223 let _3 = (Parsing.peek_val __caml_parser_env 0 : 'faust_exp) in
224 Obj.repr(
225 # 24 "parser.mly"
226 ( Merge(_1,_3) )
227 # 228 "parser.ml"
228 : 'faust_exp))
229 ; (fun __caml_parser_env ->
230 let _1 = (Parsing.peek_val __caml_parser_env 2 : 'faust_exp) in
231 let _3 = (Parsing.peek_val __caml_parser_env 0 : 'faust_exp) in
232 Obj.repr(
233 # 25 "parser.mly"
234 ( Seq(_1,_3) )
235 # 236 "parser.ml"
236 : 'faust_exp))
237 ; (fun __caml_parser_env ->
238 let _1 = (Parsing.peek_val __caml_parser_env 2 : 'faust_exp) in
239 let _3 = (Parsing.peek_val __caml_parser_env 0 : 'faust_exp) in
240 Obj.repr(
241 # 26 "parser.mly"
242 ( Rec(_1,_3) )
243 # 244 "parser.ml"
244 : 'faust_exp))
245 (* Entry main *)
246 ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
247 |]
248 let yytables =
249 { Parsing.actions=yyact;
250 Parsing.transl_const=yytransl_const;
251 Parsing.transl_block=yytransl_block;
252 Parsing.lhs=yylhs;
253 Parsing.len=yylen;
254 Parsing.defred=yydefred;
255 Parsing.dgoto=yydgoto;
256 Parsing.sindex=yysindex;
257 Parsing.rindex=yyrindex;
258 Parsing.gindex=yygindex;
259 Parsing.tablesize=yytablesize;
260 Parsing.table=yytable;
261 Parsing.check=yycheck;
262 Parsing.error_function=parse_error;
263 Parsing.names_const=yynames_const;
264 Parsing.names_block=yynames_block }
265 let main (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
266 (Parsing.yyparse yytables 1 lexfun lexbuf : Types.faust_exp)