Search in sources :

Example 1 with ScimFilterErrorHandler

use of org.gluu.oxtrust.service.antlr.scimFilter.exception.ScimFilterErrorHandler 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;
}
Also used : CommonTokenStream(org.antlr.v4.runtime.CommonTokenStream) ScimFilterLexer(org.gluu.oxtrust.service.antlr.scimFilter.antlr4.ScimFilterLexer) ScimFilterParser(org.gluu.oxtrust.service.antlr.scimFilter.antlr4.ScimFilterParser) ANTLRInputStream(org.antlr.v4.runtime.ANTLRInputStream) ScimFilterErrorHandler(org.gluu.oxtrust.service.antlr.scimFilter.exception.ScimFilterErrorHandler)

Aggregations

ANTLRInputStream (org.antlr.v4.runtime.ANTLRInputStream)1 CommonTokenStream (org.antlr.v4.runtime.CommonTokenStream)1 ScimFilterLexer (org.gluu.oxtrust.service.antlr.scimFilter.antlr4.ScimFilterLexer)1 ScimFilterParser (org.gluu.oxtrust.service.antlr.scimFilter.antlr4.ScimFilterParser)1 ScimFilterErrorHandler (org.gluu.oxtrust.service.antlr.scimFilter.exception.ScimFilterErrorHandler)1