static ALQLLine agiBlue_parseQueryLine(S s) { LS tok = javaTokWithBrackets(s); // TODO: improve jmatch and use here if (lCodeTokens(tok) == 2 && eqGet(tok, 1, "return") && isIdentifier(get(tok, 3))) ret ALQLReturn(tok.get(3)); T3S t = agiBlue_parseTriple(tok); if (t != null) ret ALQLTriple(t); if (lCodeTokens(tok) == 2 && eqGet(tok, 1, "lock")) { t = agiBlue_parseTriple(tok.get(3)); if (t == null) fail("Bad lock statement: " + s); ret ALQLLockStatement(t); } fail("Can't parse ALQL line: " + s); }