/
cParser.c
13929 lines (13107 loc) · 660 KB
/
cParser.c
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
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Generated by Cython 0.14.1 on Sun Apr 29 17:27:44 2012 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02040000
#define METH_COEXIST 0
#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
#define PyDict_Contains(d,o) PySequence_Contains(d,o)
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PY_FORMAT_SIZE_T ""
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
#define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
typedef struct {
void *buf;
PyObject *obj;
Py_ssize_t len;
Py_ssize_t itemsize;
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#endif
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
#define PyString_Type PyUnicode_Type
#define PyString_Check PyUnicode_Check
#define PyString_CheckExact PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
#define PyBytesObject PyStringObject
#define PyBytes_Type PyString_Type
#define PyBytes_Check PyString_Check
#define PyBytes_CheckExact PyString_CheckExact
#define PyBytes_FromString PyString_FromString
#define PyBytes_FromStringAndSize PyString_FromStringAndSize
#define PyBytes_FromFormat PyString_FromFormat
#define PyBytes_DecodeEscape PyString_DecodeEscape
#define PyBytes_AsString PyString_AsString
#define PyBytes_AsStringAndSize PyString_AsStringAndSize
#define PyBytes_Size PyString_Size
#define PyBytes_AS_STRING PyString_AS_STRING
#define PyBytes_GET_SIZE PyString_GET_SIZE
#define PyBytes_Repr PyString_Repr
#define PyBytes_Concat PyString_Concat
#define PyBytes_ConcatAndDel PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
#define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
#define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
#define PyInt_FromString PyLong_FromString
#define PyInt_FromUnicode PyLong_FromUnicode
#define PyInt_FromLong PyLong_FromLong
#define PyInt_FromSize_t PyLong_FromSize_t
#define PyInt_FromSsize_t PyLong_FromSsize_t
#define PyInt_AsLong PyLong_AsLong
#define PyInt_AS_LONG PyLong_AS_LONG
#define PyInt_AsSsize_t PyLong_AsSsize_t
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
#define PyBoolObject PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
#define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
#define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
#define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
(PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
(likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
(PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
#else
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
#else
#define __Pyx_NAMESTR(n) (n)
#define __Pyx_DOCSTR(n) (n)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE_API__MACS2__IO__cParser
#include "stdint.h"
#include "stdlib.h"
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
/* inline attribute */
#ifndef CYTHON_INLINE
#if defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char *__pyx_f[] = {
"cParser.pyx",
};
/* Type declarations */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, int);
void (*DECREF)(void*, PyObject*, int);
void (*GOTREF)(void*, PyObject*, int);
void (*GIVEREF)(void*, PyObject*, int);
void* (*SetupContext)(const char*, int, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
void *r = NULL;
m = PyImport_ImportModule((char *)modname);
if (!m) goto end;
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
if (!p) goto end;
r = PyLong_AsVoidPtr(p);
end:
Py_XDECREF(p);
Py_XDECREF(m);
return (__Pyx_RefNannyAPIStruct *)r;
}
#define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
#define __Pyx_RefNannySetupContext(name)
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
#ifndef CYTHON_PROFILE
#define CYTHON_PROFILE 1
#endif
#ifndef CYTHON_PROFILE_REUSE_FRAME
#define CYTHON_PROFILE_REUSE_FRAME 0
#endif
#if CYTHON_PROFILE
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if CYTHON_PROFILE_REUSE_FRAME
#define CYTHON_FRAME_MODIFIER static
#define CYTHON_FRAME_DEL
#else
#define CYTHON_FRAME_MODIFIER
#define CYTHON_FRAME_DEL Py_DECREF(__pyx_frame)
#endif
#define __Pyx_TraceDeclarations \
static PyCodeObject *__pyx_frame_code = NULL; \
CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL; \
int __Pyx_use_tracing = 0;
#define __Pyx_TraceCall(funcname, srcfile, firstlineno) \
if (unlikely(PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc)) { \
__Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, funcname, srcfile, firstlineno); \
}
#define __Pyx_TraceException() \
if (unlikely(__Pyx_use_tracing( && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
PyObject *exc_info = __Pyx_GetExceptionTuple(); \
if (exc_info) { \
PyThreadState_GET()->c_profilefunc( \
PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info); \
Py_DECREF(exc_info); \
} \
}
#define __Pyx_TraceReturn(result) \
if (unlikely(__Pyx_use_tracing) && PyThreadState_GET()->use_tracing && PyThreadState_GET()->c_profilefunc) { \
PyThreadState_GET()->c_profilefunc( \
PyThreadState_GET()->c_profileobj, __pyx_frame, PyTrace_RETURN, (PyObject*)result); \
CYTHON_FRAME_DEL; \
}
static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno); /*proto*/
static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, const char *funcname, const char *srcfile, int firstlineno); /*proto*/
#else
#define __Pyx_TraceDeclarations
#define __Pyx_TraceCall(funcname, srcfile, firstlineno)
#define __Pyx_TraceException()
#define __Pyx_TraceReturn(result)
#endif /* CYTHON_PROFILE */
static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void);
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
if (unlikely(d == Py_None)) {
__Pyx_RaiseNoneIndexingError();
return NULL;
}
value = PyDict_GetItemWithError(d, key);
if (unlikely(!value)) {
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, key);
return NULL;
}
Py_INCREF(value);
return value;
}
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name); /*proto*/
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact); /*proto*/
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */
#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
Py_DECREF(j);
return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_List_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
PyObject *r;
if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
}
else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
}
else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
r = PySequence_GetItem(o, i);
}
else {
r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
return r;
}
static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
PyObject *modname); /*proto*/
#define __pyx_binding_PyCFunctionType_USED 1
typedef struct {
PyCFunctionObject func;
} __pyx_binding_PyCFunctionType_object;
static PyTypeObject __pyx_binding_PyCFunctionType_type;
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;
static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)
static int __pyx_binding_PyCFunctionType_init(void); /* proto */
static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *); /*proto*/
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from libc.stdint */
/* Module declarations from MACS2.IO.cParser */
#define __Pyx_MODULE_NAME "MACS2.IO.cParser"
static int __pyx_module_is_main_MACS2__IO__cParser = 0;
/* Implementation of MACS2.IO.cParser */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_range;
static char __pyx_k_2[] = "Detected format is: %s";
static char __pyx_k_3[] = "* Input file is gzipped.";
static char __pyx_k_5[] = "Can't detect format!";
static char __pyx_k_7[] = "Strand information can not be recognized in this line: \"%s\",\"%s\"";
static char __pyx_k_10[] = " %d";
static char __pyx_k_11[] = "";
static char __pyx_k_15[] = "#";
static char __pyx_k_16[] = "\t";
static char __pyx_k_20[] = "+";
static char __pyx_k_21[] = "-";
static char __pyx_k_26[] = ".fa";
static char __pyx_k_34[] = ":";
static char __pyx_k_43[] = "@";
static char __pyx_k_56[] = "File is not of a valid BAM format! %d";
static char __pyx_k_59[] = "<i";
static char __pyx_k_71[] = "<hh";
static char __pyx_k_81[] = "Something went wrong (average fragment size was negative)";
static char __pyx_k_94[] = "Module for all MACS Parser classes for input.\n\nCopyright (c) 2010,2011 Tao Liu <taoliu@jimmy.harvard.edu>\n\nThis code is free software; you can redistribute it and/or modify it\nunder the terms of the Artistic License (see the file COPYING included\nwith the distribution).\n\n@status: experimental\n@version: $Revision$\n@author: Tao Liu\n@contact: taoliu@jimmy.harvard.edu\n";
static char __pyx_k_95[] = "MACS2.Constants";
static char __pyx_k_96[] = "*";
static char __pyx_k_97[] = "MACS2.IO.cFixWidthTrack";
static char __pyx_k_98[] = "Parser $Revision$";
static char __pyx_k_99[] = "Tao Liu <taoliu@jimmy.harvard.edu>";
static char __pyx_k__F[] = "F";
static char __pyx_k__R[] = "R";
static char __pyx_k__d[] = "d";
static char __pyx_k_100[] = "All Parser classes";
static char __pyx_k_101[] = "MACS2.IO.cParser";
static char __pyx_k_102[] = "Exception about strand format error.\n\n Example:\n raise StrandFormatError('Must be F or R','X')\n ";
static char __pyx_k_103[] = "Generic Parser class.\n\n Inherit this class to write your own parser. In most cases, you need to override:\n\n 1. __tlen_parse_line which returns tag length of a line\n 2. __fw_parse_line which returns tuple of ( chromosome, 5'position, strand )\n ";
static char __pyx_k_104[] = "File Parser Class for tabular File.\n\n ";
static char __pyx_k_105[] = "File Parser Class for ELAND multi File.\n\n Note this parser can only work for s_N_eland_multi.txt format.\n\n Each line of the output file contains the following fields: \n 1. Sequence name \n 2. Sequence \n 3. Either NM, QC, RM (as described above) or the following: \n 4. x:y:z where x, y, and z are the number of exact, single-error, and 2-error matches \n found \n 5. Blank, if no matches found or if too many matches found, or the following: \n BAC_plus_vector.fa:163022R1,170128F2,E_coli.fa:3909847R1 \n This says there are two matches to BAC_plus_vector.fa: one in the reverse direction \n starting at position 160322 with one error, one in the forward direction starting at \n position 170128 with two errors. There is also a single-error match to E_coli.fa.\n ";
static char __pyx_k_106[] = "File Parser Class for ELAND Export File.\n\n ";
static char __pyx_k_107[] = "File Parser Class for SAM File.\n\n Each line of the output file contains at least: \n 1. Sequence name \n 2. Bitwise flag\n 3. Reference name\n 4. 1-based leftmost position fo clipped alignment\n 5. Mapping quality\n 6. CIGAR string\n 7. Mate Reference Name\n 8. 1-based leftmost Mate Position\n 9. Inferred insert size\n 10. Query sequence on the same strand as the reference\n 11. Query quality\n \n The bitwise flag is made like this:\n dec\tmeaning\n ---\t-------\n 1\tpaired read\n 2\tproper pair\n 4\tquery unmapped\n 8\tmate unmapped\n 16\tstrand of the query (1 -> reverse)\n 32\tstrand of the mate\n 64\tfirst read in pair\n 128\tsecond read in pair\n 256\talignment is not primary\n 512\tdoes not pass quality check\n 1024\tPCR or optical duplicate\n ";
static char __pyx_k_108[] = "File Parser Class for BAM File.\n\n File is gzip-compatible and binary.\n Information available is the same that is in SAM format.\n \n The bitwise flag is made like this:\n dec\tmeaning\n ---\t-------\n 1\tpaired read\n 2\tproper pair\n 4\tquery unmapped\n 8\tmate unmapped\n 16\tstrand of the query (1 -> reverse)\n 32\tstrand of the mate\n 64\tfirst read in pair\n 128\tsecond read in pair\n 256\talignment is not primary\n 512\tdoes not pass quality check\n 1024\tPCR or optical duplicate\n ";
static char __pyx_k_109[] = "File Parser Class for BAM File containing paired-end reads\n Only counts valid pairs, discards everything else\n Uses the midpoint of every read and calculates the average fragment size\n on the fly instead of modeling it\n\n File is gzip-compatible and binary.\n Information available is the same that is in SAM format.\n \n The bitwise flag is made like this:\n dec meaning\n --- -------\n 1 paired read\n 2 proper pair\n 4 query unmapped\n 8 mate unmapped\n 16 strand of the query (1 -> reverse)\n 32 strand of the mate\n 64 first read in pair\n 128 second read in pair\n 256 alignment is not primary\n 512 does not pass quality check\n 1024 PCR or optical duplicate\n ";
static char __pyx_k_110[] = "File Parser Class for map files from Bowtie or MAQ's maqview\n program.\n\n ";
static char __pyx_k__U0[] = "U0";
static char __pyx_k__U1[] = "U1";
static char __pyx_k__U2[] = "U2";
static char __pyx_k__io[] = "io";
static char __pyx_k__rb[] = "rb";
static char __pyx_k__BAM[] = "BAM";
static char __pyx_k__BED[] = "BED";
static char __pyx_k__SAM[] = "SAM";
static char __pyx_k__fhd[] = "fhd";
static char __pyx_k__map[] = "map";
static char __pyx_k__sum[] = "sum";
static char __pyx_k__data[] = "data";
static char __pyx_k__gzip[] = "gzip";
static char __pyx_k__info[] = "info";
static char __pyx_k__join[] = "join";
static char __pyx_k__mode[] = "mode";
static char __pyx_k__open[] = "open";
static char __pyx_k__read[] = "read";
static char __pyx_k__seek[] = "seek";
static char __pyx_k__self[] = "self";
static char __pyx_k__tell[] = "tell";
static char __pyx_k__BAMPE[] = "BAMPE";
static char __pyx_k__ELAND[] = "ELAND";
static char __pyx_k__close[] = "close";
static char __pyx_k__error[] = "error";
static char __pyx_k__range[] = "range";
static char __pyx_k__sniff[] = "sniff";
static char __pyx_k__split[] = "split";
static char __pyx_k__track[] = "track";
static char __pyx_k__tsize[] = "tsize";
static char __pyx_k__BOWTIE[] = "BOWTIE";
static char __pyx_k__append[] = "append";
static char __pyx_k__rindex[] = "rindex";
static char __pyx_k__rstrip[] = "rstrip";
static char __pyx_k__strand[] = "strand";
static char __pyx_k__string[] = "string";
static char __pyx_k__struct[] = "struct";
static char __pyx_k__unpack[] = "unpack";
static char __pyx_k__IOError[] = "IOError";
static char __pyx_k____doc__[] = "__doc__";
static char __pyx_k____str__[] = "__str__";
static char __pyx_k__add_loc[] = "add_loc";
static char __pyx_k__browser[] = "browser";
static char __pyx_k__fwtrack[] = "fwtrack";
static char __pyx_k__gzipped[] = "gzipped";
static char __pyx_k__logging[] = "logging";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__filename[] = "filename";
static char __pyx_k__finalize[] = "finalize";
static char __pyx_k__readline[] = "readline";
static char __pyx_k__tag_size[] = "tag_size";
static char __pyx_k__thisline[] = "thisline";
static char __pyx_k__BAMParser[] = "BAMParser";
static char __pyx_k__BEDParser[] = "BEDParser";
static char __pyx_k__Exception[] = "Exception";
static char __pyx_k__SAMParser[] = "SAMParser";
static char __pyx_k__ELANDMULTI[] = "ELANDMULTI";
static char __pyx_k__FWTrackIII[] = "FWTrackIII";
static char __pyx_k__IndexError[] = "IndexError";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k____author__[] = "__author__";
static char __pyx_k__BAMPEParser[] = "BAMPEParser";
static char __pyx_k__ELANDEXPORT[] = "ELANDEXPORT";
static char __pyx_k____version__[] = "__version__";
static char __pyx_k__BowtieParser[] = "BowtieParser";
static char __pyx_k__guess_parser[] = "guess_parser";
static char __pyx_k__GenericParser[] = "GenericParser";
static char __pyx_k__build_fwtrack[] = "build_fwtrack";
static char __pyx_k__BufferedReader[] = "BufferedReader";
static char __pyx_k____build_fwtrack[] = "__build_fwtrack";
static char __pyx_k____fw_parse_line[] = "__fw_parse_line";
static char __pyx_k__ELANDMultiParser[] = "ELANDMultiParser";
static char __pyx_k__ELANDExportParser[] = "ELANDExportParser";
static char __pyx_k__ELANDResultParser[] = "ELANDResultParser";
static char __pyx_k__StrandFormatError[] = "StrandFormatError";
static char __pyx_k____fw_binary_parse[] = "__fw_binary_parse";
static char __pyx_k____tlen_parse_line[] = "__tlen_parse_line";
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_100;
static PyObject *__pyx_n_s_101;
static PyObject *__pyx_kp_s_102;
static PyObject *__pyx_kp_s_103;
static PyObject *__pyx_kp_s_104;
static PyObject *__pyx_kp_s_105;
static PyObject *__pyx_kp_s_106;
static PyObject *__pyx_kp_s_107;
static PyObject *__pyx_kp_s_108;
static PyObject *__pyx_kp_s_109;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_110;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_16;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_26;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_43;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_56;
static PyObject *__pyx_kp_s_59;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_71;
static PyObject *__pyx_kp_s_81;
static PyObject *__pyx_n_s_95;
static PyObject *__pyx_n_s_96;
static PyObject *__pyx_n_s_97;
static PyObject *__pyx_kp_s_98;
static PyObject *__pyx_kp_s_99;
static PyObject *__pyx_n_s__BAM;
static PyObject *__pyx_n_s__BAMPE;
static PyObject *__pyx_n_s__BAMPEParser;
static PyObject *__pyx_n_s__BAMParser;
static PyObject *__pyx_n_s__BED;
static PyObject *__pyx_n_s__BEDParser;
static PyObject *__pyx_n_s__BOWTIE;
static PyObject *__pyx_n_s__BowtieParser;
static PyObject *__pyx_n_s__BufferedReader;
static PyObject *__pyx_n_s__ELAND;
static PyObject *__pyx_n_s__ELANDEXPORT;
static PyObject *__pyx_n_s__ELANDExportParser;
static PyObject *__pyx_n_s__ELANDMULTI;
static PyObject *__pyx_n_s__ELANDMultiParser;
static PyObject *__pyx_n_s__ELANDResultParser;
static PyObject *__pyx_n_s__Exception;
static PyObject *__pyx_n_s__F;
static PyObject *__pyx_n_s__FWTrackIII;
static PyObject *__pyx_n_s__GenericParser;
static PyObject *__pyx_n_s__IOError;
static PyObject *__pyx_n_s__IndexError;
static PyObject *__pyx_n_s__R;
static PyObject *__pyx_n_s__SAM;
static PyObject *__pyx_n_s__SAMParser;
static PyObject *__pyx_n_s__StrandFormatError;
static PyObject *__pyx_n_s__U0;
static PyObject *__pyx_n_s__U1;
static PyObject *__pyx_n_s__U2;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____author__;
static PyObject *__pyx_n_s____build_fwtrack;
static PyObject *__pyx_n_s____doc__;
static PyObject *__pyx_n_s____fw_binary_parse;
static PyObject *__pyx_n_s____fw_parse_line;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____str__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s____tlen_parse_line;
static PyObject *__pyx_n_s____version__;
static PyObject *__pyx_n_s__add_loc;
static PyObject *__pyx_n_s__append;
static PyObject *__pyx_n_s__browser;
static PyObject *__pyx_n_s__build_fwtrack;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__error;
static PyObject *__pyx_n_s__fhd;
static PyObject *__pyx_n_s__filename;
static PyObject *__pyx_n_s__finalize;
static PyObject *__pyx_n_s__fwtrack;
static PyObject *__pyx_n_s__guess_parser;
static PyObject *__pyx_n_s__gzip;
static PyObject *__pyx_n_s__gzipped;
static PyObject *__pyx_n_s__info;
static PyObject *__pyx_n_s__io;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__logging;
static PyObject *__pyx_n_s__map;
static PyObject *__pyx_n_s__mode;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__rb;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__readline;
static PyObject *__pyx_n_s__rindex;
static PyObject *__pyx_n_s__rstrip;
static PyObject *__pyx_n_s__seek;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__sniff;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__strand;
static PyObject *__pyx_n_s__string;
static PyObject *__pyx_n_s__struct;
static PyObject *__pyx_n_s__sum;
static PyObject *__pyx_n_s__tag_size;
static PyObject *__pyx_n_s__tell;
static PyObject *__pyx_n_s__thisline;
static PyObject *__pyx_n_s__track;
static PyObject *__pyx_n_s__tsize;
static PyObject *__pyx_n_s__unpack;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_10;
static PyObject *__pyx_k_tuple_1;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_8;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_tuple_12;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_tuple_14;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_25;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_31;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_33;
static PyObject *__pyx_k_tuple_35;
static PyObject *__pyx_k_tuple_36;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_39;
static PyObject *__pyx_k_tuple_40;
static PyObject *__pyx_k_tuple_41;
static PyObject *__pyx_k_tuple_42;
static PyObject *__pyx_k_tuple_44;
static PyObject *__pyx_k_tuple_45;
static PyObject *__pyx_k_tuple_46;
static PyObject *__pyx_k_tuple_47;
static PyObject *__pyx_k_tuple_48;
static PyObject *__pyx_k_tuple_49;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_51;
static PyObject *__pyx_k_tuple_52;
static PyObject *__pyx_k_tuple_53;
static PyObject *__pyx_k_tuple_54;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_57;
static PyObject *__pyx_k_tuple_58;
static PyObject *__pyx_k_tuple_60;
static PyObject *__pyx_k_tuple_61;
static PyObject *__pyx_k_tuple_62;
static PyObject *__pyx_k_tuple_63;
static PyObject *__pyx_k_tuple_64;
static PyObject *__pyx_k_tuple_65;
static PyObject *__pyx_k_tuple_66;
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_69;
static PyObject *__pyx_k_tuple_70;
static PyObject *__pyx_k_tuple_72;
static PyObject *__pyx_k_tuple_73;
static PyObject *__pyx_k_tuple_74;
static PyObject *__pyx_k_tuple_75;
static PyObject *__pyx_k_tuple_76;
static PyObject *__pyx_k_tuple_77;
static PyObject *__pyx_k_tuple_78;
static PyObject *__pyx_k_tuple_79;
static PyObject *__pyx_k_tuple_80;
static PyObject *__pyx_k_tuple_82;
static PyObject *__pyx_k_tuple_83;
static PyObject *__pyx_k_tuple_84;
static PyObject *__pyx_k_tuple_85;
static PyObject *__pyx_k_tuple_86;
static PyObject *__pyx_k_tuple_87;
static PyObject *__pyx_k_tuple_88;
static PyObject *__pyx_k_tuple_89;
static PyObject *__pyx_k_tuple_90;
static PyObject *__pyx_k_tuple_91;
static PyObject *__pyx_k_tuple_92;
static PyObject *__pyx_k_tuple_93;
/* "MACS2/IO/cParser.pyx":52
* # ------------------------------------
*
* def guess_parser ( fhd ): # <<<<<<<<<<<<<<
* parser_dict = {"BED":BEDParser,
* "ELAND":ELANDResultParser,
*/
static PyObject *__pyx_pf_5MACS2_2IO_7cParser_guess_parser(PyObject *__pyx_self, PyObject *__pyx_v_fhd); /*proto*/
static PyMethodDef __pyx_mdef_5MACS2_2IO_7cParser_guess_parser = {__Pyx_NAMESTR("guess_parser"), (PyCFunction)__pyx_pf_5MACS2_2IO_7cParser_guess_parser, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_5MACS2_2IO_7cParser_guess_parser(PyObject *__pyx_self, PyObject *__pyx_v_fhd) {
PyObject *__pyx_v_parser_dict;
PyObject *__pyx_v_order_list;
PyObject *__pyx_v_f;
PyObject *__pyx_v_p;
PyObject *__pyx_v_s;
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
__Pyx_TraceDeclarations
__Pyx_RefNannySetupContext("guess_parser");
__Pyx_TraceCall("guess_parser", __pyx_f[0], 52);
__pyx_self = __pyx_self;
__pyx_v_parser_dict = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
__pyx_v_order_list = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
__pyx_v_f = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_p = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
/* "MACS2/IO/cParser.pyx":53
*
* def guess_parser ( fhd ):
* parser_dict = {"BED":BEDParser, # <<<<<<<<<<<<<<
* "ELAND":ELANDResultParser,
* "ELANDMULTI":ELANDMultiParser,
*/
__pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__BEDParser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__BED), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "MACS2/IO/cParser.pyx":54
* def guess_parser ( fhd ):
* parser_dict = {"BED":BEDParser,
* "ELAND":ELANDResultParser, # <<<<<<<<<<<<<<
* "ELANDMULTI":ELANDMultiParser,
* "ELANDEXPORT":ELANDExportParser,
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ELANDResultParser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ELAND), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "MACS2/IO/cParser.pyx":55
* parser_dict = {"BED":BEDParser,
* "ELAND":ELANDResultParser,
* "ELANDMULTI":ELANDMultiParser, # <<<<<<<<<<<<<<
* "ELANDEXPORT":ELANDExportParser,
* "SAM":SAMParser,
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ELANDMultiParser); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);