1 : #include <aterm2.h>
2 : #ifdef __cplusplus
3 : namespace nix {
4 : #endif
5 :
6 :
7 : extern AFun symPos;
8 :
9 : static inline Pos makePos(ATerm e1, int e2, int e3) __attribute__ ((pure, nothrow));
10 842 : static inline Pos makePos(ATerm e1, int e2, int e3) {
11 842 : return (ATerm) ATmakeAppl3(symPos, e1, (ATerm) ATmakeInt(e2), (ATerm) ATmakeInt(e3));
12 : }
13 :
14 : #ifdef __cplusplus
15 19 : static inline bool matchPos(ATerm e, ATerm & e1, int & e2, int & e3) {
16 19 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPos) return false;
17 19 : e1 = ATgetArgument(e, 0);
18 19 : if (ATgetType(e1) != AT_APPL) return false;
19 19 : e2 = ATgetInt((ATermInt) ATgetArgument(e, 1));
20 19 : e3 = ATgetInt((ATermInt) ATgetArgument(e, 2));
21 19 : return true;
22 : }
23 : #endif
24 :
25 :
26 : extern AFun symNoPos;
27 :
28 : extern ATerm constNoPos;
29 :
30 : static inline Pos makeNoPos() __attribute__ ((pure, nothrow));
31 1030 : static inline Pos makeNoPos() {
32 1030 : return constNoPos;
33 : }
34 :
35 : #ifdef __cplusplus
36 21 : static inline bool matchNoPos(ATerm e) {
37 21 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNoPos) return false;
38 2 : return true;
39 : }
40 : #endif
41 :
42 :
43 : extern AFun symFunction;
44 :
45 : static inline Expr makeFunction(ATermList e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
46 53 : static inline Expr makeFunction(ATermList e1, Expr e2, Pos e3) {
47 53 : return (ATerm) ATmakeAppl3(symFunction, (ATerm) e1, e2, e3);
48 : }
49 :
50 : #ifdef __cplusplus
51 39248 : static inline bool matchFunction(ATerm e, ATermList & e1, Expr & e2, Pos & e3) {
52 39248 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFunction) return false;
53 150 : e1 = (ATermList) ATgetArgument(e, 0);
54 150 : e2 = ATgetArgument(e, 1);
55 150 : e3 = ATgetArgument(e, 2);
56 150 : return true;
57 : }
58 : #endif
59 :
60 :
61 : extern AFun symFunction1;
62 :
63 : static inline Expr makeFunction1(ATerm e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
64 472 : static inline Expr makeFunction1(ATerm e1, Expr e2, Pos e3) {
65 472 : return (ATerm) ATmakeAppl3(symFunction1, e1, e2, e3);
66 : }
67 :
68 : #ifdef __cplusplus
69 28876 : static inline bool matchFunction1(ATerm e, ATerm & e1, Expr & e2, Pos & e3) {
70 28876 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFunction1) return false;
71 1055 : e1 = ATgetArgument(e, 0);
72 1055 : if (ATgetType(e1) != AT_APPL) return false;
73 1055 : e2 = ATgetArgument(e, 1);
74 1055 : e3 = ATgetArgument(e, 2);
75 1055 : return true;
76 : }
77 : #endif
78 :
79 :
80 : extern AFun symAssert;
81 :
82 : static inline Expr makeAssert(Expr e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
83 22 : static inline Expr makeAssert(Expr e1, Expr e2, Pos e3) {
84 22 : return (ATerm) ATmakeAppl3(symAssert, e1, e2, e3);
85 : }
86 :
87 : #ifdef __cplusplus
88 313 : static inline bool matchAssert(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
89 313 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAssert) return false;
90 15 : e1 = ATgetArgument(e, 0);
91 15 : e2 = ATgetArgument(e, 1);
92 15 : e3 = ATgetArgument(e, 2);
93 15 : return true;
94 : }
95 : #endif
96 :
97 :
98 : extern AFun symWith;
99 :
100 : static inline Expr makeWith(Expr e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
101 5 : static inline Expr makeWith(Expr e1, Expr e2, Pos e3) {
102 5 : return (ATerm) ATmakeAppl3(symWith, e1, e2, e3);
103 : }
104 :
105 : #ifdef __cplusplus
106 6702 : static inline bool matchWith(ATerm e, Expr & e1, Expr & e2, Pos & e3) {
107 6702 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symWith) return false;
108 11 : e1 = ATgetArgument(e, 0);
109 11 : e2 = ATgetArgument(e, 1);
110 11 : e3 = ATgetArgument(e, 2);
111 11 : return true;
112 : }
113 : #endif
114 :
115 :
116 : extern AFun symIf;
117 :
118 : static inline Expr makeIf(Expr e1, Expr e2, Expr e3) __attribute__ ((pure, nothrow));
119 27 : static inline Expr makeIf(Expr e1, Expr e2, Expr e3) {
120 27 : return (ATerm) ATmakeAppl3(symIf, e1, e2, e3);
121 : }
122 :
123 : #ifdef __cplusplus
124 466 : static inline bool matchIf(ATerm e, Expr & e1, Expr & e2, Expr & e3) {
125 466 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symIf) return false;
126 153 : e1 = ATgetArgument(e, 0);
127 153 : e2 = ATgetArgument(e, 1);
128 153 : e3 = ATgetArgument(e, 2);
129 153 : return true;
130 : }
131 : #endif
132 :
133 :
134 : extern AFun symOpNot;
135 :
136 : static inline Expr makeOpNot(Expr e1) __attribute__ ((pure, nothrow));
137 3 : static inline Expr makeOpNot(Expr e1) {
138 3 : return (ATerm) ATmakeAppl1(symOpNot, e1);
139 : }
140 :
141 : #ifdef __cplusplus
142 199 : static inline bool matchOpNot(ATerm e, Expr & e1) {
143 199 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpNot) return false;
144 3 : e1 = ATgetArgument(e, 0);
145 3 : return true;
146 : }
147 : #endif
148 :
149 :
150 : extern AFun symOpEq;
151 :
152 : static inline Expr makeOpEq(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
153 17 : static inline Expr makeOpEq(Expr e1, Expr e2) {
154 17 : return (ATerm) ATmakeAppl2(symOpEq, e1, e2);
155 : }
156 :
157 : #ifdef __cplusplus
158 293 : static inline bool matchOpEq(ATerm e, Expr & e1, Expr & e2) {
159 293 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpEq) return false;
160 93 : e1 = ATgetArgument(e, 0);
161 93 : e2 = ATgetArgument(e, 1);
162 93 : return true;
163 : }
164 : #endif
165 :
166 :
167 : extern AFun symOpNEq;
168 :
169 : static inline Expr makeOpNEq(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
170 8 : static inline Expr makeOpNEq(Expr e1, Expr e2) {
171 8 : return (ATerm) ATmakeAppl2(symOpNEq, e1, e2);
172 : }
173 :
174 : #ifdef __cplusplus
175 200 : static inline bool matchOpNEq(ATerm e, Expr & e1, Expr & e2) {
176 200 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpNEq) return false;
177 1 : e1 = ATgetArgument(e, 0);
178 1 : e2 = ATgetArgument(e, 1);
179 1 : return true;
180 : }
181 : #endif
182 :
183 :
184 : extern AFun symOpAnd;
185 :
186 : static inline Expr makeOpAnd(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
187 7 : static inline Expr makeOpAnd(Expr e1, Expr e2) {
188 7 : return (ATerm) ATmakeAppl2(symOpAnd, e1, e2);
189 : }
190 :
191 : #ifdef __cplusplus
192 195 : static inline bool matchOpAnd(ATerm e, Expr & e1, Expr & e2) {
193 195 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpAnd) return false;
194 3 : e1 = ATgetArgument(e, 0);
195 3 : e2 = ATgetArgument(e, 1);
196 3 : return true;
197 : }
198 : #endif
199 :
200 :
201 : extern AFun symOpOr;
202 :
203 : static inline Expr makeOpOr(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
204 2 : static inline Expr makeOpOr(Expr e1, Expr e2) {
205 2 : return (ATerm) ATmakeAppl2(symOpOr, e1, e2);
206 : }
207 :
208 : #ifdef __cplusplus
209 192 : static inline bool matchOpOr(ATerm e, Expr & e1, Expr & e2) {
210 192 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpOr) return false;
211 1 : e1 = ATgetArgument(e, 0);
212 1 : e2 = ATgetArgument(e, 1);
213 1 : return true;
214 : }
215 : #endif
216 :
217 :
218 : extern AFun symOpImpl;
219 :
220 : static inline Expr makeOpImpl(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
221 8 : static inline Expr makeOpImpl(Expr e1, Expr e2) {
222 8 : return (ATerm) ATmakeAppl2(symOpImpl, e1, e2);
223 : }
224 :
225 : #ifdef __cplusplus
226 196 : static inline bool matchOpImpl(ATerm e, Expr & e1, Expr & e2) {
227 196 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpImpl) return false;
228 1 : e1 = ATgetArgument(e, 0);
229 1 : e2 = ATgetArgument(e, 1);
230 1 : return true;
231 : }
232 : #endif
233 :
234 :
235 : extern AFun symOpUpdate;
236 :
237 : static inline Expr makeOpUpdate(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
238 13 : static inline Expr makeOpUpdate(Expr e1, Expr e2) {
239 13 : return (ATerm) ATmakeAppl2(symOpUpdate, e1, e2);
240 : }
241 :
242 : #ifdef __cplusplus
243 191 : static inline bool matchOpUpdate(ATerm e, Expr & e1, Expr & e2) {
244 191 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpUpdate) return false;
245 49 : e1 = ATgetArgument(e, 0);
246 49 : e2 = ATgetArgument(e, 1);
247 49 : return true;
248 : }
249 : #endif
250 :
251 :
252 : extern AFun symSubPath;
253 :
254 : static inline Expr makeSubPath(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
255 7 : static inline Expr makeSubPath(Expr e1, Expr e2) {
256 7 : return (ATerm) ATmakeAppl2(symSubPath, e1, e2);
257 : }
258 :
259 : #ifdef __cplusplus
260 69 : static inline bool matchSubPath(ATerm e, Expr & e1, Expr & e2) {
261 69 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symSubPath) return false;
262 7 : e1 = ATgetArgument(e, 0);
263 7 : e2 = ATgetArgument(e, 1);
264 7 : return true;
265 : }
266 : #endif
267 :
268 :
269 : extern AFun symOpHasAttr;
270 :
271 : static inline Expr makeOpHasAttr(Expr e1, ATerm e2) __attribute__ ((pure, nothrow));
272 8 : static inline Expr makeOpHasAttr(Expr e1, ATerm e2) {
273 8 : return (ATerm) ATmakeAppl2(symOpHasAttr, e1, e2);
274 : }
275 :
276 : #ifdef __cplusplus
277 142 : static inline bool matchOpHasAttr(ATerm e, Expr & e1, ATerm & e2) {
278 142 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpHasAttr) return false;
279 8 : e1 = ATgetArgument(e, 0);
280 8 : e2 = ATgetArgument(e, 1);
281 8 : if (ATgetType(e2) != AT_APPL) return false;
282 8 : return true;
283 : }
284 : #endif
285 :
286 :
287 : extern AFun symOpPlus;
288 :
289 : static inline Expr makeOpPlus(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
290 57 : static inline Expr makeOpPlus(Expr e1, Expr e2) {
291 57 : return (ATerm) ATmakeAppl2(symOpPlus, e1, e2);
292 : }
293 :
294 : #ifdef __cplusplus
295 199 : static inline bool matchOpPlus(ATerm e, Expr & e1, Expr & e2) {
296 199 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpPlus) return false;
297 126 : e1 = ATgetArgument(e, 0);
298 126 : e2 = ATgetArgument(e, 1);
299 126 : return true;
300 : }
301 : #endif
302 :
303 :
304 : extern AFun symOpConcat;
305 :
306 : static inline Expr makeOpConcat(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
307 7 : static inline Expr makeOpConcat(Expr e1, Expr e2) {
308 7 : return (ATerm) ATmakeAppl2(symOpConcat, e1, e2);
309 : }
310 :
311 : #ifdef __cplusplus
312 62 : static inline bool matchOpConcat(ATerm e, Expr & e1, Expr & e2) {
313 62 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symOpConcat) return false;
314 62 : e1 = ATgetArgument(e, 0);
315 62 : e2 = ATgetArgument(e, 1);
316 62 : return true;
317 : }
318 : #endif
319 :
320 :
321 : extern AFun symConcatStrings;
322 :
323 : static inline Expr makeConcatStrings(ATermList e1) __attribute__ ((pure, nothrow));
324 2 : static inline Expr makeConcatStrings(ATermList e1) {
325 2 : return (ATerm) ATmakeAppl1(symConcatStrings, (ATerm) e1);
326 : }
327 :
328 : #ifdef __cplusplus
329 71 : static inline bool matchConcatStrings(ATerm e, ATermList & e1) {
330 71 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symConcatStrings) return false;
331 2 : e1 = (ATermList) ATgetArgument(e, 0);
332 2 : return true;
333 : }
334 : #endif
335 :
336 :
337 : extern AFun symCall;
338 :
339 : static inline Expr makeCall(Expr e1, Expr e2) __attribute__ ((pure, nothrow));
340 660 : static inline Expr makeCall(Expr e1, Expr e2) {
341 660 : return (ATerm) ATmakeAppl2(symCall, e1, e2);
342 : }
343 :
344 : #ifdef __cplusplus
345 2077 : static inline bool matchCall(ATerm e, Expr & e1, Expr & e2) {
346 2077 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symCall) return false;
347 1221 : e1 = ATgetArgument(e, 0);
348 1221 : e2 = ATgetArgument(e, 1);
349 1221 : return true;
350 : }
351 : #endif
352 :
353 :
354 : extern AFun symSelect;
355 :
356 : static inline Expr makeSelect(Expr e1, ATerm e2) __attribute__ ((pure, nothrow));
357 578 : static inline Expr makeSelect(Expr e1, ATerm e2) {
358 578 : return (ATerm) ATmakeAppl2(symSelect, e1, e2);
359 : }
360 :
361 : #ifdef __cplusplus
362 856 : static inline bool matchSelect(ATerm e, Expr & e1, ATerm & e2) {
363 856 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symSelect) return false;
364 321 : e1 = ATgetArgument(e, 0);
365 321 : e2 = ATgetArgument(e, 1);
366 321 : if (ATgetType(e2) != AT_APPL) return false;
367 321 : return true;
368 : }
369 : #endif
370 :
371 :
372 : extern AFun symVar;
373 :
374 : static inline Expr makeVar(ATerm e1) __attribute__ ((pure, nothrow));
375 1092 : static inline Expr makeVar(ATerm e1) {
376 1092 : return (ATerm) ATmakeAppl1(symVar, e1);
377 : }
378 :
379 : #ifdef __cplusplus
380 33686 : static inline bool matchVar(ATerm e, ATerm & e1) {
381 33686 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symVar) return false;
382 3193 : e1 = ATgetArgument(e, 0);
383 3193 : if (ATgetType(e1) != AT_APPL) return false;
384 3193 : return true;
385 : }
386 : #endif
387 :
388 :
389 : extern AFun symInt;
390 :
391 : static inline Expr makeInt(int e1) __attribute__ ((pure, nothrow));
392 157 : static inline Expr makeInt(int e1) {
393 157 : return (ATerm) ATmakeAppl1(symInt, (ATerm) ATmakeInt(e1));
394 : }
395 :
396 : #ifdef __cplusplus
397 482 : static inline bool matchInt(ATerm e, int & e1) {
398 482 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symInt) return false;
399 304 : e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
400 304 : return true;
401 : }
402 : #endif
403 :
404 :
405 : extern AFun symStr;
406 :
407 : static inline Expr makeStr(ATerm e1) __attribute__ ((pure, nothrow));
408 991 : static inline Expr makeStr(ATerm e1) {
409 991 : return (ATerm) ATmakeAppl1(symStr, e1);
410 : }
411 :
412 : #ifdef __cplusplus
413 1427 : static inline bool matchStr(ATerm e, ATerm & e1) {
414 1427 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symStr) return false;
415 1216 : e1 = ATgetArgument(e, 0);
416 1216 : if (ATgetType(e1) != AT_APPL) return false;
417 1216 : return true;
418 : }
419 : #endif
420 :
421 :
422 : extern AFun symPath;
423 :
424 : static inline Expr makePath(ATerm e1) __attribute__ ((pure, nothrow));
425 499 : static inline Expr makePath(ATerm e1) {
426 499 : return (ATerm) ATmakeAppl1(symPath, e1);
427 : }
428 :
429 : #ifdef __cplusplus
430 496 : static inline bool matchPath(ATerm e, ATerm & e1) {
431 496 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPath) return false;
432 423 : e1 = ATgetArgument(e, 0);
433 423 : if (ATgetType(e1) != AT_APPL) return false;
434 423 : return true;
435 : }
436 : #endif
437 :
438 :
439 : extern AFun symUri;
440 :
441 : static inline Expr makeUri(ATerm e1) __attribute__ ((pure, nothrow));
442 8 : static inline Expr makeUri(ATerm e1) {
443 8 : return (ATerm) ATmakeAppl1(symUri, e1);
444 : }
445 :
446 : #ifdef __cplusplus
447 210 : static inline bool matchUri(ATerm e, ATerm & e1) {
448 210 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symUri) return false;
449 0 : e1 = ATgetArgument(e, 0);
450 0 : if (ATgetType(e1) != AT_APPL) return false;
451 0 : return true;
452 : }
453 : #endif
454 :
455 :
456 : extern AFun symList;
457 :
458 : static inline Expr makeList(ATermList e1) __attribute__ ((pure, nothrow));
459 293 : static inline Expr makeList(ATermList e1) {
460 293 : return (ATerm) ATmakeAppl1(symList, (ATerm) e1);
461 : }
462 :
463 : #ifdef __cplusplus
464 497 : static inline bool matchList(ATerm e, ATermList & e1) {
465 497 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symList) return false;
466 448 : e1 = (ATermList) ATgetArgument(e, 0);
467 448 : return true;
468 : }
469 : #endif
470 :
471 :
472 : extern AFun symBlackHole;
473 :
474 : extern ATerm constBlackHole;
475 :
476 : static inline Expr makeBlackHole() __attribute__ ((pure, nothrow));
477 6690 : static inline Expr makeBlackHole() {
478 6690 : return constBlackHole;
479 : }
480 :
481 : #ifdef __cplusplus
482 : static inline bool matchBlackHole(ATerm e) {
483 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBlackHole) return false;
484 : return true;
485 : }
486 : #endif
487 :
488 :
489 : extern AFun symUndefined;
490 :
491 : extern ATerm constUndefined;
492 :
493 : static inline Expr makeUndefined() __attribute__ ((pure, nothrow));
494 : static inline Expr makeUndefined() {
495 : return constUndefined;
496 : }
497 :
498 : #ifdef __cplusplus
499 : static inline bool matchUndefined(ATerm e) {
500 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symUndefined) return false;
501 : return true;
502 : }
503 : #endif
504 :
505 :
506 : extern AFun symRemoved;
507 :
508 : extern ATerm constRemoved;
509 :
510 : static inline Expr makeRemoved() __attribute__ ((pure, nothrow));
511 2982 : static inline Expr makeRemoved() {
512 2982 : return constRemoved;
513 : }
514 :
515 : #ifdef __cplusplus
516 : static inline bool matchRemoved(ATerm e) {
517 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symRemoved) return false;
518 : return true;
519 : }
520 : #endif
521 :
522 :
523 : extern AFun symPrimOp;
524 :
525 : static inline Expr makePrimOp(int e1, ATermBlob e2, ATermList e3) __attribute__ ((pure, nothrow));
526 218 : static inline Expr makePrimOp(int e1, ATermBlob e2, ATermList e3) {
527 218 : return (ATerm) ATmakeAppl3(symPrimOp, (ATerm) ATmakeInt(e1), (ATerm) e2, (ATerm) e3);
528 : }
529 :
530 : #ifdef __cplusplus
531 1221 : static inline bool matchPrimOp(ATerm e, int & e1, ATermBlob & e2, ATermList & e3) {
532 1221 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPrimOp) return false;
533 663 : e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
534 663 : e2 = (ATermBlob) ATgetArgument(e, 1);
535 663 : e3 = (ATermList) ATgetArgument(e, 2);
536 663 : return true;
537 : }
538 : #endif
539 :
540 :
541 : extern AFun symAttrs;
542 :
543 : static inline Expr makeAttrs(ATermList e1) __attribute__ ((pure, nothrow));
544 517 : static inline Expr makeAttrs(ATermList e1) {
545 517 : return (ATerm) ATmakeAppl1(symAttrs, (ATerm) e1);
546 : }
547 :
548 : #ifdef __cplusplus
549 11613 : static inline bool matchAttrs(ATerm e, ATermList & e1) {
550 11613 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAttrs) return false;
551 1295 : e1 = (ATermList) ATgetArgument(e, 0);
552 1295 : return true;
553 : }
554 : #endif
555 :
556 :
557 : extern AFun symClosed;
558 :
559 : static inline Expr makeClosed(Expr e1) __attribute__ ((pure, nothrow));
560 1014 : static inline Expr makeClosed(Expr e1) {
561 1014 : return (ATerm) ATmakeAppl1(symClosed, e1);
562 : }
563 :
564 : #ifdef __cplusplus
565 29274 : static inline bool matchClosed(ATerm e, Expr & e1) {
566 29274 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symClosed) return false;
567 1772 : e1 = ATgetArgument(e, 0);
568 1772 : return true;
569 : }
570 : #endif
571 :
572 :
573 : extern AFun symRec;
574 :
575 : static inline Expr makeRec(ATermList e1, ATermList e2) __attribute__ ((pure, nothrow));
576 94 : static inline Expr makeRec(ATermList e1, ATermList e2) {
577 94 : return (ATerm) ATmakeAppl2(symRec, (ATerm) e1, (ATerm) e2);
578 : }
579 :
580 : #ifdef __cplusplus
581 38537 : static inline bool matchRec(ATerm e, ATermList & e1, ATermList & e2) {
582 38537 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symRec) return false;
583 215 : e1 = (ATermList) ATgetArgument(e, 0);
584 215 : e2 = (ATermList) ATgetArgument(e, 1);
585 215 : return true;
586 : }
587 : #endif
588 :
589 :
590 : extern AFun symBool;
591 :
592 : static inline Expr makeBool(ATerm e1) __attribute__ ((pure, nothrow));
593 236 : static inline Expr makeBool(ATerm e1) {
594 236 : return (ATerm) ATmakeAppl1(symBool, e1);
595 : }
596 :
597 : #ifdef __cplusplus
598 0 : static inline bool matchBool(ATerm e, ATerm & e1) {
599 0 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBool) return false;
600 0 : e1 = ATgetArgument(e, 0);
601 0 : return true;
602 : }
603 : #endif
604 :
605 :
606 : extern AFun symNull;
607 :
608 : extern ATerm constNull;
609 :
610 : static inline Expr makeNull() __attribute__ ((pure, nothrow));
611 0 : static inline Expr makeNull() {
612 0 : return constNull;
613 : }
614 :
615 : #ifdef __cplusplus
616 180 : static inline bool matchNull(ATerm e) {
617 180 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNull) return false;
618 0 : return true;
619 : }
620 : #endif
621 :
622 :
623 : extern AFun symContext;
624 :
625 : static inline Expr makeContext(ATermList e1, Expr e2) __attribute__ ((pure, nothrow));
626 7 : static inline Expr makeContext(ATermList e1, Expr e2) {
627 7 : return (ATerm) ATmakeAppl2(symContext, (ATerm) e1, e2);
628 : }
629 :
630 : #ifdef __cplusplus
631 860 : static inline bool matchContext(ATerm e, ATermList & e1, Expr & e2) {
632 860 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symContext) return false;
633 7 : e1 = (ATermList) ATgetArgument(e, 0);
634 7 : e2 = ATgetArgument(e, 1);
635 7 : return true;
636 : }
637 : #endif
638 :
639 :
640 : extern AFun symBind;
641 :
642 : static inline ATerm makeBind(ATerm e1, Expr e2, Pos e3) __attribute__ ((pure, nothrow));
643 3237 : static inline ATerm makeBind(ATerm e1, Expr e2, Pos e3) {
644 3237 : return (ATerm) ATmakeAppl3(symBind, e1, e2, e3);
645 : }
646 :
647 : #ifdef __cplusplus
648 7072 : static inline bool matchBind(ATerm e, ATerm & e1, Expr & e2, Pos & e3) {
649 7072 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBind) return false;
650 6186 : e1 = ATgetArgument(e, 0);
651 6186 : if (ATgetType(e1) != AT_APPL) return false;
652 6186 : e2 = ATgetArgument(e, 1);
653 6186 : e3 = ATgetArgument(e, 2);
654 6186 : return true;
655 : }
656 : #endif
657 :
658 :
659 : extern AFun symBind2;
660 :
661 : static inline ATerm makeBind2(ATerm e1, Expr e2) __attribute__ ((pure, nothrow));
662 : static inline ATerm makeBind2(ATerm e1, Expr e2) {
663 : return (ATerm) ATmakeAppl2(symBind2, e1, e2);
664 : }
665 :
666 : #ifdef __cplusplus
667 886 : static inline bool matchBind2(ATerm e, ATerm & e1, Expr & e2) {
668 886 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symBind2) return false;
669 0 : e1 = ATgetArgument(e, 0);
670 0 : if (ATgetType(e1) != AT_APPL) return false;
671 0 : e2 = ATgetArgument(e, 1);
672 0 : return true;
673 : }
674 : #endif
675 :
676 :
677 : extern AFun symInherit;
678 :
679 : static inline ATerm makeInherit(Expr e1, ATermList e2, Pos e3) __attribute__ ((pure, nothrow));
680 29 : static inline ATerm makeInherit(Expr e1, ATermList e2, Pos e3) {
681 29 : return (ATerm) ATmakeAppl3(symInherit, e1, (ATerm) e2, e3);
682 : }
683 :
684 : #ifdef __cplusplus
685 680 : static inline bool matchInherit(ATerm e, Expr & e1, ATermList & e2, Pos & e3) {
686 680 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symInherit) return false;
687 29 : e1 = ATgetArgument(e, 0);
688 29 : e2 = (ATermList) ATgetArgument(e, 1);
689 29 : e3 = ATgetArgument(e, 2);
690 29 : return true;
691 : }
692 : #endif
693 :
694 :
695 : extern AFun symScope;
696 :
697 : extern ATerm constScope;
698 :
699 : static inline Expr makeScope() __attribute__ ((pure, nothrow));
700 26 : static inline Expr makeScope() {
701 26 : return constScope;
702 : }
703 :
704 : #ifdef __cplusplus
705 29 : static inline bool matchScope(ATerm e) {
706 29 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symScope) return false;
707 26 : return true;
708 : }
709 : #endif
710 :
711 :
712 : extern AFun symFormal;
713 :
714 : static inline ATerm makeFormal(ATerm e1, ValidValues e2, DefaultValue e3) __attribute__ ((pure, nothrow));
715 118 : static inline ATerm makeFormal(ATerm e1, ValidValues e2, DefaultValue e3) {
716 118 : return (ATerm) ATmakeAppl3(symFormal, e1, e2, e3);
717 : }
718 :
719 : #ifdef __cplusplus
720 498 : static inline bool matchFormal(ATerm e, ATerm & e1, ValidValues & e2, DefaultValue & e3) {
721 498 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFormal) return false;
722 498 : e1 = ATgetArgument(e, 0);
723 498 : if (ATgetType(e1) != AT_APPL) return false;
724 498 : e2 = ATgetArgument(e, 1);
725 498 : e3 = ATgetArgument(e, 2);
726 498 : return true;
727 : }
728 : #endif
729 :
730 :
731 : extern AFun symValidValues;
732 :
733 : static inline ValidValues makeValidValues(ATermList e1) __attribute__ ((pure, nothrow));
734 7 : static inline ValidValues makeValidValues(ATermList e1) {
735 7 : return (ATerm) ATmakeAppl1(symValidValues, (ATerm) e1);
736 : }
737 :
738 : #ifdef __cplusplus
739 119 : static inline bool matchValidValues(ATerm e, ATermList & e1) {
740 119 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symValidValues) return false;
741 6 : e1 = (ATermList) ATgetArgument(e, 0);
742 6 : return true;
743 : }
744 : #endif
745 :
746 :
747 : extern AFun symUnrestrictedValues;
748 :
749 : extern ATerm constUnrestrictedValues;
750 :
751 : static inline ValidValues makeUnrestrictedValues() __attribute__ ((pure, nothrow));
752 110 : static inline ValidValues makeUnrestrictedValues() {
753 110 : return constUnrestrictedValues;
754 : }
755 :
756 : #ifdef __cplusplus
757 : static inline bool matchUnrestrictedValues(ATerm e) {
758 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symUnrestrictedValues) return false;
759 : return true;
760 : }
761 : #endif
762 :
763 :
764 : extern AFun symDefaultValue;
765 :
766 : static inline DefaultValue makeDefaultValue(Expr e1) __attribute__ ((pure, nothrow));
767 35 : static inline DefaultValue makeDefaultValue(Expr e1) {
768 35 : return (ATerm) ATmakeAppl1(symDefaultValue, e1);
769 : }
770 :
771 : #ifdef __cplusplus
772 43 : static inline bool matchDefaultValue(ATerm e, Expr & e1) {
773 43 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symDefaultValue) return false;
774 42 : e1 = ATgetArgument(e, 0);
775 42 : return true;
776 : }
777 : #endif
778 :
779 :
780 : extern AFun symNoDefaultValue;
781 :
782 : extern ATerm constNoDefaultValue;
783 :
784 : static inline DefaultValue makeNoDefaultValue() __attribute__ ((pure, nothrow));
785 80 : static inline DefaultValue makeNoDefaultValue() {
786 80 : return constNoDefaultValue;
787 : }
788 :
789 : #ifdef __cplusplus
790 : static inline bool matchNoDefaultValue(ATerm e) {
791 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symNoDefaultValue) return false;
792 : return true;
793 : }
794 : #endif
795 :
796 :
797 : extern AFun symTrue;
798 :
799 : extern ATerm constTrue;
800 :
801 : static inline ATerm makeTrue() __attribute__ ((pure, nothrow));
802 118 : static inline ATerm makeTrue() {
803 118 : return constTrue;
804 : }
805 :
806 : #ifdef __cplusplus
807 : static inline bool matchTrue(ATerm e) {
808 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symTrue) return false;
809 : return true;
810 : }
811 : #endif
812 :
813 :
814 : extern AFun symFalse;
815 :
816 : extern ATerm constFalse;
817 :
818 : static inline ATerm makeFalse() __attribute__ ((pure, nothrow));
819 118 : static inline ATerm makeFalse() {
820 118 : return constFalse;
821 : }
822 :
823 : #ifdef __cplusplus
824 : static inline bool matchFalse(ATerm e) {
825 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symFalse) return false;
826 : return true;
827 : }
828 : #endif
829 :
830 :
831 : extern AFun symPrimOpDef;
832 :
833 : static inline ATerm makePrimOpDef(int e1, ATermBlob e2) __attribute__ ((pure, nothrow));
834 3540 : static inline ATerm makePrimOpDef(int e1, ATermBlob e2) {
835 3540 : return (ATerm) ATmakeAppl2(symPrimOpDef, (ATerm) ATmakeInt(e1), (ATerm) e2);
836 : }
837 :
838 : #ifdef __cplusplus
839 128 : static inline bool matchPrimOpDef(ATerm e, int & e1, ATermBlob & e2) {
840 128 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symPrimOpDef) return false;
841 128 : e1 = ATgetInt((ATermInt) ATgetArgument(e, 0));
842 128 : e2 = (ATermBlob) ATgetArgument(e, 1);
843 128 : return true;
844 : }
845 : #endif
846 :
847 :
848 : extern AFun symAttrRHS;
849 :
850 : static inline ATerm makeAttrRHS(Expr e1, Pos e2) __attribute__ ((pure, nothrow));
851 2906 : static inline ATerm makeAttrRHS(Expr e1, Pos e2) {
852 2906 : return (ATerm) ATmakeAppl2(symAttrRHS, e1, e2);
853 : }
854 :
855 : #ifdef __cplusplus
856 2988 : static inline bool matchAttrRHS(ATerm e, Expr & e1, Pos & e2) {
857 2988 : if (ATgetType(e) != AT_APPL || (AFun) ATgetAFun(e) != symAttrRHS) return false;
858 2988 : e1 = ATgetArgument(e, 0);
859 2988 : e2 = ATgetArgument(e, 1);
860 2988 : return true;
861 : }
862 : #endif
863 :
864 :
865 : extern ATerm eTrue;
866 : extern ATerm eFalse;
867 : void initNixExprHelpers();
868 :
869 4438 : static inline const char * aterm2String(ATerm t) {
870 4438 : return (const char *) ATgetName(ATgetAFun(t));
871 : }
872 :
873 : #ifdef __cplusplus
874 : }
875 : #endif
876 :
877 :
|