]> git.saurik.com Git - cycript.git/blob - Replace.hpp
Forgot the new JavaScriptCore.cpp from earlier commit.
[cycript.git] / Replace.hpp
1 #ifndef REPLACE_HPP
2 #define REPLACE_HPP
3
4 #include "Parser.hpp"
5
6 #define $ \
7 new(context.pool_)
8
9 #define $D(args...) \
10 ($ CYNumber(args))
11 #define $E(args...) \
12 ($ CYExpress(args))
13 #define $F(args...) \
14 ($ CYFunctionExpression(args))
15 #define $I(args...) \
16 ($ CYIdentifier(args))
17 #define $M(args...) \
18 ($ CYDirectMember(args))
19 #define $P(args...) \
20 ($ CYFunctionParameter(args))
21 #define $S(args...) \
22 ($ CYString(args))
23 #define $V(name) \
24 ($ CYVariable($I(name)))
25
26 #define $T(value) \
27 if (this == NULL) \
28 return value;
29 #define $$ \
30 CYStatements()
31
32 #define $P1(arg0, args...) \
33 $P($I(arg0), ##args)
34 #define $P2(arg0, arg1, args...) \
35 $P($I(arg0), $P1(arg1, ##args))
36 #define $P3(arg0, arg1, arg2, args...) \
37 $P($I(arg0), $P2(arg1, arg2, ##args))
38 #define $P4(arg0, arg1, arg2, arg3, args...) \
39 $P($I(arg0), $P3(arg1, arg2, arg3, ##args))
40 #define $P5(arg0, arg1, arg2, arg3, arg4, args...) \
41 $P($I(arg0), $P4(arg1, arg2, arg3, arg4, ##args))
42 #define $P6(arg0, arg1, arg2, arg3, arg4, arg5, args...) \
43 $P($I(arg0), $P5(arg1, arg2, arg3, arg4, arg5, ##args))
44
45 #define $C(args...) \
46 ($ CYCall(args))
47 #define $C_(args...) \
48 ($ CYArgument(args))
49 #define $N(args...) \
50 ($ CYNew(args))
51
52 #define $C1_(arg0, args...) \
53 $C_(arg0, ##args)
54 #define $C2_(arg0, arg1, args...) \
55 $C_(arg0, $C1_(arg1, ##args))
56 #define $C3_(arg0, arg1, arg2, args...) \
57 $C_(arg0, $C2_(arg1, arg2, ##args))
58 #define $C4_(arg0, arg1, arg2, arg3, args...) \
59 $C_(arg0, $C3_(arg1, arg2, arg3, ##args))
60 #define $C5_(arg0, arg1, arg2, arg3, arg4, args...) \
61 $C_(arg0, $C4_(arg1, arg2, arg3, arg4, ##args))
62 #define $C6_(arg0, arg1, arg2, arg3, arg4, arg5, args...) \
63 $C_(arg0, $C5_(arg1, arg2, arg3, arg4, arg5, ##args))
64
65 #define $C0(func, args...) \
66 $C(func, ##args)
67 #define $C1(func, args...) \
68 $C(func, $C1_(args))
69 #define $C2(func, args...) \
70 $C(func, $C2_(args))
71 #define $C3(func, args...) \
72 $C(func, $C3_(args))
73 #define $C4(func, args...) \
74 $C(func, $C4_(args))
75 #define $C5(func, args...) \
76 $C(func, $C5_(args))
77
78 #define $N0(func, args...) \
79 $N(func, ##args)
80 #define $N1(func, args...) \
81 $N(func, $C1_(args))
82 #define $N2(func, args...) \
83 $N(func, $C2_(args))
84 #define $N3(func, args...) \
85 $N(func, $C3_(args))
86 #define $N4(func, args...) \
87 $N(func, $C4_(args))
88 #define $N5(func, args...) \
89 $N(func, $C5_(args))
90
91 #endif/*REPLACE_HPP*/