querybuilder 0.5.9 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/History.txt +29 -25
  2. data/Manifest.txt +20 -9
  3. data/README.rdoc +73 -10
  4. data/Rakefile +62 -30
  5. data/lib/extconf.rb +3 -0
  6. data/lib/query_builder.rb +39 -898
  7. data/lib/query_builder/error.rb +7 -0
  8. data/lib/query_builder/info.rb +3 -0
  9. data/lib/query_builder/parser.rb +80 -0
  10. data/lib/query_builder/processor.rb +714 -0
  11. data/lib/query_builder/query.rb +273 -0
  12. data/lib/querybuilder_ext.c +1870 -0
  13. data/lib/querybuilder_ext.rl +418 -0
  14. data/lib/querybuilder_rb.rb +1686 -0
  15. data/lib/querybuilder_rb.rl +214 -0
  16. data/lib/querybuilder_syntax.rl +47 -0
  17. data/old_QueryBuilder.rb +946 -0
  18. data/querybuilder.gemspec +42 -15
  19. data/tasks/build.rake +20 -0
  20. data/test/dummy_test.rb +21 -0
  21. data/test/mock/custom_queries/test.yml +5 -4
  22. data/test/mock/dummy.rb +9 -0
  23. data/test/mock/dummy_processor.rb +160 -0
  24. data/test/mock/queries/bar.yml +1 -1
  25. data/test/mock/queries/foo.yml +2 -2
  26. data/test/mock/user_processor.rb +34 -0
  27. data/test/query_test.rb +38 -0
  28. data/test/querybuilder/basic.yml +91 -0
  29. data/test/{query_builder → querybuilder}/custom.yml +11 -11
  30. data/test/querybuilder/errors.yml +32 -0
  31. data/test/querybuilder/filters.yml +115 -0
  32. data/test/querybuilder/group.yml +7 -0
  33. data/test/querybuilder/joins.yml +37 -0
  34. data/test/querybuilder/mixed.yml +18 -0
  35. data/test/querybuilder/rubyless.yml +15 -0
  36. data/test/querybuilder_test.rb +111 -0
  37. data/test/test_helper.rb +8 -3
  38. metadata +66 -19
  39. data/test/mock/dummy_query.rb +0 -114
  40. data/test/mock/user_query.rb +0 -55
  41. data/test/query_builder/basic.yml +0 -60
  42. data/test/query_builder/errors.yml +0 -50
  43. data/test/query_builder/filters.yml +0 -43
  44. data/test/query_builder/joins.yml +0 -25
  45. data/test/query_builder/mixed.yml +0 -12
  46. data/test/query_builder_test.rb +0 -36
@@ -0,0 +1,273 @@
1
+ module QueryBuilder
2
+ class Query
3
+ attr_accessor :processor_class, :distinct, :select, :tables, :table_alias, :where,
4
+ :limit, :offset, :page_size, :order, :group, :error, :attributes_alias,
5
+ :pagination_key
6
+
7
+ def initialize(processor_class)
8
+ @processor_class = processor_class
9
+ @tables = []
10
+ @table_alias = {}
11
+ @join_tables = {}
12
+ @needed_join_tables = {}
13
+ @attributes_alias = {}
14
+ @where = []
15
+ end
16
+
17
+ def main_table
18
+ # @main_table is only used in custom queries
19
+ @main_table || processor_class.main_table
20
+ end
21
+
22
+ # Return the class of resulting objects (different from default_class if
23
+ # the value has been changed by the query building process).
24
+ def main_class
25
+ @main_class || default_class
26
+ end
27
+
28
+ def master_class(after_class = ActiveRecord::Base)
29
+ klass = main_class
30
+ klass = klass.first if klass.kind_of?(Array)
31
+ begin
32
+ up = klass.superclass
33
+ return klass if up == after_class
34
+ end while klass = up
35
+ return main_class
36
+ end
37
+
38
+ # Return the default class of resulting objects (usually the base class).
39
+ def default_class
40
+ klass = @processor_class.main_class
41
+ QueryBuilder.resolve_const(klass)
42
+ end
43
+
44
+ # Define the class of the returned object. If a previous class
45
+ # has already been defined, try to find a common ancestor or revert
46
+ # to the default.
47
+ def set_main_class(klass)
48
+ if @main_class
49
+ # TODO
50
+ # For now: revert to default
51
+ @main_class = self.default_class
52
+ else
53
+ @main_class = klass
54
+ end
55
+ end
56
+
57
+ def add_filter(filter)
58
+ @where << filter
59
+ end
60
+
61
+ # Convert query object to a string. This string should then be evaluated.
62
+ #
63
+ # ==== Parameters
64
+ # type<Symbol>:: Type of query to build (:find or :count).
65
+ #
66
+ # ==== Returns
67
+ # NilClass:: If the query is not valid and "ignore_warnings" was not set to true during initialize.
68
+ # String:: A string representing the query with its bind parameters.
69
+ #
70
+ # ==== Examples
71
+ # query.to_s
72
+ # => "[%Q{SELECT objects.* FROM objects WHERE objects.project_id = ?}, project_id]"
73
+ #
74
+ # DummyQuery.new("nodes in site").to_s
75
+ # => "%Q{SELECT objects.* FROM objects}"
76
+ #
77
+ # query.to_s(:count)
78
+ # => "[%Q{SELECT COUNT(*) FROM objects WHERE objects.project_id = ?}, project_id]"
79
+ def to_s(type = :find)
80
+ statement, bind_values = build_statement(type)
81
+ bind_values.empty? ? "%Q{#{statement}}" : "[#{[["%Q{#{statement}}"] + bind_values].join(', ')}]"
82
+ end
83
+
84
+ # Convert the query object into an SQL query.
85
+ #
86
+ # ==== Parameters
87
+ # bindings<Binding>:: Binding context in which to evaluate bind clauses (query arguments).
88
+ # type<Symbol>:: Type of SQL query (:find or :count)
89
+ #
90
+ # ==== Returns
91
+ # NilClass:: If the query is not valid and "ignore_warnings" was not set to true during initialize.
92
+ # String:: An SQL query, ready for execution (no more bind variables).
93
+ #
94
+ # ==== Examples
95
+ # query.sql(binding)
96
+ # => "SELECT objects.* FROM objects WHERE objects.project_id = 12489"
97
+ #
98
+ # query.sql(bindings, :count)
99
+ # => "SELECT COUNT(*) FROM objects WHERE objects.project_id = 12489"
100
+ def sql(bindings, type = :find)
101
+ statement, bind_values = build_statement(type)
102
+ connection = get_connection(bindings)
103
+ statement.gsub('?') { eval_bound_value(bind_values.shift, connection, bindings) }
104
+ end
105
+
106
+ # 'avoid_alias' is used when parsing the last element so that it takes the real table name (nodes, not no1). We need
107
+ # this because we can use 'OR' between parts and we thus need the same table reference.
108
+ def add_table(use_name, table_name = nil, avoid_alias = true)
109
+ alias_name = get_alias(use_name, table_name, avoid_alias)
110
+ add_alias_to_tables(table_name || use_name, alias_name)
111
+ end
112
+
113
+ def add_select(clause)
114
+ @select ||= []
115
+ @select << clause
116
+ rebuild_attributes_hash!
117
+ end
118
+
119
+ def table(table_name = main_table, index = 0)
120
+ @table_alias[table_name] ? @table_alias[table_name][index - 1] : nil
121
+ end
122
+
123
+ # Use this method to add a join to another table (added only once for each join name).
124
+ # versions LEFT JOIN dyn_attributes ON ...
125
+ def needs_join_table(table_name1, type, table_name2, clause, join_name = nil)
126
+ join_name ||= "#{table_name1}=#{type}=#{table_name2}"
127
+ @needed_join_tables[join_name] ||= {}
128
+ @needed_join_tables[join_name][table] ||= begin
129
+ # define join for this part ('table' = unique for each part)
130
+
131
+ # don't add to list of tables, just get unique alias name
132
+ second_table = get_alias(table_name2)
133
+
134
+ # create join
135
+ first_table = table(table_name1)
136
+
137
+ @join_tables[first_table] ||= []
138
+ @join_tables[first_table] << "#{type} JOIN #{second_table} ON #{clause.gsub('TABLE1',first_table).gsub('TABLE2',second_table)}"
139
+ second_table
140
+ end
141
+ end
142
+
143
+ # Used after setting @tables from custom query.
144
+ def rebuild_tables!
145
+ @table_alias = {}
146
+ @tables.each do |t|
147
+ if t =~ /\A(.+)\s+AS\s+(.+)\Z/
148
+ base, use_name = $1, $2
149
+ else
150
+ base = use_name = t
151
+ end
152
+ @table_alias[base] ||= []
153
+ @table_alias[base] << use_name
154
+ end
155
+ end
156
+
157
+ def rebuild_attributes_hash!
158
+ @attributes_alias = {}
159
+ @select.each do |attribute|
160
+ if attribute =~ /\A(.+)\s+AS\s+(.+)\Z/
161
+ @attributes_alias[$2] = $1
162
+ end
163
+ end
164
+ end
165
+
166
+
167
+ def filter
168
+ @where.reverse.join(' AND ')
169
+ end
170
+
171
+ private
172
+ # Make sure each used table gets a unique name
173
+ def get_alias(use_name, table_name = nil, avoid_alias = true)
174
+ table_name ||= use_name
175
+ @table_alias[use_name] ||= []
176
+ if avoid_alias && !@tables.include?(use_name)
177
+ alias_name = use_name
178
+ elsif @tables.include?(use_name)
179
+ # links, li1, li2, li3
180
+ alias_name = "#{use_name[0..1]}#{@table_alias[use_name].size}"
181
+ else
182
+ # ob1, obj2, objects
183
+ alias_name = "#{use_name[0..1]}#{@table_alias[use_name].size + 1}"
184
+ end
185
+
186
+ @table_alias[use_name] << alias_name
187
+ alias_name
188
+ end
189
+
190
+ def add_alias_to_tables(table_name, alias_name)
191
+ if alias_name != table_name
192
+ @tables << "#{table_name} AS #{alias_name}"
193
+ else
194
+ @tables << table_name
195
+ end
196
+ end
197
+
198
+ def build_statement(type = :find)
199
+ statement = type == :find ? find_statement : count_statement
200
+
201
+ # get bind variables
202
+ bind_values = []
203
+ statement.gsub!(/\[\[(.*?)\]\](?!\])/) do
204
+ bind_values << $1
205
+ '?'
206
+ end
207
+ [statement, bind_values]
208
+ end
209
+
210
+ def find_statement
211
+ table_list = []
212
+ @tables.each do |t|
213
+ table_name = t.split(/\s+/).last # objects AS ob1
214
+ if joins = @join_tables[table_name]
215
+ table_list << "#{t} #{joins.join(' ')}"
216
+ else
217
+ table_list << t
218
+ end
219
+ end
220
+
221
+ group = @group
222
+ if !group && @distinct
223
+ group = @tables.size > 1 ? " GROUP BY #{main_table}.id" : " GROUP BY id"
224
+ end
225
+
226
+ "SELECT #{(@select || ["#{main_table}.*"]).join(',')} FROM #{table_list.flatten.sort.join(',')}" + (@where == [] ? '' : " WHERE #{filter}") + group.to_s + @order.to_s + @limit.to_s + @offset.to_s
227
+ end
228
+
229
+ def count_statement
230
+ table_list = []
231
+ @tables.each do |t|
232
+ table_name = t.split(/\s+/).last # objects AS ob1
233
+ if joins = @join_tables[table_name]
234
+ table_list << "#{t} #{joins.join(' ')}"
235
+ else
236
+ table_list << t
237
+ end
238
+ end
239
+
240
+ if @group =~ /GROUP\s+BY\s+(.+)/
241
+ # we need to COALESCE in order to count groups where $1 is NULL.
242
+ fields = $1.split(",").map{|f| "COALESCE(#{f.strip},0)"}.join(",")
243
+ count_on = "COUNT(DISTINCT #{fields})"
244
+ elsif @distinct
245
+ count_on = "COUNT(DISTINCT #{table}.id)"
246
+ else
247
+ count_on = "COUNT(*)"
248
+ end
249
+
250
+ "SELECT #{count_on} FROM #{table_list.flatten.sort.join(',')}" + (@where == [] ? '' : " WHERE #{filter}")
251
+ end
252
+
253
+ def get_connection(bindings)
254
+ eval("#{default_class}.connection", bindings)
255
+ end
256
+
257
+ # Adapted from Rail's ActiveRecord code. We need "eval" because
258
+ # QueryBuilder is a compiler and it has absolutely no knowledge
259
+ # of the running context.
260
+ def eval_bound_value(value_as_string, connection, bindings)
261
+ value = eval(value_as_string, bindings)
262
+ if value.respond_to?(:map) && !value.kind_of?(String) #!value.acts_like?(:string)
263
+ if value.respond_to?(:empty?) && value.empty?
264
+ connection.quote(nil)
265
+ else
266
+ value.map { |v| connection.quote(v) }.join(',')
267
+ end
268
+ else
269
+ connection.quote(value)
270
+ end
271
+ end
272
+ end
273
+ end
@@ -0,0 +1,1870 @@
1
+
2
+ #line 1 "querybuilder_ext.rl"
3
+ #include <ruby.h>
4
+
5
+ static VALUE rb_QueryBuilder = Qnil;
6
+ static VALUE rb_Parser = Qnil;
7
+ static VALUE rb_SyntaxError = Qnil;
8
+
9
+ /* symbols */
10
+ static VALUE _query;
11
+ static VALUE _string;
12
+ static VALUE _dstring;
13
+ static VALUE _rubyless;
14
+ static VALUE _integer;
15
+ static VALUE _real;
16
+ static VALUE _field;
17
+ static VALUE _method;
18
+ static VALUE _raw;
19
+ static VALUE _function;
20
+ static VALUE _relation;
21
+ static VALUE _is;
22
+ static VALUE _interval;
23
+ static VALUE _scope;
24
+ static VALUE _filter;
25
+ static VALUE _offset;
26
+ static VALUE _param;
27
+ static VALUE _paginate;
28
+ static VALUE _limit;
29
+ static VALUE _group;
30
+ static VALUE _order;
31
+ static VALUE _from;
32
+ static VALUE _clause;
33
+ static VALUE _clause_and;
34
+ static VALUE _clause_or;
35
+ static VALUE _clause_par;
36
+ static VALUE _clause_par_close;
37
+ static VALUE _par;
38
+ static VALUE _par_close;
39
+
40
+
41
+ /* methods */
42
+ static ID _insert;
43
+ static ID _apply_op;
44
+ static ID _downcase;
45
+ static ID _pop_stack;
46
+
47
+ /* methods */
48
+ static VALUE rb_parse(VALUE self, VALUE string);
49
+
50
+ #define STORE_SYM(k) _##k = ID2SYM(rb_intern(#k));
51
+
52
+ /* init */
53
+ void Init_querybuilder_ext() {
54
+ rb_QueryBuilder = rb_define_module("QueryBuilder");
55
+ rb_Parser = rb_define_class_under(rb_QueryBuilder, "Parser", rb_cObject);
56
+ rb_define_singleton_method(rb_Parser, "parse", rb_parse, 1);
57
+
58
+ /* store symbols */
59
+ STORE_SYM(query);
60
+ STORE_SYM(string);
61
+ STORE_SYM(dstring);
62
+ STORE_SYM(rubyless);
63
+ STORE_SYM(integer);
64
+ STORE_SYM(real);
65
+ STORE_SYM(field);
66
+ STORE_SYM(method);
67
+ STORE_SYM(raw);
68
+ STORE_SYM(function);
69
+ STORE_SYM(relation);
70
+ STORE_SYM(is);
71
+ STORE_SYM(interval);
72
+ STORE_SYM(scope);
73
+ STORE_SYM(filter);
74
+ STORE_SYM(offset);
75
+ STORE_SYM(param);
76
+ STORE_SYM(paginate);
77
+ STORE_SYM(limit);
78
+ STORE_SYM(group);
79
+ STORE_SYM(order);
80
+ STORE_SYM(from);
81
+ STORE_SYM(clause);
82
+ STORE_SYM(clause_and);
83
+ STORE_SYM(clause_or);
84
+ STORE_SYM(clause_par);
85
+ STORE_SYM(clause_par_close);
86
+ STORE_SYM(par);
87
+ STORE_SYM(par_close);
88
+
89
+ /* methods */
90
+ _insert = rb_intern("insert");
91
+ _apply_op = rb_intern("apply_op");
92
+ _downcase = rb_intern("downcase");
93
+ _pop_stack = rb_intern("pop_stack");
94
+
95
+ /* classes */
96
+ rb_SyntaxError = rb_const_get(rb_QueryBuilder, rb_intern("SyntaxError"));
97
+ }
98
+
99
+ /* macro */
100
+ #define SET_TMP_ARY(sym) tmp = rb_ary_new(); \
101
+ rb_ary_push(tmp, sym); \
102
+ rb_ary_push(tmp, rb_str_new(str_a, p - str_a)); \
103
+ str_a = NULL;
104
+
105
+ #define SET_TMP_STR tmp = rb_str_new(str_a, p - str_a); \
106
+ str_a = NULL;
107
+
108
+ #define APPLY_OP(elem) last = rb_funcall(self, _apply_op, 2, stack, elem);
109
+
110
+
111
+ #line 366 "querybuilder_ext.rl"
112
+
113
+
114
+
115
+ #line 116 "querybuilder_ext.c"
116
+ static const char _querybuilder_actions[] = {
117
+ 0, 1, 0, 1, 1, 1, 2, 1,
118
+ 3, 1, 4, 1, 5, 1, 6, 1,
119
+ 7, 1, 8, 1, 9, 1, 10, 1,
120
+ 11, 1, 12, 1, 13, 1, 14, 1,
121
+ 15, 1, 16, 1, 17, 1, 18, 1,
122
+ 19, 1, 20, 1, 21, 1, 22, 1,
123
+ 23, 1, 24, 1, 25, 1, 26, 1,
124
+ 27, 1, 28, 1, 29, 2, 4, 0,
125
+ 2, 4, 17, 2, 4, 19, 2, 5,
126
+ 0, 2, 5, 17, 2, 5, 19, 2,
127
+ 6, 0, 2, 6, 11, 2, 6, 17,
128
+ 2, 6, 19, 2, 7, 0, 2, 7,
129
+ 17, 2, 7, 19, 2, 8, 0, 2,
130
+ 8, 17, 2, 8, 19, 2, 9, 0,
131
+ 2, 11, 6, 2, 11, 19, 2, 12,
132
+ 0, 2, 12, 16, 2, 12, 28, 2,
133
+ 14, 0, 2, 14, 17, 2, 14, 19,
134
+ 2, 16, 18, 2, 18, 16, 2, 20,
135
+ 19, 2, 21, 0, 2, 23, 0, 2,
136
+ 24, 0, 2, 25, 0, 2, 26, 0,
137
+ 2, 27, 0, 2, 27, 18, 2, 28,
138
+ 12
139
+ };
140
+
141
+ static const short _querybuilder_key_offsets[] = {
142
+ 0, 0, 9, 13, 16, 17, 18, 21,
143
+ 30, 34, 37, 38, 39, 40, 49, 58,
144
+ 66, 67, 68, 69, 70, 73, 77, 78,
145
+ 86, 94, 104, 105, 106, 107, 108, 114,
146
+ 120, 122, 128, 134, 136, 141, 142, 143,
147
+ 144, 145, 146, 152, 158, 160, 165, 166,
148
+ 167, 168, 169, 170, 171, 172, 180, 188,
149
+ 196, 198, 199, 200, 201, 204, 208, 209,
150
+ 217, 225, 235, 236, 237, 241, 242, 243,
151
+ 244, 245, 253, 261, 271, 279, 287, 297,
152
+ 298, 301, 309, 317, 319, 323, 324, 325,
153
+ 326, 327, 330, 345, 347, 355, 370, 371,
154
+ 374, 377, 379, 379, 379, 388, 396, 404,
155
+ 418, 434, 436, 436, 440, 448, 449, 450,
156
+ 453, 468, 470, 481, 483, 493, 507, 508,
157
+ 509, 518, 519, 522, 525, 526, 527, 528,
158
+ 530, 533, 538, 539, 540, 541, 549, 551,
159
+ 552, 555, 560, 561, 562, 565, 567, 568,
160
+ 571, 572, 573, 574, 575, 576, 577, 578,
161
+ 579, 580, 581, 583, 584, 587, 591, 592,
162
+ 593, 595, 599, 600, 601, 602, 603, 604,
163
+ 606, 607, 608, 609, 610, 611, 614, 629,
164
+ 631, 639, 654, 655, 658, 661, 663, 663,
165
+ 663, 672, 680, 688, 702, 718, 720, 720,
166
+ 724, 732, 733, 734, 737, 752, 754, 765,
167
+ 767, 777, 791, 792, 793, 802, 803, 806,
168
+ 809, 810, 811, 812, 814, 817, 822, 823,
169
+ 824, 825, 833, 835, 836, 839, 844, 845,
170
+ 846, 849, 851, 852, 855, 856, 857, 858,
171
+ 859, 860, 861, 862, 863, 864, 865, 867,
172
+ 868, 871, 875, 876, 877, 879, 883, 884,
173
+ 885, 886, 887, 888, 890, 891, 892, 893,
174
+ 894, 895, 909, 910, 910, 911, 912, 913,
175
+ 927, 928, 928, 936, 937, 938, 939, 940,
176
+ 949, 957, 958, 961, 969, 977, 978, 979,
177
+ 980, 981, 984, 999, 1001, 1009, 1024, 1025,
178
+ 1028, 1031, 1033, 1033, 1033, 1042, 1050, 1058,
179
+ 1072, 1088, 1090, 1090, 1094, 1102, 1103, 1104,
180
+ 1107, 1122, 1124, 1135, 1137, 1147, 1161, 1162,
181
+ 1163, 1172, 1173, 1176, 1179, 1180, 1181, 1182,
182
+ 1184, 1187, 1192, 1193, 1194, 1195, 1203, 1205,
183
+ 1206, 1209, 1214, 1215, 1216, 1219, 1221, 1222,
184
+ 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232,
185
+ 1233, 1234, 1235, 1237, 1238, 1241, 1245, 1246,
186
+ 1247, 1249, 1253, 1254, 1255, 1256, 1257, 1258,
187
+ 1260, 1261, 1262, 1263, 1264, 1265, 1279, 1280,
188
+ 1280, 1295, 1297, 1306, 1328, 1343, 1344, 1347,
189
+ 1350, 1352, 1352, 1352, 1362, 1370, 1378, 1393,
190
+ 1409, 1411, 1411, 1415, 1424, 1441, 1442, 1443,
191
+ 1446, 1447, 1449, 1450, 1453, 1458, 1459, 1460,
192
+ 1461, 1470, 1472, 1473, 1476, 1481, 1482, 1483,
193
+ 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1494,
194
+ 1495, 1498, 1502, 1503, 1504, 1506, 1518, 1520,
195
+ 1531, 1546, 1547, 1548, 1558, 1559, 1560, 1561,
196
+ 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571,
197
+ 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579,
198
+ 1580, 1581, 1581, 1590, 1594, 1598, 1603, 1604,
199
+ 1605, 1606, 1615, 1624, 1631, 1632, 1635, 1643,
200
+ 1652, 1653, 1654, 1655, 1656, 1659, 1674, 1676,
201
+ 1685, 1708, 1723, 1724, 1727, 1730, 1732, 1732,
202
+ 1732, 1742, 1750, 1758, 1773, 1789, 1791, 1791,
203
+ 1795, 1804, 1822, 1823, 1824, 1827, 1828, 1830,
204
+ 1832, 1835, 1840, 1841, 1842, 1843, 1852, 1854,
205
+ 1855, 1858, 1863, 1864, 1865, 1868, 1869, 1870,
206
+ 1871, 1872, 1873, 1874, 1876, 1877, 1880, 1884,
207
+ 1885, 1886, 1888, 1900, 1902, 1913, 1928, 1929,
208
+ 1930, 1940, 1941, 1942, 1943, 1946, 1947, 1948,
209
+ 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956,
210
+ 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1963,
211
+ 1972, 1981, 1992, 1999, 2005, 2010, 2014, 2017,
212
+ 2028, 2035, 2058, 2076, 2099, 2122, 2140, 2163,
213
+ 2174, 2185, 2208, 2226, 2249, 2249
214
+ };
215
+
216
+ static const char _querybuilder_trans_keys[] = {
217
+ 32, 40, 95, 9, 10, 65, 90, 97,
218
+ 122, 32, 41, 9, 10, 32, 9, 10,
219
+ 110, 100, 32, 9, 10, 32, 40, 95,
220
+ 9, 10, 65, 90, 97, 122, 32, 41,
221
+ 9, 10, 32, 9, 10, 114, 111, 109,
222
+ 32, 40, 95, 9, 10, 65, 90, 97,
223
+ 122, 32, 40, 95, 9, 10, 65, 90,
224
+ 97, 122, 32, 95, 9, 10, 65, 90,
225
+ 97, 122, 114, 111, 117, 112, 32, 9,
226
+ 10, 32, 98, 9, 10, 121, 32, 95,
227
+ 9, 10, 65, 90, 97, 122, 32, 95,
228
+ 9, 10, 65, 90, 97, 122, 32, 44,
229
+ 46, 95, 9, 10, 65, 90, 97, 122,
230
+ 105, 109, 105, 116, 32, 45, 9, 10,
231
+ 48, 57, 32, 45, 9, 10, 48, 57,
232
+ 48, 57, 32, 44, 9, 10, 48, 57,
233
+ 32, 45, 9, 10, 48, 57, 48, 57,
234
+ 32, 9, 10, 48, 57, 102, 102, 115,
235
+ 101, 116, 32, 45, 9, 10, 48, 57,
236
+ 32, 45, 9, 10, 48, 57, 48, 57,
237
+ 32, 9, 10, 48, 57, 97, 103, 105,
238
+ 110, 97, 116, 101, 32, 95, 9, 10,
239
+ 65, 90, 97, 122, 32, 95, 9, 10,
240
+ 65, 90, 97, 122, 32, 95, 9, 10,
241
+ 65, 90, 97, 122, 102, 114, 100, 101,
242
+ 114, 32, 9, 10, 32, 98, 9, 10,
243
+ 121, 32, 95, 9, 10, 65, 90, 97,
244
+ 122, 32, 95, 9, 10, 65, 90, 97,
245
+ 122, 32, 44, 46, 95, 9, 10, 65,
246
+ 90, 97, 122, 83, 67, 32, 44, 9,
247
+ 10, 69, 115, 99, 101, 32, 95, 9,
248
+ 10, 65, 90, 97, 122, 32, 95, 9,
249
+ 10, 65, 90, 97, 122, 32, 44, 46,
250
+ 95, 9, 10, 65, 90, 97, 122, 32,
251
+ 95, 9, 10, 65, 90, 97, 122, 32,
252
+ 95, 9, 10, 65, 90, 97, 122, 32,
253
+ 44, 46, 95, 9, 10, 65, 90, 97,
254
+ 122, 110, 32, 9, 10, 32, 95, 9,
255
+ 10, 65, 90, 97, 122, 32, 95, 9,
256
+ 10, 65, 90, 97, 122, 102, 114, 32,
257
+ 100, 9, 10, 104, 101, 114, 101, 32,
258
+ 9, 10, 32, 34, 35, 39, 40, 45,
259
+ 95, 9, 10, 48, 57, 65, 90, 97,
260
+ 122, 34, 92, 32, 43, 45, 61, 9,
261
+ 10, 60, 62, 32, 34, 35, 39, 40,
262
+ 45, 95, 9, 10, 48, 57, 65, 90,
263
+ 97, 122, 123, 34, 92, 125, 34, 92,
264
+ 125, 34, 92, 32, 43, 45, 46, 61,
265
+ 9, 10, 60, 62, 32, 95, 9, 10,
266
+ 65, 90, 97, 122, 32, 95, 9, 10,
267
+ 65, 90, 97, 122, 32, 43, 45, 46,
268
+ 61, 95, 9, 10, 60, 62, 65, 90,
269
+ 97, 122, 32, 34, 35, 39, 40, 45,
270
+ 61, 95, 9, 10, 48, 57, 65, 90,
271
+ 97, 122, 39, 92, 32, 41, 9, 10,
272
+ 32, 43, 45, 61, 9, 10, 60, 62,
273
+ 110, 100, 32, 9, 10, 32, 34, 35,
274
+ 39, 40, 45, 95, 9, 10, 48, 57,
275
+ 65, 90, 97, 122, 48, 57, 32, 43,
276
+ 45, 46, 61, 9, 10, 48, 57, 60,
277
+ 62, 48, 57, 32, 43, 45, 61, 9,
278
+ 10, 48, 57, 60, 62, 32, 43, 45,
279
+ 46, 61, 95, 9, 10, 60, 62, 65,
280
+ 90, 97, 122, 97, 121, 32, 43, 45,
281
+ 61, 115, 9, 10, 60, 62, 113, 32,
282
+ 9, 10, 101, 114, 116, 111, 117, 114,
283
+ 110, 115, 32, 9, 10, 32, 78, 110,
284
+ 9, 10, 85, 76, 76, 32, 43, 45,
285
+ 61, 9, 10, 60, 62, 111, 117, 116,
286
+ 32, 9, 10, 32, 78, 110, 9, 10,
287
+ 108, 108, 101, 105, 116, 107, 109, 101,
288
+ 97, 105, 111, 116, 99, 104, 110, 117,
289
+ 116, 101, 110, 116, 104, 101, 111, 116,
290
+ 32, 9, 10, 32, 108, 9, 10, 105,
291
+ 107, 102, 114, 32, 100, 9, 10, 101,
292
+ 99, 111, 110, 100, 101, 104, 101, 107,
293
+ 101, 114, 101, 32, 9, 10, 32, 34,
294
+ 35, 39, 40, 45, 95, 9, 10, 48,
295
+ 57, 65, 90, 97, 122, 34, 92, 32,
296
+ 43, 45, 61, 9, 10, 60, 62, 32,
297
+ 34, 35, 39, 40, 45, 95, 9, 10,
298
+ 48, 57, 65, 90, 97, 122, 123, 34,
299
+ 92, 125, 34, 92, 125, 34, 92, 32,
300
+ 43, 45, 46, 61, 9, 10, 60, 62,
301
+ 32, 95, 9, 10, 65, 90, 97, 122,
302
+ 32, 95, 9, 10, 65, 90, 97, 122,
303
+ 32, 43, 45, 46, 61, 95, 9, 10,
304
+ 60, 62, 65, 90, 97, 122, 32, 34,
305
+ 35, 39, 40, 45, 61, 95, 9, 10,
306
+ 48, 57, 65, 90, 97, 122, 39, 92,
307
+ 32, 41, 9, 10, 32, 43, 45, 61,
308
+ 9, 10, 60, 62, 110, 100, 32, 9,
309
+ 10, 32, 34, 35, 39, 40, 45, 95,
310
+ 9, 10, 48, 57, 65, 90, 97, 122,
311
+ 48, 57, 32, 43, 45, 46, 61, 9,
312
+ 10, 48, 57, 60, 62, 48, 57, 32,
313
+ 43, 45, 61, 9, 10, 48, 57, 60,
314
+ 62, 32, 43, 45, 46, 61, 95, 9,
315
+ 10, 60, 62, 65, 90, 97, 122, 97,
316
+ 121, 32, 43, 45, 61, 115, 9, 10,
317
+ 60, 62, 113, 32, 9, 10, 101, 114,
318
+ 116, 111, 117, 114, 110, 115, 32, 9,
319
+ 10, 32, 78, 110, 9, 10, 85, 76,
320
+ 76, 32, 43, 45, 61, 9, 10, 60,
321
+ 62, 111, 117, 116, 32, 9, 10, 32,
322
+ 78, 110, 9, 10, 108, 108, 101, 105,
323
+ 116, 107, 109, 101, 97, 105, 111, 116,
324
+ 99, 104, 110, 117, 116, 101, 110, 116,
325
+ 104, 101, 111, 116, 32, 9, 10, 32,
326
+ 108, 9, 10, 105, 107, 102, 114, 32,
327
+ 100, 9, 10, 101, 99, 111, 110, 100,
328
+ 101, 104, 101, 107, 101, 97, 97, 32,
329
+ 43, 45, 46, 61, 95, 9, 10, 60,
330
+ 62, 65, 90, 97, 122, 101, 101, 97,
331
+ 97, 32, 43, 45, 46, 61, 95, 9,
332
+ 10, 60, 62, 65, 90, 97, 122, 101,
333
+ 32, 95, 9, 10, 65, 90, 97, 122,
334
+ 104, 114, 111, 109, 32, 40, 95, 9,
335
+ 10, 65, 90, 97, 122, 32, 95, 9,
336
+ 10, 65, 90, 97, 122, 110, 32, 9,
337
+ 10, 32, 95, 9, 10, 65, 90, 97,
338
+ 122, 32, 95, 9, 10, 65, 90, 97,
339
+ 122, 104, 101, 114, 101, 32, 9, 10,
340
+ 32, 34, 35, 39, 40, 45, 95, 9,
341
+ 10, 48, 57, 65, 90, 97, 122, 34,
342
+ 92, 32, 43, 45, 61, 9, 10, 60,
343
+ 62, 32, 34, 35, 39, 40, 45, 95,
344
+ 9, 10, 48, 57, 65, 90, 97, 122,
345
+ 123, 34, 92, 125, 34, 92, 125, 34,
346
+ 92, 32, 43, 45, 46, 61, 9, 10,
347
+ 60, 62, 32, 95, 9, 10, 65, 90,
348
+ 97, 122, 32, 95, 9, 10, 65, 90,
349
+ 97, 122, 32, 43, 45, 46, 61, 95,
350
+ 9, 10, 60, 62, 65, 90, 97, 122,
351
+ 32, 34, 35, 39, 40, 45, 61, 95,
352
+ 9, 10, 48, 57, 65, 90, 97, 122,
353
+ 39, 92, 32, 41, 9, 10, 32, 43,
354
+ 45, 61, 9, 10, 60, 62, 110, 100,
355
+ 32, 9, 10, 32, 34, 35, 39, 40,
356
+ 45, 95, 9, 10, 48, 57, 65, 90,
357
+ 97, 122, 48, 57, 32, 43, 45, 46,
358
+ 61, 9, 10, 48, 57, 60, 62, 48,
359
+ 57, 32, 43, 45, 61, 9, 10, 48,
360
+ 57, 60, 62, 32, 43, 45, 46, 61,
361
+ 95, 9, 10, 60, 62, 65, 90, 97,
362
+ 122, 97, 121, 32, 43, 45, 61, 115,
363
+ 9, 10, 60, 62, 113, 32, 9, 10,
364
+ 101, 114, 116, 111, 117, 114, 110, 115,
365
+ 32, 9, 10, 32, 78, 110, 9, 10,
366
+ 85, 76, 76, 32, 43, 45, 61, 9,
367
+ 10, 60, 62, 111, 117, 116, 32, 9,
368
+ 10, 32, 78, 110, 9, 10, 108, 108,
369
+ 101, 105, 116, 107, 109, 101, 97, 105,
370
+ 111, 116, 99, 104, 110, 117, 116, 101,
371
+ 110, 116, 104, 101, 111, 116, 32, 9,
372
+ 10, 32, 108, 9, 10, 105, 107, 102,
373
+ 114, 32, 100, 9, 10, 101, 99, 111,
374
+ 110, 100, 101, 104, 101, 107, 101, 97,
375
+ 97, 32, 43, 45, 46, 61, 95, 9,
376
+ 10, 60, 62, 65, 90, 97, 122, 101,
377
+ 32, 34, 35, 39, 40, 45, 95, 9,
378
+ 10, 48, 57, 65, 90, 97, 122, 34,
379
+ 92, 32, 41, 43, 45, 61, 9, 10,
380
+ 60, 62, 32, 41, 43, 45, 61, 97,
381
+ 100, 101, 103, 104, 105, 108, 109, 110,
382
+ 111, 115, 119, 121, 9, 10, 60, 62,
383
+ 32, 34, 35, 39, 40, 45, 95, 9,
384
+ 10, 48, 57, 65, 90, 97, 122, 123,
385
+ 34, 92, 125, 34, 92, 125, 34, 92,
386
+ 32, 41, 43, 45, 46, 61, 9, 10,
387
+ 60, 62, 32, 95, 9, 10, 65, 90,
388
+ 97, 122, 32, 95, 9, 10, 65, 90,
389
+ 97, 122, 32, 41, 43, 45, 46, 61,
390
+ 95, 9, 10, 60, 62, 65, 90, 97,
391
+ 122, 32, 34, 35, 39, 40, 45, 61,
392
+ 95, 9, 10, 48, 57, 65, 90, 97,
393
+ 122, 39, 92, 32, 41, 9, 10, 32,
394
+ 41, 43, 45, 61, 9, 10, 60, 62,
395
+ 32, 41, 43, 45, 61, 97, 101, 103,
396
+ 105, 108, 109, 110, 111, 9, 10, 60,
397
+ 62, 110, 100, 32, 9, 10, 113, 101,
398
+ 116, 115, 32, 9, 10, 32, 78, 110,
399
+ 9, 10, 85, 76, 76, 32, 41, 43,
400
+ 45, 61, 9, 10, 60, 62, 111, 117,
401
+ 116, 32, 9, 10, 32, 78, 110, 9,
402
+ 10, 108, 108, 101, 105, 116, 107, 101,
403
+ 97, 116, 99, 104, 101, 111, 116, 32,
404
+ 9, 10, 32, 108, 9, 10, 105, 114,
405
+ 48, 57, 32, 41, 43, 45, 46, 61,
406
+ 9, 10, 48, 57, 60, 62, 48, 57,
407
+ 32, 41, 43, 45, 61, 9, 10, 48,
408
+ 57, 60, 62, 32, 41, 43, 45, 46,
409
+ 61, 95, 9, 10, 60, 62, 65, 90,
410
+ 97, 122, 97, 121, 32, 41, 43, 45,
411
+ 61, 115, 9, 10, 60, 62, 111, 117,
412
+ 114, 97, 105, 111, 110, 117, 116, 101,
413
+ 110, 116, 104, 101, 99, 111, 110, 100,
414
+ 101, 101, 107, 101, 97, 32, 40, 95,
415
+ 9, 10, 65, 90, 97, 122, 32, 41,
416
+ 9, 10, 32, 41, 9, 10, 32, 41,
417
+ 102, 9, 10, 114, 111, 109, 32, 40,
418
+ 95, 9, 10, 65, 90, 97, 122, 32,
419
+ 41, 95, 9, 10, 65, 90, 97, 122,
420
+ 32, 41, 102, 105, 119, 9, 10, 110,
421
+ 32, 9, 10, 32, 95, 9, 10, 65,
422
+ 90, 97, 122, 32, 41, 95, 9, 10,
423
+ 65, 90, 97, 122, 104, 101, 114, 101,
424
+ 32, 9, 10, 32, 34, 35, 39, 40,
425
+ 45, 95, 9, 10, 48, 57, 65, 90,
426
+ 97, 122, 34, 92, 32, 41, 43, 45,
427
+ 61, 9, 10, 60, 62, 32, 41, 43,
428
+ 45, 61, 97, 100, 101, 102, 103, 104,
429
+ 105, 108, 109, 110, 111, 115, 119, 121,
430
+ 9, 10, 60, 62, 32, 34, 35, 39,
431
+ 40, 45, 95, 9, 10, 48, 57, 65,
432
+ 90, 97, 122, 123, 34, 92, 125, 34,
433
+ 92, 125, 34, 92, 32, 41, 43, 45,
434
+ 46, 61, 9, 10, 60, 62, 32, 95,
435
+ 9, 10, 65, 90, 97, 122, 32, 95,
436
+ 9, 10, 65, 90, 97, 122, 32, 41,
437
+ 43, 45, 46, 61, 95, 9, 10, 60,
438
+ 62, 65, 90, 97, 122, 32, 34, 35,
439
+ 39, 40, 45, 61, 95, 9, 10, 48,
440
+ 57, 65, 90, 97, 122, 39, 92, 32,
441
+ 41, 9, 10, 32, 41, 43, 45, 61,
442
+ 9, 10, 60, 62, 32, 41, 43, 45,
443
+ 61, 97, 101, 102, 103, 105, 108, 109,
444
+ 110, 111, 9, 10, 60, 62, 110, 100,
445
+ 32, 9, 10, 113, 101, 116, 110, 115,
446
+ 32, 9, 10, 32, 78, 110, 9, 10,
447
+ 85, 76, 76, 32, 41, 43, 45, 61,
448
+ 9, 10, 60, 62, 111, 117, 116, 32,
449
+ 9, 10, 32, 78, 110, 9, 10, 108,
450
+ 108, 101, 105, 116, 107, 101, 97, 116,
451
+ 99, 104, 101, 111, 116, 32, 9, 10,
452
+ 32, 108, 9, 10, 105, 114, 48, 57,
453
+ 32, 41, 43, 45, 46, 61, 9, 10,
454
+ 48, 57, 60, 62, 48, 57, 32, 41,
455
+ 43, 45, 61, 9, 10, 48, 57, 60,
456
+ 62, 32, 41, 43, 45, 46, 61, 95,
457
+ 9, 10, 60, 62, 65, 90, 97, 122,
458
+ 97, 121, 32, 41, 43, 45, 61, 115,
459
+ 9, 10, 60, 62, 111, 117, 114, 97,
460
+ 105, 111, 110, 117, 116, 101, 110, 116,
461
+ 104, 101, 99, 111, 110, 100, 101, 101,
462
+ 107, 101, 97, 32, 97, 102, 103, 108,
463
+ 111, 112, 9, 10, 32, 97, 102, 103,
464
+ 108, 111, 112, 9, 10, 32, 97, 102,
465
+ 103, 105, 108, 111, 112, 119, 9, 10,
466
+ 32, 44, 108, 111, 112, 9, 10, 32,
467
+ 44, 111, 112, 9, 10, 32, 111, 112,
468
+ 9, 10, 32, 112, 9, 10, 32, 9,
469
+ 10, 32, 44, 65, 68, 97, 100, 108,
470
+ 111, 112, 9, 10, 32, 44, 108, 111,
471
+ 112, 9, 10, 32, 43, 45, 61, 97,
472
+ 100, 101, 102, 103, 104, 105, 108, 109,
473
+ 110, 111, 112, 115, 119, 121, 9, 10,
474
+ 60, 62, 32, 43, 45, 61, 97, 101,
475
+ 102, 103, 105, 108, 109, 110, 111, 112,
476
+ 9, 10, 60, 62, 32, 43, 45, 61,
477
+ 97, 100, 101, 102, 103, 104, 105, 108,
478
+ 109, 110, 111, 112, 115, 119, 121, 9,
479
+ 10, 60, 62, 32, 43, 45, 61, 97,
480
+ 100, 101, 102, 103, 104, 105, 108, 109,
481
+ 110, 111, 112, 115, 119, 121, 9, 10,
482
+ 60, 62, 32, 43, 45, 61, 97, 101,
483
+ 102, 103, 105, 108, 109, 110, 111, 112,
484
+ 9, 10, 60, 62, 32, 43, 45, 61,
485
+ 97, 100, 101, 102, 103, 104, 105, 108,
486
+ 109, 110, 111, 112, 115, 119, 121, 9,
487
+ 10, 60, 62, 32, 97, 102, 103, 105,
488
+ 108, 111, 112, 119, 9, 10, 32, 97,
489
+ 102, 103, 105, 108, 111, 112, 119, 9,
490
+ 10, 32, 43, 45, 61, 97, 100, 101,
491
+ 102, 103, 104, 105, 108, 109, 110, 111,
492
+ 112, 115, 119, 121, 9, 10, 60, 62,
493
+ 32, 43, 45, 61, 97, 101, 102, 103,
494
+ 105, 108, 109, 110, 111, 112, 9, 10,
495
+ 60, 62, 32, 43, 45, 61, 97, 100,
496
+ 101, 102, 103, 104, 105, 108, 109, 110,
497
+ 111, 112, 115, 119, 121, 9, 10, 60,
498
+ 62, 0
499
+ };
500
+
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0, 0, 0, 0, 0,
645
+ 0, 0, 0, 0, 0, 0, 0, 1,
646
+ 1, 1, 1, 1, 1, 1, 1, 1,
647
+ 1, 2, 2, 2, 2, 2, 2, 1,
648
+ 1, 2, 2, 2, 0, 0
649
+ };
650
+
651
+ static const short _querybuilder_index_offsets[] = {
652
+ 0, 0, 7, 11, 14, 16, 18, 21,
653
+ 28, 32, 35, 37, 39, 41, 48, 55,
654
+ 61, 63, 65, 67, 69, 72, 76, 78,
655
+ 84, 90, 98, 100, 102, 104, 106, 111,
656
+ 116, 118, 123, 128, 130, 134, 136, 138,
657
+ 140, 142, 144, 149, 154, 156, 160, 162,
658
+ 164, 166, 168, 170, 172, 174, 180, 186,
659
+ 192, 195, 197, 199, 201, 204, 208, 210,
660
+ 216, 222, 230, 232, 234, 238, 240, 242,
661
+ 244, 246, 252, 258, 266, 272, 278, 286,
662
+ 288, 291, 297, 303, 306, 310, 312, 314,
663
+ 316, 318, 321, 333, 336, 343, 355, 357,
664
+ 361, 365, 368, 369, 370, 378, 384, 390,
665
+ 401, 414, 417, 418, 422, 429, 431, 433,
666
+ 436, 448, 450, 459, 461, 469, 480, 482,
667
+ 484, 492, 494, 497, 501, 503, 505, 507,
668
+ 510, 513, 518, 520, 522, 524, 531, 534,
669
+ 536, 539, 544, 546, 548, 552, 555, 557,
670
+ 561, 563, 565, 567, 569, 571, 573, 575,
671
+ 577, 579, 581, 584, 586, 589, 593, 595,
672
+ 597, 600, 604, 606, 608, 610, 612, 614,
673
+ 617, 619, 621, 623, 625, 627, 630, 642,
674
+ 645, 652, 664, 666, 670, 674, 677, 678,
675
+ 679, 687, 693, 699, 710, 723, 726, 727,
676
+ 731, 738, 740, 742, 745, 757, 759, 768,
677
+ 770, 778, 789, 791, 793, 801, 803, 806,
678
+ 810, 812, 814, 816, 819, 822, 827, 829,
679
+ 831, 833, 840, 843, 845, 848, 853, 855,
680
+ 857, 861, 864, 866, 870, 872, 874, 876,
681
+ 878, 880, 882, 884, 886, 888, 890, 893,
682
+ 895, 898, 902, 904, 906, 909, 913, 915,
683
+ 917, 919, 921, 923, 926, 928, 930, 932,
684
+ 934, 936, 947, 949, 950, 952, 954, 956,
685
+ 967, 969, 970, 976, 978, 980, 982, 984,
686
+ 991, 997, 999, 1002, 1008, 1014, 1016, 1018,
687
+ 1020, 1022, 1025, 1037, 1040, 1047, 1059, 1061,
688
+ 1065, 1069, 1072, 1073, 1074, 1082, 1088, 1094,
689
+ 1105, 1118, 1121, 1122, 1126, 1133, 1135, 1137,
690
+ 1140, 1152, 1154, 1163, 1165, 1173, 1184, 1186,
691
+ 1188, 1196, 1198, 1201, 1205, 1207, 1209, 1211,
692
+ 1214, 1217, 1222, 1224, 1226, 1228, 1235, 1238,
693
+ 1240, 1243, 1248, 1250, 1252, 1256, 1259, 1261,
694
+ 1265, 1267, 1269, 1271, 1273, 1275, 1277, 1279,
695
+ 1281, 1283, 1285, 1288, 1290, 1293, 1297, 1299,
696
+ 1301, 1304, 1308, 1310, 1312, 1314, 1316, 1318,
697
+ 1321, 1323, 1325, 1327, 1329, 1331, 1342, 1344,
698
+ 1345, 1357, 1360, 1368, 1389, 1401, 1403, 1407,
699
+ 1411, 1414, 1415, 1416, 1425, 1431, 1437, 1449,
700
+ 1462, 1465, 1466, 1470, 1478, 1494, 1496, 1498,
701
+ 1501, 1503, 1506, 1508, 1511, 1516, 1518, 1520,
702
+ 1522, 1530, 1533, 1535, 1538, 1543, 1545, 1547,
703
+ 1551, 1553, 1555, 1557, 1559, 1561, 1563, 1566,
704
+ 1568, 1571, 1575, 1577, 1579, 1581, 1591, 1593,
705
+ 1602, 1614, 1616, 1618, 1627, 1629, 1631, 1633,
706
+ 1637, 1639, 1641, 1643, 1645, 1647, 1649, 1651,
707
+ 1653, 1655, 1657, 1659, 1661, 1663, 1665, 1667,
708
+ 1669, 1671, 1672, 1679, 1683, 1687, 1692, 1694,
709
+ 1696, 1698, 1705, 1712, 1719, 1721, 1724, 1730,
710
+ 1737, 1739, 1741, 1743, 1745, 1748, 1760, 1763,
711
+ 1771, 1793, 1805, 1807, 1811, 1815, 1818, 1819,
712
+ 1820, 1829, 1835, 1841, 1853, 1866, 1869, 1870,
713
+ 1874, 1882, 1899, 1901, 1903, 1906, 1908, 1911,
714
+ 1914, 1917, 1922, 1924, 1926, 1928, 1936, 1939,
715
+ 1941, 1944, 1949, 1951, 1953, 1957, 1959, 1961,
716
+ 1963, 1965, 1967, 1969, 1972, 1974, 1977, 1981,
717
+ 1983, 1985, 1987, 1997, 1999, 2008, 2020, 2022,
718
+ 2024, 2033, 2035, 2037, 2039, 2043, 2045, 2047,
719
+ 2049, 2051, 2053, 2055, 2057, 2059, 2061, 2063,
720
+ 2065, 2067, 2069, 2071, 2073, 2075, 2077, 2078,
721
+ 2087, 2096, 2107, 2114, 2120, 2125, 2129, 2132,
722
+ 2143, 2150, 2172, 2189, 2211, 2233, 2250, 2272,
723
+ 2283, 2294, 2316, 2333, 2355, 2356
724
+ };
725
+
726
+ static const short _querybuilder_trans_targs[] = {
727
+ 1, 2, 272, 1, 272, 272, 0, 2,
728
+ 3, 2, 0, 551, 551, 0, 5, 0,
729
+ 6, 0, 7, 7, 0, 7, 8, 266,
730
+ 7, 266, 266, 0, 8, 9, 8, 0,
731
+ 552, 552, 0, 11, 0, 12, 0, 13,
732
+ 0, 14, 8, 15, 14, 15, 15, 0,
733
+ 14, 8, 15, 14, 15, 15, 0, 553,
734
+ 15, 553, 15, 15, 0, 17, 0, 18,
735
+ 0, 19, 0, 20, 0, 21, 21, 0,
736
+ 21, 22, 21, 0, 23, 0, 24, 25,
737
+ 24, 25, 25, 0, 24, 25, 24, 25,
738
+ 25, 0, 554, 24, 76, 25, 554, 25,
739
+ 25, 0, 27, 0, 28, 0, 29, 0,
740
+ 30, 0, 31, 32, 31, 33, 0, 31,
741
+ 32, 31, 33, 0, 33, 0, 555, 34,
742
+ 555, 33, 0, 34, 35, 34, 36, 0,
743
+ 36, 0, 556, 556, 36, 0, 38, 0,
744
+ 39, 0, 40, 0, 41, 0, 42, 0,
745
+ 43, 44, 43, 45, 0, 43, 44, 43,
746
+ 45, 0, 45, 0, 557, 557, 45, 0,
747
+ 47, 0, 48, 0, 49, 0, 50, 0,
748
+ 51, 0, 52, 0, 53, 0, 54, 55,
749
+ 54, 55, 55, 0, 54, 55, 54, 55,
750
+ 55, 0, 558, 55, 558, 55, 55, 0,
751
+ 38, 57, 0, 58, 0, 59, 0, 60,
752
+ 0, 61, 61, 0, 61, 62, 61, 0,
753
+ 63, 0, 64, 65, 64, 65, 65, 0,
754
+ 64, 65, 64, 65, 65, 0, 559, 64,
755
+ 73, 65, 559, 65, 65, 0, 67, 0,
756
+ 68, 0, 560, 64, 560, 0, 66, 0,
757
+ 71, 0, 68, 0, 70, 0, 74, 75,
758
+ 74, 75, 75, 0, 74, 75, 74, 75,
759
+ 75, 0, 559, 64, 73, 75, 559, 75,
760
+ 75, 0, 77, 78, 77, 78, 78, 0,
761
+ 77, 78, 77, 78, 78, 0, 554, 24,
762
+ 76, 78, 554, 78, 78, 0, 80, 0,
763
+ 81, 81, 0, 81, 82, 81, 82, 82,
764
+ 0, 552, 82, 552, 82, 82, 0, 38,
765
+ 84, 0, 7, 58, 7, 0, 86, 0,
766
+ 87, 0, 88, 0, 89, 0, 90, 90,
767
+ 0, 90, 91, 94, 105, 107, 113, 263,
768
+ 90, 114, 263, 263, 0, 92, 265, 91,
769
+ 561, 93, 93, 93, 561, 104, 0, 90,
770
+ 91, 94, 105, 107, 113, 263, 90, 114,
771
+ 263, 263, 0, 95, 0, 97, 99, 0,
772
+ 96, 97, 99, 100, 96, 96, 98, 97,
773
+ 97, 96, 561, 93, 93, 101, 93, 561,
774
+ 104, 0, 102, 103, 102, 103, 103, 0,
775
+ 102, 103, 102, 103, 103, 0, 561, 93,
776
+ 93, 101, 93, 103, 561, 104, 103, 103,
777
+ 0, 90, 91, 94, 105, 107, 113, 93,
778
+ 263, 90, 114, 263, 263, 0, 92, 106,
779
+ 105, 105, 107, 108, 107, 0, 562, 93,
780
+ 93, 93, 562, 104, 0, 110, 0, 111,
781
+ 0, 112, 112, 0, 112, 91, 94, 105,
782
+ 107, 113, 117, 112, 114, 117, 117, 0,
783
+ 114, 0, 561, 93, 93, 115, 93, 561,
784
+ 114, 104, 0, 116, 0, 561, 93, 93,
785
+ 93, 561, 116, 104, 0, 563, 93, 93,
786
+ 101, 93, 117, 563, 104, 117, 117, 0,
787
+ 119, 0, 120, 0, 562, 93, 93, 93,
788
+ 108, 562, 104, 0, 122, 0, 90, 90,
789
+ 0, 122, 17, 122, 0, 125, 0, 126,
790
+ 0, 120, 0, 80, 128, 0, 129, 129,
791
+ 0, 129, 130, 134, 129, 0, 131, 0,
792
+ 132, 0, 133, 0, 562, 93, 93, 93,
793
+ 562, 104, 0, 135, 138, 0, 136, 0,
794
+ 137, 137, 0, 137, 130, 134, 137, 0,
795
+ 139, 0, 133, 0, 122, 141, 122, 0,
796
+ 142, 28, 0, 122, 0, 144, 147, 151,
797
+ 0, 145, 0, 146, 0, 122, 0, 148,
798
+ 0, 149, 0, 150, 0, 120, 0, 152,
799
+ 0, 153, 0, 120, 0, 122, 155, 0,
800
+ 156, 0, 157, 157, 0, 157, 158, 157,
801
+ 0, 159, 0, 142, 0, 38, 161, 0,
802
+ 112, 58, 112, 0, 163, 0, 164, 0,
803
+ 165, 0, 166, 0, 120, 0, 168, 170,
804
+ 0, 169, 0, 120, 0, 171, 0, 172,
805
+ 0, 173, 0, 174, 174, 0, 174, 175,
806
+ 178, 189, 191, 197, 257, 174, 198, 257,
807
+ 257, 0, 176, 259, 175, 564, 177, 177,
808
+ 177, 564, 188, 0, 174, 175, 178, 189,
809
+ 191, 197, 257, 174, 198, 257, 257, 0,
810
+ 179, 0, 181, 183, 0, 180, 181, 183,
811
+ 184, 180, 180, 182, 181, 181, 180, 564,
812
+ 177, 177, 185, 177, 564, 188, 0, 186,
813
+ 187, 186, 187, 187, 0, 186, 187, 186,
814
+ 187, 187, 0, 564, 177, 177, 185, 177,
815
+ 187, 564, 188, 187, 187, 0, 174, 175,
816
+ 178, 189, 191, 197, 177, 257, 174, 198,
817
+ 257, 257, 0, 176, 190, 189, 189, 191,
818
+ 192, 191, 0, 565, 177, 177, 177, 565,
819
+ 188, 0, 194, 0, 195, 0, 196, 196,
820
+ 0, 196, 175, 178, 189, 191, 197, 201,
821
+ 196, 198, 201, 201, 0, 198, 0, 564,
822
+ 177, 177, 199, 177, 564, 198, 188, 0,
823
+ 200, 0, 564, 177, 177, 177, 564, 200,
824
+ 188, 0, 566, 177, 177, 185, 177, 201,
825
+ 566, 188, 201, 201, 0, 203, 0, 204,
826
+ 0, 565, 177, 177, 177, 192, 565, 188,
827
+ 0, 206, 0, 174, 174, 0, 206, 17,
828
+ 206, 0, 209, 0, 210, 0, 204, 0,
829
+ 80, 212, 0, 213, 213, 0, 213, 214,
830
+ 218, 213, 0, 215, 0, 216, 0, 217,
831
+ 0, 565, 177, 177, 177, 565, 188, 0,
832
+ 219, 222, 0, 220, 0, 221, 221, 0,
833
+ 221, 214, 218, 221, 0, 223, 0, 217,
834
+ 0, 206, 225, 206, 0, 226, 28, 0,
835
+ 206, 0, 228, 231, 235, 0, 229, 0,
836
+ 230, 0, 206, 0, 232, 0, 233, 0,
837
+ 234, 0, 204, 0, 236, 0, 237, 0,
838
+ 204, 0, 206, 239, 0, 240, 0, 241,
839
+ 241, 0, 241, 242, 241, 0, 243, 0,
840
+ 226, 0, 38, 245, 0, 196, 58, 196,
841
+ 0, 247, 0, 248, 0, 249, 0, 250,
842
+ 0, 204, 0, 252, 170, 0, 253, 0,
843
+ 204, 0, 255, 0, 210, 0, 228, 0,
844
+ 564, 177, 177, 185, 177, 257, 564, 188,
845
+ 257, 257, 0, 252, 0, 175, 261, 0,
846
+ 126, 0, 144, 0, 561, 93, 93, 101,
847
+ 93, 263, 561, 104, 263, 263, 0, 168,
848
+ 0, 91, 567, 266, 567, 266, 266, 0,
849
+ 170, 0, 269, 0, 270, 0, 271, 0,
850
+ 1, 2, 272, 1, 272, 272, 0, 568,
851
+ 272, 568, 272, 272, 0, 274, 0, 275,
852
+ 275, 0, 275, 276, 275, 276, 276, 0,
853
+ 551, 276, 551, 276, 276, 0, 278, 0,
854
+ 279, 0, 280, 0, 281, 0, 282, 282,
855
+ 0, 282, 283, 286, 297, 299, 305, 365,
856
+ 282, 306, 365, 365, 0, 284, 367, 283,
857
+ 569, 285, 285, 285, 569, 296, 0, 282,
858
+ 283, 286, 297, 299, 305, 365, 282, 306,
859
+ 365, 365, 0, 287, 0, 289, 291, 0,
860
+ 288, 289, 291, 292, 288, 288, 290, 289,
861
+ 289, 288, 569, 285, 285, 293, 285, 569,
862
+ 296, 0, 294, 295, 294, 295, 295, 0,
863
+ 294, 295, 294, 295, 295, 0, 569, 285,
864
+ 285, 293, 285, 295, 569, 296, 295, 295,
865
+ 0, 282, 283, 286, 297, 299, 305, 285,
866
+ 365, 282, 306, 365, 365, 0, 284, 298,
867
+ 297, 297, 299, 300, 299, 0, 570, 285,
868
+ 285, 285, 570, 296, 0, 302, 0, 303,
869
+ 0, 304, 304, 0, 304, 283, 286, 297,
870
+ 299, 305, 309, 304, 306, 309, 309, 0,
871
+ 306, 0, 569, 285, 285, 307, 285, 569,
872
+ 306, 296, 0, 308, 0, 569, 285, 285,
873
+ 285, 569, 308, 296, 0, 571, 285, 285,
874
+ 293, 285, 309, 571, 296, 309, 309, 0,
875
+ 311, 0, 312, 0, 570, 285, 285, 285,
876
+ 300, 570, 296, 0, 314, 0, 282, 282,
877
+ 0, 314, 17, 314, 0, 317, 0, 318,
878
+ 0, 312, 0, 274, 320, 0, 321, 321,
879
+ 0, 321, 322, 326, 321, 0, 323, 0,
880
+ 324, 0, 325, 0, 570, 285, 285, 285,
881
+ 570, 296, 0, 327, 330, 0, 328, 0,
882
+ 329, 329, 0, 329, 322, 326, 329, 0,
883
+ 331, 0, 325, 0, 314, 333, 314, 0,
884
+ 334, 28, 0, 314, 0, 336, 339, 343,
885
+ 0, 337, 0, 338, 0, 314, 0, 340,
886
+ 0, 341, 0, 342, 0, 312, 0, 344,
887
+ 0, 345, 0, 312, 0, 314, 347, 0,
888
+ 348, 0, 349, 349, 0, 349, 350, 349,
889
+ 0, 351, 0, 334, 0, 38, 353, 0,
890
+ 304, 58, 304, 0, 355, 0, 356, 0,
891
+ 357, 0, 358, 0, 312, 0, 360, 170,
892
+ 0, 361, 0, 312, 0, 363, 0, 318,
893
+ 0, 336, 0, 569, 285, 285, 293, 285,
894
+ 365, 569, 296, 365, 365, 0, 360, 0,
895
+ 283, 368, 369, 373, 384, 386, 420, 424,
896
+ 368, 421, 424, 424, 0, 370, 449, 369,
897
+ 371, 572, 372, 372, 372, 371, 383, 0,
898
+ 371, 572, 372, 372, 372, 389, 425, 392,
899
+ 393, 428, 394, 407, 431, 414, 419, 439,
900
+ 444, 447, 371, 383, 0, 368, 369, 373,
901
+ 384, 386, 420, 424, 368, 421, 424, 424,
902
+ 0, 374, 0, 376, 378, 0, 375, 376,
903
+ 378, 379, 375, 375, 377, 376, 376, 375,
904
+ 371, 572, 372, 372, 380, 372, 371, 383,
905
+ 0, 381, 382, 381, 382, 382, 0, 381,
906
+ 382, 381, 382, 382, 0, 371, 572, 372,
907
+ 372, 380, 372, 382, 371, 383, 382, 382,
908
+ 0, 368, 369, 373, 384, 386, 420, 372,
909
+ 424, 368, 421, 424, 424, 0, 370, 385,
910
+ 384, 384, 386, 387, 386, 0, 388, 572,
911
+ 372, 372, 372, 388, 383, 0, 388, 572,
912
+ 372, 372, 372, 389, 392, 393, 394, 407,
913
+ 410, 414, 419, 388, 383, 0, 390, 0,
914
+ 391, 0, 368, 368, 0, 391, 0, 391,
915
+ 391, 0, 395, 0, 396, 396, 0, 396,
916
+ 397, 401, 396, 0, 398, 0, 399, 0,
917
+ 400, 0, 388, 572, 372, 372, 372, 388,
918
+ 383, 0, 402, 405, 0, 403, 0, 404,
919
+ 404, 0, 404, 397, 401, 404, 0, 406,
920
+ 0, 400, 0, 391, 408, 391, 0, 409,
921
+ 0, 391, 0, 411, 0, 412, 0, 413,
922
+ 0, 391, 0, 391, 415, 0, 416, 0,
923
+ 417, 417, 0, 417, 418, 417, 0, 408,
924
+ 0, 391, 0, 421, 0, 371, 572, 372,
925
+ 372, 422, 372, 371, 421, 383, 0, 423,
926
+ 0, 371, 572, 372, 372, 372, 371, 423,
927
+ 383, 0, 371, 572, 372, 372, 380, 372,
928
+ 424, 371, 383, 424, 424, 0, 426, 0,
929
+ 427, 0, 388, 572, 372, 372, 372, 387,
930
+ 388, 383, 0, 429, 0, 430, 0, 427,
931
+ 0, 411, 432, 436, 0, 433, 0, 434,
932
+ 0, 435, 0, 427, 0, 437, 0, 438,
933
+ 0, 427, 0, 440, 0, 441, 0, 442,
934
+ 0, 443, 0, 427, 0, 445, 0, 446,
935
+ 0, 427, 0, 448, 0, 430, 0, 369,
936
+ 450, 451, 458, 450, 458, 458, 0, 451,
937
+ 452, 451, 0, 453, 573, 453, 0, 453,
938
+ 573, 454, 453, 0, 455, 0, 456, 0,
939
+ 457, 0, 450, 451, 458, 450, 458, 458,
940
+ 0, 459, 573, 458, 459, 458, 458, 0,
941
+ 459, 573, 454, 460, 464, 459, 0, 461,
942
+ 0, 462, 462, 0, 462, 463, 462, 463,
943
+ 463, 0, 453, 573, 463, 453, 463, 463,
944
+ 0, 465, 0, 466, 0, 467, 0, 468,
945
+ 0, 469, 469, 0, 469, 470, 474, 485,
946
+ 487, 521, 525, 469, 522, 525, 525, 0,
947
+ 471, 550, 470, 472, 573, 473, 473, 473,
948
+ 472, 484, 0, 472, 573, 473, 473, 473,
949
+ 490, 526, 493, 454, 494, 529, 495, 508,
950
+ 532, 515, 520, 540, 545, 548, 472, 484,
951
+ 0, 469, 470, 474, 485, 487, 521, 525,
952
+ 469, 522, 525, 525, 0, 475, 0, 477,
953
+ 479, 0, 476, 477, 479, 480, 476, 476,
954
+ 478, 477, 477, 476, 472, 573, 473, 473,
955
+ 481, 473, 472, 484, 0, 482, 483, 482,
956
+ 483, 483, 0, 482, 483, 482, 483, 483,
957
+ 0, 472, 573, 473, 473, 481, 473, 483,
958
+ 472, 484, 483, 483, 0, 469, 470, 474,
959
+ 485, 487, 521, 473, 525, 469, 522, 525,
960
+ 525, 0, 471, 486, 485, 485, 487, 488,
961
+ 487, 0, 489, 573, 473, 473, 473, 489,
962
+ 484, 0, 489, 573, 473, 473, 473, 490,
963
+ 493, 454, 494, 495, 508, 511, 515, 520,
964
+ 489, 484, 0, 491, 0, 492, 0, 469,
965
+ 469, 0, 492, 0, 492, 492, 0, 461,
966
+ 496, 0, 497, 497, 0, 497, 498, 502,
967
+ 497, 0, 499, 0, 500, 0, 501, 0,
968
+ 489, 573, 473, 473, 473, 489, 484, 0,
969
+ 503, 506, 0, 504, 0, 505, 505, 0,
970
+ 505, 498, 502, 505, 0, 507, 0, 501,
971
+ 0, 492, 509, 492, 0, 510, 0, 492,
972
+ 0, 512, 0, 513, 0, 514, 0, 492,
973
+ 0, 492, 516, 0, 517, 0, 518, 518,
974
+ 0, 518, 519, 518, 0, 509, 0, 492,
975
+ 0, 522, 0, 472, 573, 473, 473, 523,
976
+ 473, 472, 522, 484, 0, 524, 0, 472,
977
+ 573, 473, 473, 473, 472, 524, 484, 0,
978
+ 472, 573, 473, 473, 481, 473, 525, 472,
979
+ 484, 525, 525, 0, 527, 0, 528, 0,
980
+ 489, 573, 473, 473, 473, 488, 489, 484,
981
+ 0, 530, 0, 531, 0, 528, 0, 512,
982
+ 533, 537, 0, 534, 0, 535, 0, 536,
983
+ 0, 528, 0, 538, 0, 539, 0, 528,
984
+ 0, 541, 0, 542, 0, 543, 0, 544,
985
+ 0, 528, 0, 546, 0, 547, 0, 528,
986
+ 0, 549, 0, 531, 0, 470, 551, 4,
987
+ 268, 16, 26, 83, 46, 551, 0, 552,
988
+ 4, 10, 16, 26, 83, 46, 552, 0,
989
+ 553, 4, 10, 16, 79, 26, 83, 46,
990
+ 85, 553, 0, 554, 24, 26, 56, 46,
991
+ 554, 0, 555, 34, 37, 46, 555, 0,
992
+ 556, 37, 46, 556, 0, 557, 46, 557,
993
+ 0, 558, 558, 0, 559, 64, 66, 69,
994
+ 70, 72, 26, 37, 46, 559, 0, 560,
995
+ 64, 26, 37, 46, 560, 0, 561, 93,
996
+ 93, 93, 109, 118, 121, 10, 123, 124,
997
+ 127, 140, 143, 154, 160, 46, 162, 264,
998
+ 260, 561, 104, 0, 562, 93, 93, 93,
999
+ 109, 121, 10, 123, 127, 140, 262, 154,
1000
+ 160, 46, 562, 104, 0, 563, 93, 93,
1001
+ 93, 109, 118, 121, 10, 123, 124, 127,
1002
+ 140, 143, 154, 160, 46, 162, 167, 260,
1003
+ 563, 104, 0, 564, 177, 177, 177, 193,
1004
+ 202, 205, 10, 207, 208, 211, 224, 227,
1005
+ 238, 244, 46, 246, 258, 254, 564, 188,
1006
+ 0, 565, 177, 177, 177, 193, 205, 10,
1007
+ 207, 211, 224, 256, 238, 244, 46, 565,
1008
+ 188, 0, 566, 177, 177, 177, 193, 202,
1009
+ 205, 10, 207, 208, 211, 224, 227, 238,
1010
+ 244, 46, 246, 251, 254, 566, 188, 0,
1011
+ 567, 4, 10, 16, 79, 26, 83, 46,
1012
+ 267, 567, 0, 568, 4, 268, 16, 273,
1013
+ 26, 83, 46, 277, 568, 0, 569, 285,
1014
+ 285, 285, 301, 310, 313, 268, 315, 316,
1015
+ 319, 332, 335, 346, 352, 46, 354, 366,
1016
+ 362, 569, 296, 0, 570, 285, 285, 285,
1017
+ 301, 313, 268, 315, 319, 332, 364, 346,
1018
+ 352, 46, 570, 296, 0, 571, 285, 285,
1019
+ 285, 301, 310, 313, 268, 315, 316, 319,
1020
+ 332, 335, 346, 352, 46, 354, 359, 362,
1021
+ 571, 296, 0, 0, 0, 0
1022
+ };
1023
+
1024
+ static const unsigned char _querybuilder_trans_actions[] = {
1025
+ 0, 37, 1, 0, 1, 1, 0, 0,
1026
+ 0, 0, 0, 0, 0, 59, 1, 0,
1027
+ 1, 0, 57, 57, 0, 0, 37, 1,
1028
+ 0, 1, 1, 0, 0, 0, 0, 0,
1029
+ 0, 0, 59, 0, 0, 0, 0, 0,
1030
+ 0, 55, 163, 160, 55, 160, 160, 0,
1031
+ 0, 37, 1, 0, 1, 1, 0, 23,
1032
+ 1, 23, 1, 1, 59, 0, 0, 0,
1033
+ 0, 0, 0, 0, 0, 0, 0, 0,
1034
+ 0, 0, 0, 0, 0, 0, 53, 157,
1035
+ 53, 157, 157, 0, 0, 1, 0, 1,
1036
+ 1, 0, 13, 13, 13, 1, 13, 1,
1037
+ 1, 59, 0, 0, 0, 0, 0, 0,
1038
+ 0, 0, 49, 151, 49, 151, 0, 0,
1039
+ 1, 0, 1, 0, 1, 0, 9, 9,
1040
+ 9, 1, 59, 0, 1, 0, 1, 0,
1041
+ 1, 0, 9, 9, 1, 59, 0, 0,
1042
+ 0, 0, 0, 0, 0, 0, 0, 0,
1043
+ 43, 145, 43, 145, 0, 0, 1, 0,
1044
+ 1, 0, 1, 0, 9, 9, 1, 59,
1045
+ 0, 0, 0, 0, 0, 0, 0, 0,
1046
+ 0, 0, 0, 0, 0, 0, 47, 148,
1047
+ 47, 148, 148, 0, 0, 1, 0, 1,
1048
+ 1, 0, 45, 1, 45, 1, 1, 59,
1049
+ 0, 0, 0, 0, 0, 0, 0, 0,
1050
+ 0, 0, 0, 0, 0, 0, 0, 0,
1051
+ 0, 0, 51, 154, 51, 154, 154, 0,
1052
+ 0, 1, 0, 1, 1, 0, 13, 13,
1053
+ 13, 1, 13, 1, 1, 59, 1, 0,
1054
+ 1, 0, 21, 21, 21, 59, 1, 0,
1055
+ 1, 0, 1, 0, 1, 0, 19, 109,
1056
+ 19, 109, 109, 0, 0, 1, 0, 1,
1057
+ 1, 0, 15, 15, 15, 1, 15, 1,
1058
+ 1, 59, 19, 109, 19, 109, 109, 0,
1059
+ 0, 1, 0, 1, 1, 0, 15, 15,
1060
+ 15, 1, 15, 1, 1, 59, 0, 0,
1061
+ 0, 0, 0, 0, 1, 0, 1, 1,
1062
+ 0, 41, 1, 41, 1, 1, 59, 0,
1063
+ 1, 0, 57, 0, 57, 0, 0, 0,
1064
+ 0, 0, 0, 0, 0, 0, 31, 31,
1065
+ 0, 0, 0, 0, 0, 33, 1, 1,
1066
+ 0, 1, 1, 1, 0, 5, 0, 1,
1067
+ 0, 1, 1, 1, 0, 1, 59, 25,
1068
+ 25, 25, 25, 121, 118, 118, 25, 118,
1069
+ 118, 118, 0, 0, 0, 1, 0, 0,
1070
+ 1, 1, 0, 7, 1, 1, 1, 1,
1071
+ 1, 1, 0, 1, 1, 0, 1, 0,
1072
+ 1, 59, 19, 109, 19, 109, 109, 0,
1073
+ 0, 1, 0, 1, 1, 0, 15, 91,
1074
+ 91, 15, 91, 1, 15, 91, 1, 1,
1075
+ 59, 25, 25, 25, 25, 121, 118, 1,
1076
+ 118, 25, 118, 118, 118, 0, 3, 0,
1077
+ 1, 1, 0, 0, 0, 0, 0, 1,
1078
+ 1, 1, 0, 1, 59, 1, 0, 1,
1079
+ 0, 166, 166, 0, 0, 0, 0, 0,
1080
+ 139, 1, 1, 0, 1, 1, 1, 0,
1081
+ 1, 0, 9, 61, 61, 1, 61, 9,
1082
+ 1, 61, 59, 1, 0, 11, 70, 70,
1083
+ 70, 11, 1, 70, 59, 112, 79, 79,
1084
+ 13, 79, 1, 112, 79, 1, 1, 59,
1085
+ 1, 0, 1, 0, 29, 127, 127, 127,
1086
+ 29, 29, 127, 59, 1, 0, 25, 25,
1087
+ 0, 1, 0, 1, 0, 1, 0, 1,
1088
+ 0, 1, 0, 0, 0, 0, 27, 27,
1089
+ 0, 0, 1, 1, 0, 0, 1, 0,
1090
+ 1, 0, 1, 0, 17, 100, 100, 100,
1091
+ 17, 100, 59, 1, 1, 0, 1, 0,
1092
+ 1, 1, 0, 1, 1, 1, 1, 0,
1093
+ 1, 0, 1, 0, 1, 1, 1, 0,
1094
+ 1, 0, 0, 1, 0, 1, 1, 1,
1095
+ 0, 1, 0, 1, 0, 1, 0, 1,
1096
+ 0, 1, 0, 1, 0, 1, 0, 1,
1097
+ 0, 1, 0, 1, 0, 1, 1, 0,
1098
+ 1, 0, 25, 25, 0, 0, 1, 0,
1099
+ 0, 1, 0, 1, 0, 0, 1, 0,
1100
+ 166, 0, 166, 0, 1, 0, 1, 0,
1101
+ 1, 0, 1, 0, 1, 0, 1, 0,
1102
+ 0, 1, 0, 1, 0, 0, 0, 0,
1103
+ 0, 0, 0, 31, 31, 0, 0, 0,
1104
+ 0, 0, 33, 1, 1, 0, 1, 1,
1105
+ 1, 0, 5, 0, 1, 0, 1, 1,
1106
+ 1, 0, 1, 59, 25, 25, 25, 25,
1107
+ 121, 118, 118, 25, 118, 118, 118, 0,
1108
+ 0, 0, 1, 0, 0, 1, 1, 0,
1109
+ 7, 1, 1, 1, 1, 1, 1, 0,
1110
+ 1, 1, 0, 1, 0, 1, 59, 19,
1111
+ 109, 19, 109, 109, 0, 0, 1, 0,
1112
+ 1, 1, 0, 15, 91, 91, 15, 91,
1113
+ 1, 15, 91, 1, 1, 59, 25, 25,
1114
+ 25, 25, 121, 118, 1, 118, 25, 118,
1115
+ 118, 118, 0, 3, 0, 1, 1, 0,
1116
+ 0, 0, 0, 0, 1, 1, 1, 0,
1117
+ 1, 59, 1, 0, 1, 0, 166, 166,
1118
+ 0, 0, 0, 0, 0, 136, 1, 1,
1119
+ 0, 1, 1, 1, 0, 1, 0, 9,
1120
+ 61, 61, 1, 61, 9, 1, 61, 59,
1121
+ 1, 0, 11, 70, 70, 70, 11, 1,
1122
+ 70, 59, 112, 79, 79, 13, 79, 1,
1123
+ 112, 79, 1, 1, 59, 1, 0, 1,
1124
+ 0, 29, 127, 127, 127, 29, 29, 127,
1125
+ 59, 1, 0, 25, 25, 0, 1, 0,
1126
+ 1, 0, 1, 0, 1, 0, 1, 0,
1127
+ 0, 0, 0, 27, 27, 0, 0, 1,
1128
+ 1, 0, 0, 1, 0, 1, 0, 1,
1129
+ 0, 17, 100, 100, 100, 17, 100, 59,
1130
+ 1, 1, 0, 1, 0, 1, 1, 0,
1131
+ 1, 1, 1, 1, 0, 1, 0, 1,
1132
+ 0, 1, 1, 1, 0, 1, 0, 0,
1133
+ 1, 0, 1, 1, 1, 0, 1, 0,
1134
+ 1, 0, 1, 0, 1, 0, 1, 0,
1135
+ 1, 0, 1, 0, 1, 0, 1, 0,
1136
+ 1, 0, 1, 1, 0, 1, 0, 25,
1137
+ 25, 0, 0, 1, 0, 0, 1, 0,
1138
+ 1, 0, 0, 1, 0, 166, 0, 166,
1139
+ 0, 1, 0, 1, 0, 1, 0, 1,
1140
+ 0, 1, 0, 1, 0, 0, 1, 0,
1141
+ 1, 0, 1, 0, 1, 0, 1, 0,
1142
+ 13, 79, 79, 13, 79, 1, 13, 79,
1143
+ 1, 1, 59, 1, 0, 1, 1, 0,
1144
+ 1, 0, 1, 0, 13, 79, 79, 13,
1145
+ 79, 1, 13, 79, 1, 1, 59, 1,
1146
+ 0, 1, 23, 1, 23, 1, 1, 59,
1147
+ 0, 0, 0, 0, 0, 0, 0, 0,
1148
+ 55, 163, 160, 55, 160, 160, 0, 23,
1149
+ 1, 23, 1, 1, 59, 0, 0, 0,
1150
+ 0, 0, 0, 1, 0, 1, 1, 0,
1151
+ 41, 1, 41, 1, 1, 59, 0, 0,
1152
+ 0, 0, 0, 0, 0, 0, 31, 31,
1153
+ 0, 0, 0, 0, 0, 33, 1, 1,
1154
+ 0, 1, 1, 1, 0, 5, 0, 1,
1155
+ 0, 1, 1, 1, 0, 1, 59, 25,
1156
+ 25, 25, 25, 121, 118, 118, 25, 118,
1157
+ 118, 118, 0, 0, 0, 1, 0, 0,
1158
+ 1, 1, 0, 7, 1, 1, 1, 1,
1159
+ 1, 1, 0, 1, 1, 0, 1, 0,
1160
+ 1, 59, 19, 109, 19, 109, 109, 0,
1161
+ 0, 1, 0, 1, 1, 0, 15, 91,
1162
+ 91, 15, 91, 1, 15, 91, 1, 1,
1163
+ 59, 25, 25, 25, 25, 121, 118, 1,
1164
+ 118, 25, 118, 118, 118, 0, 3, 0,
1165
+ 1, 1, 0, 0, 0, 0, 0, 1,
1166
+ 1, 1, 0, 1, 59, 1, 0, 1,
1167
+ 0, 124, 124, 0, 0, 0, 0, 0,
1168
+ 136, 1, 1, 0, 1, 1, 1, 0,
1169
+ 1, 0, 9, 61, 61, 1, 61, 9,
1170
+ 1, 61, 59, 1, 0, 11, 70, 70,
1171
+ 70, 11, 1, 70, 59, 82, 79, 79,
1172
+ 13, 79, 1, 82, 79, 1, 1, 59,
1173
+ 1, 0, 1, 0, 29, 127, 127, 127,
1174
+ 29, 29, 127, 59, 1, 0, 25, 25,
1175
+ 0, 1, 0, 1, 0, 1, 0, 1,
1176
+ 0, 1, 0, 0, 0, 0, 27, 27,
1177
+ 0, 0, 1, 1, 0, 0, 1, 0,
1178
+ 1, 0, 1, 0, 17, 100, 100, 100,
1179
+ 17, 100, 59, 1, 1, 0, 1, 0,
1180
+ 1, 1, 0, 1, 1, 1, 1, 0,
1181
+ 1, 0, 1, 0, 1, 1, 1, 0,
1182
+ 1, 0, 0, 1, 0, 1, 1, 1,
1183
+ 0, 1, 0, 1, 0, 1, 0, 1,
1184
+ 0, 1, 0, 1, 0, 1, 0, 1,
1185
+ 0, 1, 0, 1, 0, 1, 1, 0,
1186
+ 1, 0, 25, 25, 0, 0, 1, 0,
1187
+ 0, 1, 0, 1, 0, 0, 1, 0,
1188
+ 124, 0, 124, 0, 1, 0, 1, 0,
1189
+ 1, 0, 1, 0, 1, 0, 1, 0,
1190
+ 0, 1, 0, 1, 0, 1, 0, 1,
1191
+ 0, 1, 0, 13, 79, 79, 13, 79,
1192
+ 1, 13, 79, 1, 1, 59, 1, 0,
1193
+ 1, 0, 0, 0, 0, 33, 1, 1,
1194
+ 0, 1, 1, 1, 0, 5, 0, 1,
1195
+ 0, 35, 1, 1, 1, 0, 1, 0,
1196
+ 0, 35, 1, 1, 1, 1, 1, 1,
1197
+ 1, 1, 0, 1, 1, 1, 1, 1,
1198
+ 1, 1, 0, 1, 0, 25, 25, 25,
1199
+ 25, 121, 118, 118, 25, 118, 118, 118,
1200
+ 0, 0, 0, 1, 0, 0, 1, 1,
1201
+ 0, 7, 1, 1, 1, 1, 1, 1,
1202
+ 0, 35, 1, 1, 0, 1, 0, 1,
1203
+ 0, 19, 109, 19, 109, 109, 0, 0,
1204
+ 1, 0, 1, 1, 0, 15, 94, 91,
1205
+ 91, 15, 91, 1, 15, 91, 1, 1,
1206
+ 0, 25, 25, 25, 25, 121, 118, 1,
1207
+ 118, 25, 118, 118, 118, 0, 3, 0,
1208
+ 1, 1, 0, 0, 0, 0, 0, 35,
1209
+ 1, 1, 1, 0, 1, 0, 0, 35,
1210
+ 1, 1, 1, 1, 1, 1, 0, 1,
1211
+ 1, 1, 1, 0, 1, 0, 1, 0,
1212
+ 1, 0, 25, 25, 0, 1, 0, 1,
1213
+ 1, 0, 0, 0, 27, 27, 0, 0,
1214
+ 1, 1, 0, 0, 1, 0, 1, 0,
1215
+ 1, 0, 17, 103, 100, 100, 100, 17,
1216
+ 100, 0, 1, 1, 0, 1, 0, 1,
1217
+ 1, 0, 1, 1, 1, 1, 0, 1,
1218
+ 0, 1, 0, 1, 1, 1, 0, 1,
1219
+ 0, 1, 0, 1, 0, 1, 0, 1,
1220
+ 0, 1, 0, 1, 1, 0, 1, 0,
1221
+ 25, 25, 0, 0, 1, 0, 0, 1,
1222
+ 0, 1, 0, 1, 0, 9, 64, 61,
1223
+ 61, 1, 61, 9, 1, 61, 0, 1,
1224
+ 0, 11, 73, 70, 70, 70, 11, 1,
1225
+ 70, 0, 13, 85, 79, 79, 13, 79,
1226
+ 1, 13, 79, 1, 1, 0, 1, 0,
1227
+ 1, 0, 29, 130, 127, 127, 127, 29,
1228
+ 29, 127, 0, 1, 0, 1, 0, 1,
1229
+ 0, 1, 1, 1, 0, 1, 0, 1,
1230
+ 0, 1, 0, 1, 0, 1, 0, 1,
1231
+ 0, 1, 0, 1, 0, 1, 0, 1,
1232
+ 0, 1, 0, 1, 0, 1, 0, 1,
1233
+ 0, 1, 0, 1, 0, 1, 0, 1,
1234
+ 0, 37, 1, 0, 1, 1, 0, 0,
1235
+ 0, 0, 0, 0, 39, 0, 0, 0,
1236
+ 39, 0, 0, 0, 0, 0, 0, 0,
1237
+ 0, 0, 55, 163, 160, 55, 160, 160,
1238
+ 0, 23, 115, 1, 23, 1, 1, 0,
1239
+ 0, 39, 0, 0, 0, 0, 0, 0,
1240
+ 0, 0, 0, 0, 0, 1, 0, 1,
1241
+ 1, 0, 41, 142, 1, 41, 1, 1,
1242
+ 0, 0, 0, 0, 0, 0, 0, 0,
1243
+ 0, 31, 31, 0, 0, 0, 0, 0,
1244
+ 33, 1, 1, 0, 1, 1, 1, 0,
1245
+ 5, 0, 1, 0, 39, 1, 1, 1,
1246
+ 0, 1, 0, 0, 39, 1, 1, 1,
1247
+ 1, 1, 1, 0, 1, 1, 0, 1,
1248
+ 1, 1, 1, 1, 1, 1, 0, 1,
1249
+ 0, 25, 25, 25, 25, 121, 118, 118,
1250
+ 25, 118, 118, 118, 0, 0, 0, 1,
1251
+ 0, 0, 1, 1, 0, 7, 1, 1,
1252
+ 1, 1, 1, 1, 0, 39, 1, 1,
1253
+ 0, 1, 0, 1, 0, 19, 109, 19,
1254
+ 109, 109, 0, 0, 1, 0, 1, 1,
1255
+ 0, 15, 97, 91, 91, 15, 91, 1,
1256
+ 15, 91, 1, 1, 0, 25, 25, 25,
1257
+ 25, 121, 118, 1, 118, 25, 118, 118,
1258
+ 118, 0, 3, 0, 1, 1, 0, 0,
1259
+ 0, 0, 0, 39, 1, 1, 1, 0,
1260
+ 1, 0, 0, 39, 1, 1, 1, 1,
1261
+ 1, 0, 1, 0, 1, 1, 1, 1,
1262
+ 0, 1, 0, 1, 0, 1, 0, 25,
1263
+ 25, 0, 1, 0, 1, 1, 0, 0,
1264
+ 0, 0, 27, 27, 0, 0, 1, 1,
1265
+ 0, 0, 1, 0, 1, 0, 1, 0,
1266
+ 17, 106, 100, 100, 100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0,
1371
+ 0, 0, 0, 0, 0, 0, 0, 0,
1372
+ 0, 0, 0, 0, 0, 0, 0, 0,
1373
+ 0, 0, 0, 0, 0, 0, 0, 0,
1374
+ 0, 0, 0, 0, 0, 0, 0, 0,
1375
+ 0, 0, 0, 0, 0, 0, 0, 0,
1376
+ 0, 0, 0, 0, 0, 0, 0, 0,
1377
+ 0, 0, 0, 0, 0, 0, 0, 0,
1378
+ 0, 0, 0, 0, 0, 0, 0, 0,
1379
+ 0, 0, 0, 0, 0, 0, 0, 0,
1380
+ 0, 0, 0, 0, 0, 0, 0, 0,
1381
+ 0, 0, 0, 0, 0, 0, 0, 0,
1382
+ 0, 0, 0, 0, 0, 0, 0, 0,
1383
+ 0, 0, 0, 0, 0, 0, 0, 0,
1384
+ 0, 0, 0, 0, 0, 0, 0, 0,
1385
+ 0, 0, 0, 0, 0, 0, 0, 0,
1386
+ 0, 0, 0, 0, 0, 0, 0, 0,
1387
+ 0, 0, 0, 0, 0, 0, 0, 0,
1388
+ 0, 0, 0, 0, 0, 0, 0, 0,
1389
+ 0, 0, 0, 0, 0, 0, 0, 0,
1390
+ 0, 0, 0, 0, 0, 0, 0, 0,
1391
+ 0, 0, 0, 0, 0, 0, 0, 0,
1392
+ 0, 0, 0, 0, 0, 0, 0, 0,
1393
+ 0, 0, 0, 0, 0, 0, 0, 0,
1394
+ 0, 0, 0, 0, 0, 0
1395
+ };
1396
+
1397
+ static const int querybuilder_start = 1;
1398
+ static const int querybuilder_first_final = 551;
1399
+ static const int querybuilder_error = 0;
1400
+
1401
+ static const int querybuilder_en_expr_p = 368;
1402
+ static const int querybuilder_en_clause_p = 450;
1403
+ static const int querybuilder_en_main = 1;
1404
+
1405
+
1406
+ #line 369 "querybuilder_ext.rl"
1407
+
1408
+ #define CLAUSE_RELATION 1
1409
+ #define CLAUSE_PARENTHESIS 2
1410
+ #define CLAUSE_FILTER 4
1411
+
1412
+ VALUE rb_parse(VALUE self, VALUE arg) {
1413
+ VALUE stack, last, tmp;
1414
+ // if string.kind_of?(Array) // rb_type(string) == T_ARRAY
1415
+ if (rb_type(arg) == T_ARRAY) {
1416
+ // data = "(#{arg.join(') or (')})\n"
1417
+ tmp = rb_str_new2("(");
1418
+ rb_str_append(tmp, rb_ary_join(arg, rb_str_new2(") or (")));
1419
+ rb_str_append(tmp, rb_str_new2(")\n"));
1420
+ } else if (rb_type(arg) == T_STRING) {
1421
+ // data = "#{arg}\n"
1422
+ tmp = rb_str_plus(arg, rb_str_new2("\n"));
1423
+ } else {
1424
+ rb_raise(rb_SyntaxError, "Bad element type: Parser only accepts strings.");
1425
+ }
1426
+ const char * data = RSTRING_PTR(tmp);
1427
+
1428
+ int cs;
1429
+ const char * p = data;
1430
+ const char * pe = data + RSTRING_LEN(tmp);
1431
+ const char * eof = pe;
1432
+ const char * str_a = NULL;
1433
+
1434
+ // last = [:query]
1435
+ last = rb_ary_new();
1436
+ rb_ary_push(last, _query);
1437
+ // stack = [last]
1438
+ stack = rb_ary_new();
1439
+ rb_ary_push(stack, last);
1440
+
1441
+ /* clause_state = :relation */
1442
+ int clause_state = CLAUSE_RELATION;
1443
+
1444
+
1445
+
1446
+ #line 1447 "querybuilder_ext.c"
1447
+ {
1448
+ cs = querybuilder_start;
1449
+ }
1450
+
1451
+ #line 408 "querybuilder_ext.rl"
1452
+
1453
+ #line 1454 "querybuilder_ext.c"
1454
+ {
1455
+ int _klen;
1456
+ unsigned int _trans;
1457
+ const char *_acts;
1458
+ unsigned int _nacts;
1459
+ const char *_keys;
1460
+
1461
+ if ( p == pe )
1462
+ goto _test_eof;
1463
+ if ( cs == 0 )
1464
+ goto _out;
1465
+ _resume:
1466
+ _keys = _querybuilder_trans_keys + _querybuilder_key_offsets[cs];
1467
+ _trans = _querybuilder_index_offsets[cs];
1468
+
1469
+ _klen = _querybuilder_single_lengths[cs];
1470
+ if ( _klen > 0 ) {
1471
+ const char *_lower = _keys;
1472
+ const char *_mid;
1473
+ const char *_upper = _keys + _klen - 1;
1474
+ while (1) {
1475
+ if ( _upper < _lower )
1476
+ break;
1477
+
1478
+ _mid = _lower + ((_upper-_lower) >> 1);
1479
+ if ( (*p) < *_mid )
1480
+ _upper = _mid - 1;
1481
+ else if ( (*p) > *_mid )
1482
+ _lower = _mid + 1;
1483
+ else {
1484
+ _trans += (_mid - _keys);
1485
+ goto _match;
1486
+ }
1487
+ }
1488
+ _keys += _klen;
1489
+ _trans += _klen;
1490
+ }
1491
+
1492
+ _klen = _querybuilder_range_lengths[cs];
1493
+ if ( _klen > 0 ) {
1494
+ const char *_lower = _keys;
1495
+ const char *_mid;
1496
+ const char *_upper = _keys + (_klen<<1) - 2;
1497
+ while (1) {
1498
+ if ( _upper < _lower )
1499
+ break;
1500
+
1501
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
1502
+ if ( (*p) < _mid[0] )
1503
+ _upper = _mid - 2;
1504
+ else if ( (*p) > _mid[1] )
1505
+ _lower = _mid + 2;
1506
+ else {
1507
+ _trans += ((_mid - _keys)>>1);
1508
+ goto _match;
1509
+ }
1510
+ }
1511
+ _trans += _klen;
1512
+ }
1513
+
1514
+ _match:
1515
+ cs = _querybuilder_trans_targs[_trans];
1516
+
1517
+ if ( _querybuilder_trans_actions[_trans] == 0 )
1518
+ goto _again;
1519
+
1520
+ _acts = _querybuilder_actions + _querybuilder_trans_actions[_trans];
1521
+ _nacts = (unsigned int) *_acts++;
1522
+ while ( _nacts-- > 0 )
1523
+ {
1524
+ switch ( *_acts++ )
1525
+ {
1526
+ case 0:
1527
+ #line 111 "querybuilder_ext.rl"
1528
+ {
1529
+ if (str_a == NULL) str_a = p;
1530
+ }
1531
+ break;
1532
+ case 1:
1533
+ #line 115 "querybuilder_ext.rl"
1534
+ {
1535
+ if (str_a == NULL) str_a = p;
1536
+ SET_TMP_ARY(_string);
1537
+ rb_ary_push(last, tmp);
1538
+ }
1539
+ break;
1540
+ case 2:
1541
+ #line 121 "querybuilder_ext.rl"
1542
+ {
1543
+ if (str_a == NULL) str_a = p;
1544
+ SET_TMP_ARY(_dstring);
1545
+ rb_ary_push(last, tmp);
1546
+ }
1547
+ break;
1548
+ case 3:
1549
+ #line 127 "querybuilder_ext.rl"
1550
+ {
1551
+ SET_TMP_ARY(_rubyless);
1552
+ rb_ary_push(last, tmp);
1553
+ }
1554
+ break;
1555
+ case 4:
1556
+ #line 132 "querybuilder_ext.rl"
1557
+ {
1558
+ SET_TMP_ARY(_integer);
1559
+ rb_ary_push(last, tmp);
1560
+ }
1561
+ break;
1562
+ case 5:
1563
+ #line 137 "querybuilder_ext.rl"
1564
+ {
1565
+ SET_TMP_ARY(_real);
1566
+ rb_ary_push(last, tmp);
1567
+ }
1568
+ break;
1569
+ case 6:
1570
+ #line 142 "querybuilder_ext.rl"
1571
+ {
1572
+ SET_TMP_ARY(_field);
1573
+ rb_ary_push(last, tmp);
1574
+ }
1575
+ break;
1576
+ case 7:
1577
+ #line 147 "querybuilder_ext.rl"
1578
+ {
1579
+ SET_TMP_ARY(_method);
1580
+ rb_ary_push(last, tmp);
1581
+ }
1582
+ break;
1583
+ case 8:
1584
+ #line 152 "querybuilder_ext.rl"
1585
+ {
1586
+ SET_TMP_ARY(_raw);
1587
+ rb_ary_push(last, tmp);
1588
+ }
1589
+ break;
1590
+ case 9:
1591
+ #line 158 "querybuilder_ext.rl"
1592
+ {
1593
+ // last = apply_op(stack, :function)
1594
+ APPLY_OP(_function);
1595
+ // str_buf = ""
1596
+ str_a = NULL;
1597
+ }
1598
+ break;
1599
+ case 10:
1600
+ #line 165 "querybuilder_ext.rl"
1601
+ {
1602
+ SET_TMP_STR;
1603
+ tmp = ID2SYM(rb_to_id(rb_funcall(tmp, _downcase, 0)));
1604
+ // last = apply_op(stack, str_buf.downcase.to_sym, false)
1605
+ last = rb_funcall(self, _apply_op, 3, stack, tmp, Qfalse);
1606
+ }
1607
+ break;
1608
+ case 11:
1609
+ #line 172 "querybuilder_ext.rl"
1610
+ {
1611
+ // if clause_state == :relation || clause_state == :parenthesis
1612
+ // last = insert(stack, [:relation, str_buf])
1613
+ // str_buf = ""
1614
+ // end
1615
+ if (clause_state & (CLAUSE_RELATION | CLAUSE_PARENTHESIS)) {
1616
+ SET_TMP_ARY(_relation);
1617
+ last = rb_funcall(self, _insert, 2, stack, tmp);
1618
+ }
1619
+ }
1620
+ break;
1621
+ case 12:
1622
+ #line 183 "querybuilder_ext.rl"
1623
+ {
1624
+ SET_TMP_STR;
1625
+ tmp = ID2SYM(rb_to_id(rb_funcall(tmp, _downcase, 0)));
1626
+ APPLY_OP(tmp);
1627
+ // last = apply_op(stack, str_buf.downcase.to_sym)
1628
+ }
1629
+ break;
1630
+ case 13:
1631
+ #line 190 "querybuilder_ext.rl"
1632
+ {
1633
+ // We need the 'is' operator to avoid confusion with 'in site'.
1634
+ APPLY_OP(_is);
1635
+ // last = apply_op(stack, :is)
1636
+ }
1637
+ break;
1638
+ case 14:
1639
+ #line 196 "querybuilder_ext.rl"
1640
+ {
1641
+ // last = apply_op(stack, :interval)
1642
+ APPLY_OP(_interval);
1643
+ SET_TMP_STR;
1644
+ // last << str_buf
1645
+ rb_ary_push(last, tmp);
1646
+ }
1647
+ break;
1648
+ case 15:
1649
+ #line 204 "querybuilder_ext.rl"
1650
+ {
1651
+ // last = apply_op(stack, :filter)
1652
+ APPLY_OP(_filter);
1653
+ clause_state = CLAUSE_FILTER;
1654
+ }
1655
+ break;
1656
+ case 16:
1657
+ #line 210 "querybuilder_ext.rl"
1658
+ {
1659
+ // # remember current machine state 'cs'
1660
+ // last << [:par, cs]
1661
+ tmp = rb_ary_new();
1662
+ rb_ary_push(tmp, _par);
1663
+ rb_ary_push(tmp, INT2NUM(cs));
1664
+ rb_ary_push(last, tmp);
1665
+ // stack.push last.last
1666
+ rb_ary_push(stack, tmp);
1667
+ // last = last.last
1668
+ last = tmp;
1669
+ {cs = 368; goto _again;}
1670
+ }
1671
+ break;
1672
+ case 17:
1673
+ #line 224 "querybuilder_ext.rl"
1674
+ {
1675
+ // pop_stack(stack, :par_close)
1676
+ rb_funcall(self, _pop_stack, 2, stack, _par_close);
1677
+ // # reset machine state 'cs'
1678
+ // cs = stack.last.delete_at(1)
1679
+ tmp = rb_ary_entry(stack, -1);
1680
+ tmp = rb_ary_delete_at(tmp, 1);
1681
+ cs = NUM2INT(tmp);
1682
+ // # one more time to remove [:par...] line
1683
+ // stack.pop
1684
+ rb_ary_pop(stack);
1685
+ // last = stack.last
1686
+ last = rb_ary_entry(stack, -1);
1687
+ // # closing ')' must be parsed twice
1688
+ p--;
1689
+ }
1690
+ break;
1691
+ case 18:
1692
+ #line 241 "querybuilder_ext.rl"
1693
+ {
1694
+ clause_state = CLAUSE_PARENTHESIS;
1695
+ // # remember current machine state 'cs'
1696
+ // last << [:clause_par, cs]
1697
+ tmp = rb_ary_new();
1698
+ rb_ary_push(tmp, _clause_par);
1699
+ rb_ary_push(tmp, INT2NUM(cs));
1700
+ rb_ary_push(last, tmp);
1701
+ // stack.push last.last
1702
+ rb_ary_push(stack, tmp);
1703
+ // last = last.last
1704
+ last = tmp;
1705
+ {cs = 450; goto _again;}
1706
+ }
1707
+ break;
1708
+ case 19:
1709
+ #line 256 "querybuilder_ext.rl"
1710
+ {
1711
+ clause_state = CLAUSE_RELATION;
1712
+ // pop_stack(stack, :clause_par_close)
1713
+ rb_funcall(self, _pop_stack, 2, stack, _clause_par_close);
1714
+ // # reset machine state 'cs'
1715
+ // cs = stack.last.delete_at(1)
1716
+ tmp = rb_ary_entry(stack, -1);
1717
+ tmp = rb_ary_delete_at(tmp, 1);
1718
+ cs = NUM2INT(tmp);
1719
+ // # one more time to remove [:par...] line
1720
+ // stack.pop
1721
+ rb_ary_pop(stack);
1722
+ // last = stack.last
1723
+ last = rb_ary_entry(stack, -1);
1724
+ // # closing ')' must be parsed twice
1725
+ p--;
1726
+ }
1727
+ break;
1728
+ case 20:
1729
+ #line 274 "querybuilder_ext.rl"
1730
+ {
1731
+ // last = apply_op(stack, :scope)
1732
+ APPLY_OP(_scope);
1733
+ // last << str_buf
1734
+ SET_TMP_STR;
1735
+ rb_ary_push(last, tmp);
1736
+ }
1737
+ break;
1738
+ case 21:
1739
+ #line 282 "querybuilder_ext.rl"
1740
+ {
1741
+ // last = apply_op(stack, :offset)
1742
+ APPLY_OP(_offset);
1743
+ // str_buf = ""
1744
+ str_a = NULL;
1745
+ }
1746
+ break;
1747
+ case 22:
1748
+ #line 289 "querybuilder_ext.rl"
1749
+ {
1750
+ // last << [:param, str_buf]
1751
+ SET_TMP_ARY(_param);
1752
+ rb_ary_push(last, tmp);
1753
+ }
1754
+ break;
1755
+ case 23:
1756
+ #line 295 "querybuilder_ext.rl"
1757
+ {
1758
+ // last = apply_op(stack, :paginate)
1759
+ APPLY_OP(_paginate);
1760
+ // str_buf = ""
1761
+ str_a = NULL;
1762
+ }
1763
+ break;
1764
+ case 24:
1765
+ #line 302 "querybuilder_ext.rl"
1766
+ {
1767
+ // last = apply_op(stack, :limit)
1768
+ APPLY_OP(_limit);
1769
+ // str_buf = ""
1770
+ str_a = NULL;
1771
+ }
1772
+ break;
1773
+ case 25:
1774
+ #line 309 "querybuilder_ext.rl"
1775
+ {
1776
+ // last = apply_op(stack, :order)
1777
+ APPLY_OP(_order);
1778
+ // str_buf = ""
1779
+ str_a = NULL;
1780
+ }
1781
+ break;
1782
+ case 26:
1783
+ #line 316 "querybuilder_ext.rl"
1784
+ {
1785
+ // last = apply_op(stack, :group)
1786
+ APPLY_OP(_group);
1787
+ // str_buf = ""
1788
+ str_a = NULL;
1789
+ }
1790
+ break;
1791
+ case 27:
1792
+ #line 323 "querybuilder_ext.rl"
1793
+ {
1794
+ // last = apply_op(stack, :from)
1795
+ APPLY_OP(_from);
1796
+ // str_buf = ""
1797
+ str_a = NULL;
1798
+ clause_state = CLAUSE_RELATION;
1799
+ }
1800
+ break;
1801
+ case 28:
1802
+ #line 331 "querybuilder_ext.rl"
1803
+ {
1804
+ // if clause_state == :relation
1805
+ // last = apply_op(stack, "clause_#{str_buf}".to_sym)
1806
+ // str_buf = ""
1807
+ // end
1808
+ if (clause_state & CLAUSE_RELATION) {
1809
+ if (*str_a == 'a') {
1810
+ APPLY_OP(_clause_and);
1811
+ } else {
1812
+ APPLY_OP(_clause_or);
1813
+ }
1814
+ str_a = NULL;
1815
+ }
1816
+ }
1817
+ break;
1818
+ case 29:
1819
+ #line 354 "querybuilder_ext.rl"
1820
+ {
1821
+ p = p - 3;
1822
+ if (p < data) p = data;
1823
+ // raise QueryBuilder::SyntaxError.new("Syntax error near #{data[p..-1].chomp.inspect}.")
1824
+ rb_raise(rb_SyntaxError, "Syntax error near %s.", RSTRING_PTR(rb_str_inspect(rb_str_new(p , pe - p - 1))));
1825
+ }
1826
+ break;
1827
+ #line 1828 "querybuilder_ext.c"
1828
+ }
1829
+ }
1830
+
1831
+ _again:
1832
+ if ( cs == 0 )
1833
+ goto _out;
1834
+ if ( ++p != pe )
1835
+ goto _resume;
1836
+ _test_eof: {}
1837
+ if ( p == eof )
1838
+ {
1839
+ const char *__acts = _querybuilder_actions + _querybuilder_eof_actions[cs];
1840
+ unsigned int __nacts = (unsigned int) *__acts++;
1841
+ while ( __nacts-- > 0 ) {
1842
+ switch ( *__acts++ ) {
1843
+ case 29:
1844
+ #line 354 "querybuilder_ext.rl"
1845
+ {
1846
+ p = p - 3;
1847
+ if (p < data) p = data;
1848
+ // raise QueryBuilder::SyntaxError.new("Syntax error near #{data[p..-1].chomp.inspect}.")
1849
+ rb_raise(rb_SyntaxError, "Syntax error near %s.", RSTRING_PTR(rb_str_inspect(rb_str_new(p , pe - p - 1))));
1850
+ }
1851
+ break;
1852
+ #line 1853 "querybuilder_ext.c"
1853
+ }
1854
+ }
1855
+ }
1856
+
1857
+ _out: {}
1858
+ }
1859
+
1860
+ #line 409 "querybuilder_ext.rl"
1861
+
1862
+ // raise QueryBuilder::SyntaxError.new("Syntax error near #{data[p..-1].chomp.inspect}.") if p != pe
1863
+ if (p < pe) {
1864
+ p = p - 3;
1865
+ if (p < data) p = data;
1866
+ rb_raise(rb_SyntaxError, "Syntax error near %s.", RSTRING_PTR(rb_str_inspect(rb_str_new(p , pe - p - 1))));
1867
+ }
1868
+
1869
+ return rb_ary_entry(stack, 0);
1870
+ }