1expr(Data,string,global_replace_in_string(Str1,To_replace1,Replacement1)) -->
2 global_replace_in_string_(Data,[
3 parentheses_expr(Data,string,Str1),
4 parentheses_expr(Data,string,To_replace1),
5 parentheses_expr(Data,string,Replacement1)
6 ]).
7expr(Data,[array,Type],sort(List)) -->
8 sort_(Data,[
9 parentheses_expr(Data,[array,Type],List)
10 ]).
11
12expr(Data,bool,type_is_string(Object)) -->
13 type_is_string(Data,[
14 parentheses_expr(Data,Type,Object)
15 ]).
16
17expr(Data,bool,type_is_bool(Object)) -->
18 type_is_bool(Data,[
19 parentheses_expr(Data,Type,Object)
20 ]).
21
22
23expr(Data,bool,type_is_list(Object)) -->
24 type_is_list(Data,[
25 parentheses_expr(Data,Type,Object)
26 ]).
27
28dot_expr(Data,double,random_from_list(List,Type)) -->
29 random_from_list(Data,[
30 expr(Data,[array,Type],List)
31 ]).
32
33
34
35expr(Data,bool, or(Var1,Var2)) -->
36 or_(Data,[
37 dot_expr(Data,bool,Var1),
38 expr(Data,bool,Var2)
39 ]).
40expr(Data,bool, eager_or(Var1,Var2)) -->
41 eager_or_(Data,[
42 dot_expr(Data,bool,Var1),
43 expr(Data,bool,Var2)
44 ]).
45expr(Data,int,last_index_of(Str1,Str2)) -->
46 last_index_of_(Data,[
47 parentheses_expr(Data,string,Str1),
48 parentheses_expr(Data,string,Str2)
49 ]).
50expr(Data,int,index_of_substring(Str1,Str2)) -->
51 index_of_substring_(Data,[
52 parentheses_expr(Data,string,Str1),
53 parentheses_expr(Data,string,Str2)
54 ]).
55expr(Data,int,index_in_array(Container,Contained,Type)) -->
56 index_in_array_(Data,[
57 parentheses_expr(Data,[array,Type],Container),
58 parentheses_expr(Data,Type,Contained)
59 ]).
60expr(Data,string,substring(Str_,Index1_,Index2_)) -->
61 substring_(Data,[
62 parentheses_expr(Data,string,Str_),
63 parentheses_expr(Data,int,Index1_),
64 parentheses_expr(Data,int,Index2_)
65 ]).
66expr(Data,bool,not(A1)) -->
67 not_(Data,[
68 parentheses_expr(Data,bool,A1)
69 ]).
70expr(Data,bool, and(A,B)) -->
71 and_(Data,[
72 dot_expr(Data,bool,A),
73 expr(Data,bool,B)
74 ]).
75
76expr(Data,bool, eager_and(A,B)) -->
77 eager_and_(Data,[
78 dot_expr(Data,bool,A),
79 expr(Data,bool,B)
80 ]).
81expr(Data,bool,int_not_equal(A,B)) -->
82 int_not_equal_(Data,[
83 dot_expr(Data,int,A),
84 expr(Data,int,B)
85 ]).
86expr(Data,bool,string_not_equal(A,B)) -->
87 string_not_equal_(Data,[
88 dot_expr(Data,string,A),
89 expr(Data,string,B)
90 ]).
91expr(Data,bool,greater_than(int,A,B)) -->
92 greater_than_(Data,[
93 expr(Data,int,A),
94 dot_expr(Data,int,B)
95 ]).
96
104
105expr(Data,bool,greater_than(double,A,B)) -->
106 greater_than_(Data,[
107 expr(Data,double,A),
108 dot_expr(Data,double,B)
109 ]).
110
111expr(Data,bool,greater_than_or_equal(A,B)) -->
112 greater_than_or_equal_to_(Data,[
113 expr(Data,int,A),
114 dot_expr(Data,int,B)
115 ]).
116expr(Data,bool,less_than_or_equal(A,B)) -->
117 less_than_or_equal_to_(Data,[
118 expr(Data,int,A),
119 dot_expr(Data,int,B)
120 ]).
121expr(Data,bool,less_than(A,B)) -->
122 less_than_(Data,[
123 expr(Data,int,A),
124 dot_expr(Data,int,B)
125 ]).
126
127expr(Data,bool,compare(Type,Exp1,Exp2)) -->
128 compare_(Data,Type,[
129 dot_expr(Data,Type,Exp1),
130 expr(Data,Type,Exp2)
131 ]).
132
133expr(Data,Type,arithmetic(Exp1,Exp2,Symbol)) -->
134 {
135 member(Symbol,["+","-","*","/"])
136 },
137 arithmetic_(Data,[
138 dot_expr(Data,Type,Exp1),
139 expr(Data,Type,Exp2),
140 Symbol
141 ]),{Type=int;Type=double}.
142
143expr(Data,string,arithmetic("+",A,B)) -->
144 concatenate_string_(Data,[
145 dot_expr(Data,string,A),
146 expr(Data,string,B)
147 ]).
148
154
155expr(Data,int,mod(A,B)) -->
156 mod_(Data,[
157 dot_expr(Data,int,A),
158 expr(Data,int,B)
159 ]).
160
161expr(Data,[array,Type],concatenate_arrays(A1,A2)) -->
162 concatenate_arrays_(Data,[
163 dot_expr(Data,[array,Type],A1),
164 expr(Data,[array,Type],A2)
165 ]).
166
167expr(Data,bool,array_contains(Array,Contained,Type)) -->
168 array_contains(Data,[
169 parentheses_expr(Data,[array,Type],Array),
170 parentheses_expr(Data,Type,Contained)
171 ]).
172
173expr(Data,bool,string_contains(Str1,Str2)) -->
174 string_contains_(Data,[
175 parentheses_expr(Data,string,Str1),
176 parentheses_expr(Data,string,Str2)
177 ]).
178
179expr(Data,Type,this(A)) -->
180 this_(Data,[
181 var_name_(Data,Type,A)
182 ]).
183
184expr(Data,Type,access_dict(Dict,Index)) -->
185 access_dict_(Data,[
186 var_name_(Data,[dict,Type],Dict),
187 Dict,
188 expr(Data,string,Index)
189 ]).
190
191expr(Data,[array,string],command_line_args) -->
192 command_line_args_(Data).
193
194
195expr(Data,regex,new_regex(A)) -->
196 new_regex_(Data,[
197 expr(Data,string,A)
198 ]).
199expr(Data,bool,regex_matches_string(Str,Reg)) -->
200 regex_matches_string_(Data,[
201 parentheses_expr(Data,regex,Reg),
202 parentheses_expr(Data,string,Str)
203 ]).
204
205
206expr(Data,[array,string],dict_keys(A,Type)) -->
207 dict_keys_(Data,[
208 expr(Data,[dict,Type],A)
209 ]).
210
211expr(Data,double,random_number) -->
212 random_number(Data).
213
214expr(Data,Type,dot_expr(A)) -->
215 dot_expr(Data,Type,A)