flush
[m6w6/ext-psi] / idl / validator.h
1 /* \aThis file was automatically generated. Do not edit! */
2 #undef INTERFACE
3 typedef struct PSI_Validator PSI_Validator;
4 typedef struct decl_typedefs decl_typedefs;
5 typedef struct decl_typedef decl_typedef;
6 typedef struct decl_type decl_type;
7 typedef int token_t;
8 struct decl_type {
9 char *name;
10 token_t type;
11 struct decl_type *real;
12 };
13 struct decl_typedef {
14 char *alias;
15 decl_type *type;
16 };
17 struct decl_typedefs {
18 size_t count;
19 decl_typedef **list;
20 };
21 typedef struct decls decls;
22 typedef struct decl decl;
23 typedef struct decl_abi decl_abi;
24 struct decl_abi {
25 char *convention;
26 };
27 typedef struct decl_arg decl_arg;
28 typedef struct decl_var decl_var;
29 struct decl_var {
30 char *name;
31 unsigned pointer_level;
32 };
33 struct decl_arg {
34 decl_type *type;
35 decl_var *var;
36 };
37 typedef struct decl_args decl_args;
38 struct decl_args {
39 decl_arg **args;
40 size_t count;
41 };
42 struct decl {
43 decl_abi *abi;
44 decl_arg *func;
45 decl_args *args;
46 void *dlptr;
47 };
48 struct decls {
49 size_t count;
50 decl **list;
51 };
52 typedef struct impls impls;
53 typedef struct impl impl;
54 typedef struct impl_func impl_func;
55 typedef struct impl_args impl_args;
56 typedef struct impl_arg impl_arg;
57 typedef struct impl_type impl_type;
58 struct impl_type {
59 char *name;
60 token_t type;
61 };
62 typedef struct impl_var impl_var;
63 struct impl_var {
64 char *name;
65 unsigned reference:1;
66 };
67 typedef struct impl_def_val impl_def_val;
68 struct impl_def_val {
69 token_t type;
70 union {
71 int64_t digits;
72 double decimals;
73 } v;
74 unsigned is_null:1;
75 };
76 struct impl_arg {
77 impl_type *type;
78 impl_var *var;
79 impl_def_val *def;
80 };
81 struct impl_args {
82 impl_arg **args;
83 size_t count;
84 };
85 struct impl_func {
86 char *name;
87 impl_args *args;
88 impl_type *return_type;
89 };
90 typedef struct impl_stmts impl_stmts;
91 typedef struct impl_stmt impl_stmt;
92 typedef struct let_stmt let_stmt;
93 typedef struct let_value let_value;
94 typedef struct let_func let_func;
95 struct let_func {
96 token_t type;
97 char *name;
98 };
99 struct let_value {
100 let_func *func;
101 impl_var *var;
102 unsigned null_pointer_ref:1;
103 };
104 struct let_stmt {
105 decl_var *var;
106 let_value *val;
107 };
108 typedef struct set_stmt set_stmt;
109 typedef struct set_value set_value;
110 typedef struct set_func set_func;
111 struct set_func {
112 token_t type;
113 char *name;
114 };
115 typedef struct decl_vars decl_vars;
116 struct decl_vars {
117 decl_var **vars;
118 size_t count;
119 };
120 struct set_value {
121 set_func *func;
122 decl_vars *vars;
123 };
124 struct set_stmt {
125 impl_var *var;
126 set_value *val;
127 };
128 typedef struct ret_stmt ret_stmt;
129 struct ret_stmt {
130 set_func *func;
131 decl_var *decl;
132 };
133 struct impl_stmt {
134 token_t type;
135 union {
136 let_stmt *let;
137 set_stmt *set;
138 ret_stmt *ret;
139 void *ptr;
140 } s;
141 };
142 struct impl_stmts {
143 impl_stmt **stmts;
144 size_t count;
145 };
146 struct impl {
147 impl_func *func;
148 impl_stmts *stmts;
149 };
150 struct impls {
151 size_t count;
152 impl **list;
153 };
154 struct PSI_Validator {
155 decl_typedefs *defs;
156 decls *decls;
157 impls *impls;
158 char *lib;
159 char *fn;
160 void *dlopened;
161 };
162 int PSI_ValidatorValidate(PSI_Validator *V);
163 #define PSI_T_NAME 6
164 void PSI_ValidatorFree(PSI_Validator **V);
165 void PSI_ValidatorDtor(PSI_Validator *V);
166 typedef struct PSI_Data PSI_Data;
167 struct PSI_Data {
168 decl_typedefs *defs;
169 decls *decls;
170 impls *impls;
171 char *lib;
172 char *fn;
173 };
174 typedef struct PSI_Lexer PSI_Lexer;
175 #define BSIZE 256
176 struct PSI_Lexer {
177 decl_typedefs *defs;
178 decls *decls;
179 impls *impls;
180 char *lib;
181 char *fn;
182 FILE *fp;
183 size_t line;
184 char *cur, *tok, *lim, *eof, *ctx, *mrk, buf[BSIZE];
185 };
186 PSI_Validator *PSI_ValidatorInit(PSI_Validator *V,PSI_Lexer *L);
187 #define INTERFACE 0