Lines Matching refs:ss

185     private static QueryExp parseQuery(String[] ss) throws Exception {
186 if (skip(ss, "("))
187 return parseQueryAfterParen(ss);
189 if (skip(ss, "not (")) {
190 QueryExp not = parseQuery(ss);
191 if (!skip(ss, ")"))
196 ValueExp exp = parseExp(ss);
198 if (skip(ss, " like ")) {
199 ValueExp pat = parseExp(ss);
209 if (skip(ss, " in (")) {
211 if (!skip(ss, ")")) {
213 values.add(parseExp(ss));
214 } while (skip(ss, ", "));
215 if (!skip(ss, ")"))
224 private static QueryExp parseQueryAfterParen(String[] ss)
232 String start = ss[0];
234 QueryExp lhs = parseQuery(ss);
237 if (skip(ss, ") and ("))
238 result = Query.and(lhs, parseQuery(ss));
239 else if (skip(ss, ") or ("))
240 result = Query.or(lhs, parseQuery(ss));
243 if (!skip(ss, ")"))
247 ss[0] = start;
248 ValueExp lhs = parseExp(ss);
249 if (!skip(ss, ") "))
250 throw new Exception("Expected `) ' after subexpression: " + ss[0]);
251 String op = scanWord(ss);
252 if (!skip(ss, " ("))
254 ValueExp rhs = parseExp(ss);
255 if (!skip(ss, ")"))
269 if (!skip(ss, " and ("))
271 ValueExp high = parseExp(ss);
272 if (!skip(ss, ")"))
278 private static ValueExp parseExp(String[] ss) throws Exception {
279 ValueExp lhs = parsePrimary(ss);
283 String back = ss[0];
284 if (!skip(ss, " "))
286 if (ss[0].equals("") || "+-*/".indexOf(ss[0].charAt(0)) < 0) {
287 ss[0] = back;
291 final String op = scanWord(ss);
296 if (!skip(ss, " "))
298 ValueExp rhs = parsePrimary(ss);
309 private static ValueExp parsePrimary(String[] ss) throws Exception {
310 String s = ss[0];
321 return parseNumberExp(ss);
324 return parseString(ss);
326 if (matchWord(ss, "true"))
329 if (matchWord(ss, "false"))
332 if (matchWord(ss, "Class"))
335 String word = scanWord(ss);
344 private static String scanWord(String[] ss) throws Exception {
345 String s = ss[0];
349 ss[0] = "";
358 ss[0] = s.substring(stop);
362 private static boolean matchWord(String[] ss, String word)
364 String s = ss[0];
369 ss[0] = s.substring(len);
376 private static ValueExp parseNumberExp(String[] ss) throws Exception {
377 String s = ss[0];
391 ss[0] = s.substring(i);
399 private static ValueExp parseString(String[] ss) throws Exception {
400 if (!skip(ss, "'"))
402 String s = ss[0];
411 ss[0] = s.substring(i);
420 private static boolean skip(String[] ss, String skip) {
421 if (ss[0].startsWith(skip)) {
422 ss[0] = ss[0].substring(skip.length());