Search in sources :

Example 1 with TokenMgrError

use of com.yahoo.searchdefinition.parser.TokenMgrError in project vespa by vespa-engine.

the class SearchBuilder method importString.

private String importString(String str, String searchDefDir, DeployLogger deployLogger) throws ParseException {
    Search search;
    SimpleCharStream stream = new SimpleCharStream(str);
    try {
        search = new SDParser(stream, deployLogger, app, rankProfileRegistry).search(docTypeMgr, searchDefDir);
    } catch (TokenMgrError e) {
        throw new ParseException("Unknown symbol: " + e.getMessage());
    } catch (ParseException pe) {
        throw new ParseException(stream.formatException(Exceptions.toMessageString(pe)));
    }
    return importRawSearch(search);
}
Also used : SimpleCharStream(com.yahoo.searchdefinition.parser.SimpleCharStream) SDParser(com.yahoo.searchdefinition.parser.SDParser) TokenMgrError(com.yahoo.searchdefinition.parser.TokenMgrError) ParseException(com.yahoo.searchdefinition.parser.ParseException)

Aggregations

ParseException (com.yahoo.searchdefinition.parser.ParseException)1 SDParser (com.yahoo.searchdefinition.parser.SDParser)1 SimpleCharStream (com.yahoo.searchdefinition.parser.SimpleCharStream)1 TokenMgrError (com.yahoo.searchdefinition.parser.TokenMgrError)1