use of catdata.fql.parse.Tokens in project fql by CategoricalData.
the class Path method parsePath.
// private static List<String> convert(
// List<Pair<Pair<String, String>, String>> l) {
// List<String> ret = new LinkedList<>();
// for (Pair<Pair<String, String>, String> x : l) {
// ret.add(x.second);
// }
// return ret;
// }
public static Path parsePath(Signature a, String s) throws FQLException {
try {
Tokens t = new FqlTokenizer(s);
PathParser pp = new PathParser();
Partial<List<String>> r = pp.parse(t);
if (!r.tokens.toString().trim().isEmpty()) {
throw new FQLException("Invalid path: " + s);
}
return new Path(a, r.value);
} catch (Exception e) {
throw new FQLException("Invalid path: " + s);
}
}
Aggregations