use of io.jans.scim.service.antlr.scimFilter.antlr4.ScimFilterParser in project jans by JanssenProject.
the class ScimFilterParserService method getParseTree.
private ParseTree getParseTree(String filter, ScimFilterErrorListener errorListener) {
ANTLRInputStream input = new ANTLRInputStream(filter);
ScimFilterLexer lexer = new ScimFilterLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
ScimFilterParser parser = new ScimFilterParser(tokens);
parser.setTrimParseTree(true);
parser.removeErrorListeners();
parser.addErrorListener(errorListener);
return parser.filter();
}
use of io.jans.scim.service.antlr.scimFilter.antlr4.ScimFilterParser in project oxTrust by GluuFederation.
the class ScimFilterParserService method getParser.
private ScimFilterParser getParser(String filter) throws Exception {
log.info(" getParser() ");
// Get lexer
ANTLRInputStream input = new ANTLRInputStream(filter);
ScimFilterLexer lexer = new ScimFilterLexer(input);
// Get list of matched tokens
CommonTokenStream tokens = new CommonTokenStream(lexer);
// Pass tokens to the parser
ScimFilterParser parser = new ScimFilterParser(tokens);
parser.setBuildParseTree(true);
parser.setTrimParseTree(true);
parser.setProfile(true);
parser.removeErrorListeners();
parser.setErrorHandler(new ScimFilterErrorHandler());
return parser;
}
use of io.jans.scim.service.antlr.scimFilter.antlr4.ScimFilterParser in project oxTrust by GluuFederation.
the class ScimFilterParserService method getParseTree.
private ParseTree getParseTree(String filter, ScimFilterErrorListener errorListener) {
ANTLRInputStream input = new ANTLRInputStream(filter);
ScimFilterLexer lexer = new ScimFilterLexer(input);
CommonTokenStream tokens = new CommonTokenStream(lexer);
ScimFilterParser parser = new ScimFilterParser(tokens);
parser.setTrimParseTree(true);
parser.removeErrorListeners();
parser.addErrorListener(errorListener);
return parser.filter();
}
Aggregations