Seems to work
[rops.git] / parser.ml
blob9270e166a6dec17fb9310f856e7e10f295fd1d86
1 type token =
2 | INT of (int)
3 | SYMBOL of (string)
4 | STRING of (string)
5 | LPAREN
6 | RPAREN
7 | LBRACKET
8 | RBRACKET
9 | DOT
10 | EOF
12 open Parsing;;
13 # 1 "parser.mly"
15 open Types;;
16 # 17 "parser.ml"
17 let yytransl_const = [|
18 260 (* LPAREN *);
19 261 (* RPAREN *);
20 262 (* LBRACKET *);
21 263 (* RBRACKET *);
22 264 (* DOT *);
23 0 (* EOF *);
24 0|]
26 let yytransl_block = [|
27 257 (* INT *);
28 258 (* SYMBOL *);
29 259 (* STRING *);
30 0|]
32 let yylhs = "\255\255\
33 \001\000\003\000\003\000\003\000\003\000\004\000\004\000\002\000\
34 \002\000\002\000\002\000\000\000"
36 let yylen = "\002\000\
37 \001\000\003\000\003\000\006\000\006\000\000\000\002\000\001\000\
38 \001\000\001\000\001\000\002\000"
40 let yydefred = "\000\000\
41 \000\000\000\000\011\000\009\000\010\000\006\000\006\000\012\000\
42 \001\000\008\000\000\000\000\000\002\000\000\000\003\000\000\000\
43 \000\000\000\000\000\000\000\000\004\000\005\000"
45 let yydgoto = "\002\000\
46 \008\000\009\000\010\000\011\000"
48 let yysindex = "\001\000\
49 \033\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
50 \000\000\000\000\021\255\007\255\000\000\251\254\000\000\252\254\
51 \033\255\033\255\000\255\005\255\000\000\000\000"
53 let yyrindex = "\000\000\
54 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
55 \000\000\000\000\000\000\000\000\000\000\027\255\000\000\014\255\
56 \000\000\000\000\000\000\000\000\000\000\000\000"
58 let yygindex = "\000\000\
59 \000\000\245\255\000\000\012\000"
61 let yytablesize = 39
62 let yytable = "\014\000\
63 \016\000\001\000\017\000\018\000\021\000\019\000\020\000\003\000\
64 \004\000\005\000\006\000\022\000\007\000\015\000\007\000\007\000\
65 \007\000\007\000\012\000\007\000\007\000\003\000\004\000\005\000\
66 \006\000\013\000\007\000\007\000\007\000\007\000\007\000\007\000\
67 \007\000\003\000\004\000\005\000\006\000\000\000\007\000"
69 let yycheck = "\011\000\
70 \012\000\001\000\008\001\008\001\005\001\017\000\018\000\001\001\
71 \002\001\003\001\004\001\007\001\006\001\007\001\001\001\002\001\
72 \003\001\004\001\007\000\006\001\007\001\001\001\002\001\003\001\
73 \004\001\005\001\006\001\001\001\002\001\003\001\004\001\005\001\
74 \006\001\001\001\002\001\003\001\004\001\255\255\006\001"
76 let yynames_const = "\
77 LPAREN\000\
78 RPAREN\000\
79 LBRACKET\000\
80 RBRACKET\000\
81 DOT\000\
82 EOF\000\
85 let yynames_block = "\
86 INT\000\
87 SYMBOL\000\
88 STRING\000\
91 let yyact = [|
92 (fun _ -> failwith "parser")
93 ; (fun __caml_parser_env ->
94 let _1 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
95 Obj.repr(
96 # 13 "parser.mly"
97 ( _1 )
98 # 99 "parser.ml"
99 : Types.scheme_object))
100 ; (fun __caml_parser_env ->
101 let _2 = (Parsing.peek_val __caml_parser_env 1 : 'exprlist) in
102 Obj.repr(
103 # 17 "parser.mly"
104 ( ProperList (List.rev _2) )
105 # 106 "parser.ml"
106 : 'list))
107 ; (fun __caml_parser_env ->
108 let _2 = (Parsing.peek_val __caml_parser_env 1 : 'exprlist) in
109 Obj.repr(
110 # 18 "parser.mly"
111 ( ProperList (List.rev _2) )
112 # 113 "parser.ml"
113 : 'list))
114 ; (fun __caml_parser_env ->
115 let _2 = (Parsing.peek_val __caml_parser_env 4 : 'exprlist) in
116 let _3 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
117 let _5 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
118 Obj.repr(
119 # 19 "parser.mly"
120 ( ImproperList ((List.rev (_3::_2)), _5) )
121 # 122 "parser.ml"
122 : 'list))
123 ; (fun __caml_parser_env ->
124 let _2 = (Parsing.peek_val __caml_parser_env 4 : 'exprlist) in
125 let _3 = (Parsing.peek_val __caml_parser_env 3 : 'expr) in
126 let _5 = (Parsing.peek_val __caml_parser_env 1 : 'expr) in
127 Obj.repr(
128 # 20 "parser.mly"
129 ( ImproperList ((List.rev (_3::_2)), _5) )
130 # 131 "parser.ml"
131 : 'list))
132 ; (fun __caml_parser_env ->
133 Obj.repr(
134 # 24 "parser.mly"
135 ( []; )
136 # 137 "parser.ml"
137 : 'exprlist))
138 ; (fun __caml_parser_env ->
139 let _1 = (Parsing.peek_val __caml_parser_env 1 : 'exprlist) in
140 let _2 = (Parsing.peek_val __caml_parser_env 0 : 'expr) in
141 Obj.repr(
142 # 25 "parser.mly"
143 ( _2::_1 )
144 # 145 "parser.ml"
145 : 'exprlist))
146 ; (fun __caml_parser_env ->
147 let _1 = (Parsing.peek_val __caml_parser_env 0 : 'list) in
148 Obj.repr(
149 # 29 "parser.mly"
150 ( _1; )
151 # 152 "parser.ml"
152 : 'expr))
153 ; (fun __caml_parser_env ->
154 let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
155 Obj.repr(
156 # 30 "parser.mly"
157 ( Symbol _1 )
158 # 159 "parser.ml"
159 : 'expr))
160 ; (fun __caml_parser_env ->
161 let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in
162 Obj.repr(
163 # 31 "parser.mly"
164 ( String _1 )
165 # 166 "parser.ml"
166 : 'expr))
167 ; (fun __caml_parser_env ->
168 let _1 = (Parsing.peek_val __caml_parser_env 0 : int) in
169 Obj.repr(
170 # 32 "parser.mly"
171 ( Int _1; )
172 # 173 "parser.ml"
173 : 'expr))
174 (* Entry main *)
175 ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0)))
177 let yytables =
178 { Parsing.actions=yyact;
179 Parsing.transl_const=yytransl_const;
180 Parsing.transl_block=yytransl_block;
181 Parsing.lhs=yylhs;
182 Parsing.len=yylen;
183 Parsing.defred=yydefred;
184 Parsing.dgoto=yydgoto;
185 Parsing.sindex=yysindex;
186 Parsing.rindex=yyrindex;
187 Parsing.gindex=yygindex;
188 Parsing.tablesize=yytablesize;
189 Parsing.table=yytable;
190 Parsing.check=yycheck;
191 Parsing.error_function=parse_error;
192 Parsing.names_const=yynames_const;
193 Parsing.names_block=yynames_block }
194 let main (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
195 (Parsing.yyparse yytables 1 lexfun lexbuf : Types.scheme_object)
197 # 34 "parser.mly"
199 # 200 "parser.ml"