package dolmen

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file parser.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568

module Make

# 6 "src/languages/dimacs/parser.mly"
           (L : Dolmen_intf.Location.S)
# 7 "src/languages/dimacs/parser.ml"


# 7 "src/languages/dimacs/parser.mly"
           (T : Ast.Term with type location := L.t)
# 12 "src/languages/dimacs/parser.ml"


# 8 "src/languages/dimacs/parser.mly"
           (S : Ast.Statement with type location := L.t and type term := T.t)
# 17 "src/languages/dimacs/parser.ml"

= struct
  
  module MenhirBasics = struct
    
    exception Error of int
    
    let _eRR =
      fun _s ->
        raise (Error _s)
    
    type token = Tokens.token
    
  end
  
  include MenhirBasics
  
  type ('s, 'r) _menhir_state = 
    | MenhirState00 : ('s, _menhir_box_file) _menhir_state
      (** State 00.
        Stack shape : .
        Start symbol: file. *)

    | MenhirState01 : (('s, 'r) _menhir_cell1_NEWLINE, 'r) _menhir_state
      (** State 01.
        Stack shape : NEWLINE.
        Start symbol: <undetermined>. *)

    | MenhirState03 : (('s, _menhir_box_file) _menhir_cell1_list_NEWLINE_, _menhir_box_file) _menhir_state
      (** State 03.
        Stack shape : list(NEWLINE).
        Start symbol: file. *)

    | MenhirState09 : ((('s, _menhir_box_file) _menhir_cell1_list_NEWLINE_, _menhir_box_file) _menhir_cell1_start, _menhir_box_file) _menhir_state
      (** State 09.
        Stack shape : list(NEWLINE) start.
        Start symbol: file. *)

    | MenhirState10 : (('s, _menhir_box_file) _menhir_cell1_NEWLINE, _menhir_box_file) _menhir_state
      (** State 10.
        Stack shape : NEWLINE.
        Start symbol: file. *)

    | MenhirState17 : (('s, _menhir_box_file) _menhir_cell1_clause, _menhir_box_file) _menhir_state
      (** State 17.
        Stack shape : clause.
        Start symbol: file. *)

    | MenhirState19 : (('s, 'r) _menhir_cell1_atom, 'r) _menhir_state
      (** State 19.
        Stack shape : atom.
        Start symbol: <undetermined>. *)

    | MenhirState23 : ('s, _menhir_box_input) _menhir_state
      (** State 23.
        Stack shape : .
        Start symbol: input. *)

    | MenhirState24 : (('s, _menhir_box_input) _menhir_cell1_list_NEWLINE_, _menhir_box_input) _menhir_state
      (** State 24.
        Stack shape : list(NEWLINE).
        Start symbol: input. *)

  
  and ('s, 'r) _menhir_cell1_atom = 
    | MenhirCell1_atom of 's * ('s, 'r) _menhir_state * (T.t) * Lexing.position
  
  and ('s, 'r) _menhir_cell1_clause = 
    | MenhirCell1_clause of 's * ('s, 'r) _menhir_state * (S.t)
  
  and ('s, 'r) _menhir_cell1_list_NEWLINE_ = 
    | MenhirCell1_list_NEWLINE_ of 's * ('s, 'r) _menhir_state * (unit list)
  
  and ('s, 'r) _menhir_cell1_start = 
    | MenhirCell1_start of 's * ('s, 'r) _menhir_state * (S.t)
  
  and ('s, 'r) _menhir_cell1_NEWLINE = 
    | MenhirCell1_NEWLINE of 's * ('s, 'r) _menhir_state * Lexing.position
  
  and _menhir_box_input = 
    | MenhirBox_input of (S.t option) [@@unboxed]
  
  and _menhir_box_file = 
    | MenhirBox_file of (S.t list) [@@unboxed]
  
  let _menhir_action_02 =
    fun _endpos_i_ _startpos_i_ i ->
      let _endpos = _endpos_i_ in
      let _startpos = _startpos_i_ in
      (
# 48 "src/languages/dimacs/parser.mly"
    ( let loc = L.mk_pos _startpos _endpos in T.atom ~loc i )
# 110 "src/languages/dimacs/parser.ml"
       : (T.t))
  
  let _menhir_action_03 =
    fun _endpos__3_ _startpos_c_ c ->
      let _endpos = _endpos__3_ in
      let _startpos = _startpos_c_ in
      (
# 44 "src/languages/dimacs/parser.mly"
    ( let loc = L.mk_pos _startpos _endpos in S.clause ~loc c )
# 120 "src/languages/dimacs/parser.ml"
       : (S.t))
  
  let _menhir_action_04 =
    fun () ->
      (
# 36 "src/languages/dimacs/parser.mly"
    ( [] )
# 128 "src/languages/dimacs/parser.ml"
       : (S.t list))
  
  let _menhir_action_05 =
    fun l ->
      (
# 38 "src/languages/dimacs/parser.mly"
    ( l )
# 136 "src/languages/dimacs/parser.ml"
       : (S.t list))
  
  let _menhir_action_06 =
    fun c l ->
      (
# 40 "src/languages/dimacs/parser.mly"
    ( c :: l )
# 144 "src/languages/dimacs/parser.ml"
       : (S.t list))
  
  let _menhir_action_07 =
    fun h l ->
      (
# 27 "src/languages/dimacs/parser.mly"
    ( h :: l )
# 152 "src/languages/dimacs/parser.ml"
       : (S.t list))
  
  let _menhir_action_08 =
    fun () ->
      (
# 19 "src/languages/dimacs/parser.mly"
    ( None )
# 160 "src/languages/dimacs/parser.ml"
       : (S.t option))
  
  let _menhir_action_09 =
    fun s ->
      (
# 21 "src/languages/dimacs/parser.mly"
    ( Some s )
# 168 "src/languages/dimacs/parser.ml"
       : (S.t option))
  
  let _menhir_action_10 =
    fun c ->
      (
# 23 "src/languages/dimacs/parser.mly"
    ( Some c )
# 176 "src/languages/dimacs/parser.ml"
       : (S.t option))
  
  let _menhir_action_11 =
    fun () ->
      (
# 216 "<standard.mly>"
    ( [] )
# 184 "src/languages/dimacs/parser.ml"
       : (unit list))
  
  let _menhir_action_12 =
    fun x xs ->
      (
# 219 "<standard.mly>"
    ( x :: xs )
# 192 "src/languages/dimacs/parser.ml"
       : (unit list))
  
  let _menhir_action_13 =
    fun x ->
      (
# 228 "<standard.mly>"
    ( [ x ] )
# 200 "src/languages/dimacs/parser.ml"
       : (T.t list))
  
  let _menhir_action_14 =
    fun x xs ->
      (
# 231 "<standard.mly>"
    ( x :: xs )
# 208 "src/languages/dimacs/parser.ml"
       : (T.t list))
  
  let _menhir_action_15 =
    fun _endpos__5_ _startpos__1_ nbclause nbvar ->
      let _endpos = _endpos__5_ in
      let _startpos = _startpos__1_ in
      (
# 31 "src/languages/dimacs/parser.mly"
    ( let loc = L.mk_pos _startpos _endpos in
      S.p_cnf ~loc nbvar nbclause )
# 219 "src/languages/dimacs/parser.ml"
       : (S.t))
  
  let _menhir_print_token : token -> string =
    fun _tok ->
      match _tok with
      | Tokens.CNF ->
          "CNF"
      | Tokens.EOF ->
          "EOF"
      | Tokens.INT _ ->
          "INT"
      | Tokens.NEWLINE ->
          "NEWLINE"
      | Tokens.P ->
          "P"
      | Tokens.ZERO ->
          "ZERO"
  
  let _menhir_fail : unit -> 'a =
    fun () ->
      Printf.eprintf "Internal failure -- please contact the parser generator's developers.\n%!";
      assert false
  
  include struct
    
    [@@@ocaml.warning "-4-37"]
    
    let _menhir_goto_input : type  ttv_stack. ttv_stack -> _ -> _menhir_box_input =
      fun _menhir_stack _v ->
        MenhirBox_input _v
    
    let _menhir_run_35 : type  ttv_stack. (ttv_stack, _menhir_box_input) _menhir_cell1_list_NEWLINE_ -> _ -> _menhir_box_input =
      fun _menhir_stack _v ->
        let MenhirCell1_list_NEWLINE_ (_menhir_stack, _, _) = _menhir_stack in
        let c = _v in
        let _v = _menhir_action_10 c in
        _menhir_goto_input _menhir_stack _v
    
    let _menhir_run_21 : type  ttv_stack. ((ttv_stack, _menhir_box_file) _menhir_cell1_list_NEWLINE_, _menhir_box_file) _menhir_cell1_start -> _ -> _menhir_box_file =
      fun _menhir_stack _v ->
        let MenhirCell1_start (_menhir_stack, _, h) = _menhir_stack in
        let MenhirCell1_list_NEWLINE_ (_menhir_stack, _, _) = _menhir_stack in
        let l = _v in
        let _v = _menhir_action_07 h l in
        MenhirBox_file _v
    
    let rec _menhir_goto_cnf : type  ttv_stack. ttv_stack -> _ -> (ttv_stack, _menhir_box_file) _menhir_state -> _menhir_box_file =
      fun _menhir_stack _v _menhir_s ->
        match _menhir_s with
        | MenhirState09 ->
            _menhir_run_21 _menhir_stack _v
        | MenhirState17 ->
            _menhir_run_18 _menhir_stack _v
        | MenhirState10 ->
            _menhir_run_16 _menhir_stack _v
        | _ ->
            _menhir_fail ()
    
    and _menhir_run_18 : type  ttv_stack. (ttv_stack, _menhir_box_file) _menhir_cell1_clause -> _ -> _menhir_box_file =
      fun _menhir_stack _v ->
        let MenhirCell1_clause (_menhir_stack, _menhir_s, c) = _menhir_stack in
        let l = _v in
        let _v = _menhir_action_06 c l in
        _menhir_goto_cnf _menhir_stack _v _menhir_s
    
    and _menhir_run_16 : type  ttv_stack. (ttv_stack, _menhir_box_file) _menhir_cell1_NEWLINE -> _ -> _menhir_box_file =
      fun _menhir_stack _v ->
        let MenhirCell1_NEWLINE (_menhir_stack, _menhir_s, _) = _menhir_stack in
        let l = _v in
        let _v = _menhir_action_05 l in
        _menhir_goto_cnf _menhir_stack _v _menhir_s
    
    let _menhir_run_12 : type  ttv_stack. ttv_stack -> (ttv_stack, _menhir_box_file) _menhir_state -> _menhir_box_file =
      fun _menhir_stack _menhir_s ->
        let _v = _menhir_action_04 () in
        _menhir_goto_cnf _menhir_stack _v _menhir_s
    
    let rec _menhir_run_11 : type  ttv_stack ttv_result. ttv_stack -> _ -> _ -> _ -> (ttv_stack, ttv_result) _menhir_state -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s ->
        let _startpos = _menhir_lexbuf.Lexing.lex_start_p in
        let _endpos = _menhir_lexbuf.Lexing.lex_curr_p in
        let _tok = _menhir_lexer _menhir_lexbuf in
        let (_endpos_i_, _startpos_i_, i) = (_endpos, _startpos, _v) in
        let _v = _menhir_action_02 _endpos_i_ _startpos_i_ i in
        let _startpos = _startpos_i_ in
        match (_tok : MenhirBasics.token) with
        | Tokens.INT _v_0 ->
            let _menhir_stack = MenhirCell1_atom (_menhir_stack, _menhir_s, _v, _startpos) in
            _menhir_run_11 _menhir_stack _menhir_lexbuf _menhir_lexer _v_0 MenhirState19
        | Tokens.ZERO ->
            let (_startpos_x_, x) = (_startpos, _v) in
            let _v = _menhir_action_13 x in
            _menhir_goto_nonempty_list_atom_ _menhir_stack _menhir_lexbuf _menhir_lexer _startpos_x_ _v _menhir_s
        | _ ->
            _eRR 19
    
    and _menhir_goto_nonempty_list_atom_ : type  ttv_stack ttv_result. ttv_stack -> _ -> _ -> _ -> _ -> (ttv_stack, ttv_result) _menhir_state -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s ->
        match _menhir_s with
        | MenhirState24 ->
            _menhir_run_32 _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s
        | MenhirState19 ->
            _menhir_run_20 _menhir_stack _menhir_lexbuf _menhir_lexer _v
        | MenhirState09 ->
            _menhir_run_13 _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s
        | MenhirState17 ->
            _menhir_run_13 _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s
        | MenhirState10 ->
            _menhir_run_13 _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s
        | _ ->
            _menhir_fail ()
    
    and _menhir_run_32 : type  ttv_stack. ttv_stack -> _ -> _ -> _ -> _ -> (ttv_stack, _menhir_box_input) _menhir_state -> _menhir_box_input =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s ->
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            let _endpos = _menhir_lexbuf.Lexing.lex_curr_p in
            let (_endpos__3_, _startpos_c_, c) = (_endpos, _startpos, _v) in
            let _v = _menhir_action_03 _endpos__3_ _startpos_c_ c in
            _menhir_goto_clause _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | _ ->
            _eRR 33
    
    and _menhir_goto_clause : type  ttv_stack ttv_result. ttv_stack -> _ -> _ -> _ -> (ttv_stack, ttv_result) _menhir_state -> _ -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok ->
        match _menhir_s with
        | MenhirState24 ->
            _menhir_run_35 _menhir_stack _v
        | MenhirState09 ->
            _menhir_run_17 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | MenhirState17 ->
            _menhir_run_17 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | MenhirState10 ->
            _menhir_run_17 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | _ ->
            _menhir_fail ()
    
    and _menhir_run_17 : type  ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_file) _menhir_state -> _ -> _menhir_box_file =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok ->
        let _menhir_stack = MenhirCell1_clause (_menhir_stack, _menhir_s, _v) in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            _menhir_run_10 _menhir_stack _menhir_lexbuf _menhir_lexer MenhirState17
        | Tokens.INT _v_0 ->
            _menhir_run_11 _menhir_stack _menhir_lexbuf _menhir_lexer _v_0 MenhirState17
        | Tokens.EOF ->
            _menhir_run_12 _menhir_stack MenhirState17
        | _ ->
            _eRR 17
    
    and _menhir_run_10 : type  ttv_stack. ttv_stack -> _ -> _ -> (ttv_stack, _menhir_box_file) _menhir_state -> _menhir_box_file =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s ->
        let _endpos = _menhir_lexbuf.Lexing.lex_curr_p in
        let _menhir_stack = MenhirCell1_NEWLINE (_menhir_stack, _menhir_s, _endpos) in
        let _menhir_s = MenhirState10 in
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            _menhir_run_10 _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s
        | Tokens.INT _v ->
            _menhir_run_11 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s
        | Tokens.EOF ->
            _menhir_run_12 _menhir_stack _menhir_s
        | _ ->
            _eRR 10
    
    and _menhir_run_20 : type  ttv_stack ttv_result. (ttv_stack, ttv_result) _menhir_cell1_atom -> _ -> _ -> _ -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v ->
        let MenhirCell1_atom (_menhir_stack, _menhir_s, x, _startpos_x_) = _menhir_stack in
        let xs = _v in
        let _v = _menhir_action_14 x xs in
        _menhir_goto_nonempty_list_atom_ _menhir_stack _menhir_lexbuf _menhir_lexer _startpos_x_ _v _menhir_s
    
    and _menhir_run_13 : type  ttv_stack. ttv_stack -> _ -> _ -> _ -> _ -> (ttv_stack, _menhir_box_file) _menhir_state -> _menhir_box_file =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _startpos _v _menhir_s ->
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            let _endpos = _menhir_lexbuf.Lexing.lex_curr_p in
            let _tok = _menhir_lexer _menhir_lexbuf in
            let (_endpos__3_, _startpos_c_, c) = (_endpos, _startpos, _v) in
            let _v = _menhir_action_03 _endpos__3_ _startpos_c_ c in
            _menhir_goto_clause _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | _ ->
            _eRR 14
    
    let _menhir_run_24 : type  ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_input) _menhir_state -> _ -> _menhir_box_input =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok ->
        match (_tok : MenhirBasics.token) with
        | Tokens.P ->
            let _menhir_stack = MenhirCell1_list_NEWLINE_ (_menhir_stack, _menhir_s, _v) in
            let _startpos = _menhir_lexbuf.Lexing.lex_start_p in
            let _tok = _menhir_lexer _menhir_lexbuf in
            (match (_tok : MenhirBasics.token) with
            | Tokens.CNF ->
                let _tok = _menhir_lexer _menhir_lexbuf in
                (match (_tok : MenhirBasics.token) with
                | Tokens.INT _v_0 ->
                    let _tok = _menhir_lexer _menhir_lexbuf in
                    (match (_tok : MenhirBasics.token) with
                    | Tokens.INT _v_2 ->
                        let _tok = _menhir_lexer _menhir_lexbuf in
                        (match (_tok : MenhirBasics.token) with
                        | Tokens.NEWLINE ->
                            let _endpos_5 = _menhir_lexbuf.Lexing.lex_curr_p in
                            let _v_6 =
                              let (_startpos__1_, _endpos__5_, nbclause, nbvar) = (_startpos, _endpos_5, _v_2, _v_0) in
                              _menhir_action_15 _endpos__5_ _startpos__1_ nbclause nbvar
                            in
                            let _v = _v_6 in
                            let MenhirCell1_list_NEWLINE_ (_menhir_stack, _, _) = _menhir_stack in
                            let s = _v in
                            let _v = _menhir_action_09 s in
                            _menhir_goto_input _menhir_stack _v
                        | _ ->
                            _eRR 28)
                    | _ ->
                        _eRR 27)
                | _ ->
                    _eRR 26)
            | _ ->
                _eRR 25)
        | Tokens.INT _v_7 ->
            let _menhir_stack = MenhirCell1_list_NEWLINE_ (_menhir_stack, _menhir_s, _v) in
            _menhir_run_11 _menhir_stack _menhir_lexbuf _menhir_lexer _v_7 MenhirState24
        | Tokens.EOF ->
            let _v = _menhir_action_08 () in
            _menhir_goto_input _menhir_stack _v
        | _ ->
            _menhir_fail ()
    
    let _menhir_run_03 : type  ttv_stack. ttv_stack -> _ -> _ -> _ -> (ttv_stack, _menhir_box_file) _menhir_state -> _ -> _menhir_box_file =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok ->
        let _menhir_stack = MenhirCell1_list_NEWLINE_ (_menhir_stack, _menhir_s, _v) in
        match (_tok : MenhirBasics.token) with
        | Tokens.P ->
            let _startpos = _menhir_lexbuf.Lexing.lex_start_p in
            let _tok = _menhir_lexer _menhir_lexbuf in
            (match (_tok : MenhirBasics.token) with
            | Tokens.CNF ->
                let _tok = _menhir_lexer _menhir_lexbuf in
                (match (_tok : MenhirBasics.token) with
                | Tokens.INT _v_0 ->
                    let _tok = _menhir_lexer _menhir_lexbuf in
                    (match (_tok : MenhirBasics.token) with
                    | Tokens.INT _v_2 ->
                        let _tok = _menhir_lexer _menhir_lexbuf in
                        (match (_tok : MenhirBasics.token) with
                        | Tokens.NEWLINE ->
                            let _endpos_5 = _menhir_lexbuf.Lexing.lex_curr_p in
                            let _tok = _menhir_lexer _menhir_lexbuf in
                            let _v_6 =
                              let (_startpos__1_, _endpos__5_, nbclause, nbvar) = (_startpos, _endpos_5, _v_2, _v_0) in
                              _menhir_action_15 _endpos__5_ _startpos__1_ nbclause nbvar
                            in
                            let (_v, _menhir_s) = (_v_6, MenhirState03) in
                            let _menhir_stack = MenhirCell1_start (_menhir_stack, _menhir_s, _v) in
                            (match (_tok : MenhirBasics.token) with
                            | Tokens.NEWLINE ->
                                _menhir_run_10 _menhir_stack _menhir_lexbuf _menhir_lexer MenhirState09
                            | Tokens.INT _v_0 ->
                                _menhir_run_11 _menhir_stack _menhir_lexbuf _menhir_lexer _v_0 MenhirState09
                            | Tokens.EOF ->
                                _menhir_run_12 _menhir_stack MenhirState09
                            | _ ->
                                _eRR 9)
                        | _ ->
                            _eRR 7)
                    | _ ->
                        _eRR 6)
                | _ ->
                    _eRR 5)
            | _ ->
                _eRR 4)
        | _ ->
            _eRR 3
    
    let rec _menhir_run_02 : type  ttv_stack ttv_result. (ttv_stack, ttv_result) _menhir_cell1_NEWLINE -> _ -> _ -> _ -> _ -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok ->
        let MenhirCell1_NEWLINE (_menhir_stack, _menhir_s, _) = _menhir_stack in
        let (xs, x) = (_v, ()) in
        let _v = _menhir_action_12 x xs in
        _menhir_goto_list_NEWLINE_ _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
    
    and _menhir_goto_list_NEWLINE_ : type  ttv_stack ttv_result. ttv_stack -> _ -> _ -> _ -> (ttv_stack, ttv_result) _menhir_state -> _ -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok ->
        match _menhir_s with
        | MenhirState23 ->
            _menhir_run_24 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | MenhirState00 ->
            _menhir_run_03 _menhir_stack _menhir_lexbuf _menhir_lexer _v _menhir_s _tok
        | MenhirState01 ->
            _menhir_run_02 _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok
        | _ ->
            _menhir_fail ()
    
    let rec _menhir_run_01 : type  ttv_stack ttv_result. ttv_stack -> _ -> _ -> (ttv_stack, ttv_result) _menhir_state -> ttv_result =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer _menhir_s ->
        let _endpos = _menhir_lexbuf.Lexing.lex_curr_p in
        let _menhir_stack = MenhirCell1_NEWLINE (_menhir_stack, _menhir_s, _endpos) in
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            _menhir_run_01 _menhir_stack _menhir_lexbuf _menhir_lexer MenhirState01
        | Tokens.EOF | Tokens.INT _ | Tokens.P ->
            let _v = _menhir_action_11 () in
            _menhir_run_02 _menhir_stack _menhir_lexbuf _menhir_lexer _v _tok
        | _ ->
            _eRR 1
    
    let _menhir_run_00 : type  ttv_stack. ttv_stack -> _ -> _ -> _menhir_box_file =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer ->
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            _menhir_run_01 _menhir_stack _menhir_lexbuf _menhir_lexer MenhirState00
        | Tokens.P ->
            let _v = _menhir_action_11 () in
            _menhir_run_03 _menhir_stack _menhir_lexbuf _menhir_lexer _v MenhirState00 _tok
        | _ ->
            _eRR 0
    
    let _menhir_run_23 : type  ttv_stack. ttv_stack -> _ -> _ -> _menhir_box_input =
      fun _menhir_stack _menhir_lexbuf _menhir_lexer ->
        let _tok = _menhir_lexer _menhir_lexbuf in
        match (_tok : MenhirBasics.token) with
        | Tokens.NEWLINE ->
            _menhir_run_01 _menhir_stack _menhir_lexbuf _menhir_lexer MenhirState23
        | Tokens.EOF | Tokens.INT _ | Tokens.P ->
            let _v = _menhir_action_11 () in
            _menhir_run_24 _menhir_stack _menhir_lexbuf _menhir_lexer _v MenhirState23 _tok
        | _ ->
            _eRR 23
    
  end
  
  let input =
    fun _menhir_lexer _menhir_lexbuf ->
      let _menhir_stack = () in
      let MenhirBox_input v = _menhir_run_23 _menhir_stack _menhir_lexbuf _menhir_lexer in
      v
  
  let file =
    fun _menhir_lexer _menhir_lexbuf ->
      let _menhir_stack = () in
      let MenhirBox_file v = _menhir_run_00 _menhir_stack _menhir_lexbuf _menhir_lexer in
      v
  
end
OCaml

Innovation. Community. Security.