1 /**
2   Mirror _parsetok.h
3   */
4 module deimos.python.parsetok;
5 
6 import core.stdc.stdio;
7 import deimos.python.node;
8 import deimos.python.grammar;
9 
10 extern(C):
11 // Python-header-file: Include/parsetok.h:
12 
13 /* Parser-tokenizer link interface */
14 
15 /// _
16 struct perrdetail{
17     /// _
18     int error;
19     /// _
20     const(char)* filename;
21     /// _
22     int lineno;
23     /// _
24     int offset;
25     /// _
26     char *text;
27     /// _
28     int token;
29     /// _
30     int expected;
31 };
32 
33 /// _
34 enum PyPARSE_DONT_IMPLY_DEDENT	= 0x0002;
35 version(Python_3_0_Or_Later) {
36     /// Availability: 3.*
37     enum PyPARSE_IGNORE_COOKIE = 0x0010;
38     /// Availability: 3.*
39     enum PyPARSE_BARRY_AS_BDFL = 0x0020;
40 }
41 
42 /// _
43 node* PyParser_ParseString(const(char)*, grammar*, int, perrdetail*);
44 /// _
45 node* PyParser_ParseFile (FILE *, const(char)* , grammar *, int,
46                                              char*, char*, perrdetail*);
47 
48 /// _
49 node* PyParser_ParseStringFlags(const(char)* , grammar*, int,
50                                               perrdetail*, int);
51 version(Python_3_0_Or_Later) {
52     /// Availability: 3.*
53     node* PyParser_ParseFileFlags(FILE *, const(char)*,
54             const(char)*, grammar*, perrdetail*, int);
55 }else{
56     /// Availability: 3.*
57     node* PyParser_ParseFileFlags(FILE*, const(char)* , grammar*,
58             int, char*, char*, perrdetail*, int);
59 }
60 
61 version(Python_3_0_Or_Later) {
62     /// Availability: 3.*
63     node* PyParser_ParseFileFlagsEx(
64             FILE* fp,
65             const(char)* filename,       
66             const(char)* enc,
67             grammar* g,
68             int start,
69             char* ps1,
70             char* ps2,
71             perrdetail* err_ret,
72             int* flags);
73 }else version(Python_2_6_Or_Later) {
74     /// Availability: 2.*
75     node* PyParser_ParseFileFlagsEx(
76             FILE* fp, 
77             const(char)* filename, 
78             grammar* g,
79             int start, 
80             char* ps1, 
81             char* ps2,
82             perrdetail* err_ret, 
83             int* flags);
84 }
85 
86 /// _
87 node* PyParser_ParseStringFlagsFilename(const(char)* ,
88 					      const(char)* ,
89 					      grammar*, int,
90                                               perrdetail*, int);
91 version(Python_2_6_Or_Later) {
92     /// Availability: >= 2.6
93     node* PyParser_ParseStringFlagsFilenameEx(
94             const(char)* s,
95             const(char)* filename,       
96             grammar* g,
97             int start,
98             perrdetail* err_ret,
99             int* flags);
100 }
101 
102 /// _
103 void PyParser_SetError(perrdetail*);
104