if (!jdl.startsWith("[")) {
jdl = "[ " + jdl + "]";
}
ClassAdParser cp = new ClassAdParser(jdl);
Expr expr = cp.parse();
if (expr == null) {
throw new Exception("Unable to parse: doesn't seem to be a valid Expression");
} else if (expr.type != Expr.RECORD) {
throw new Exception("Unable to parse: the parsed expression is not a ClassAd");