use of ai.grakn.graql.internal.antlr.GraqlTemplateParser in project grakn by graknlabs.
the class TemplateParser method parseGraqlTemplate.
private ParseTree parseGraqlTemplate(CommonTokenStream tokens, GraqlErrorListener errorListener) {
GraqlTemplateParser parser = new GraqlTemplateParser(tokens);
parser.setBuildParseTree(true);
parser.removeErrorListeners();
parser.addErrorListener(errorListener);
ParseTree tree = parser.template();
if (errorListener.hasErrors()) {
throw GraqlSyntaxException.create(errorListener.toString());
}
return tree;
}
Aggregations