Search in sources :

Example 1 with ParseException

use of org.apache.jena.shacl.compact.reader.parser.ParseException in project jena by apache.

the class ShaclcParser method parse$.

private static void parse$(ShaclCompactParserJJ parser, StreamRDF stream, String baseURI, Context context) {
    ParserProfile profile = new ParserProfileStd(RiotLib.factoryRDF(), ErrorHandlerFactory.errorHandlerStd, IRIxResolver.create(baseURI).build(), PrefixMapFactory.create(), context, false, false);
    SHACLC.addStandardPrefixes(profile.getPrefixMap());
    stream.start();
    parser.setDest(stream);
    parser.setProfile(profile);
    parser.start();
    try {
        parser.Unit();
    } catch (ParseException ex) {
        throw new ShaclcParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn);
    } catch (TokenMgrError tErr) {
        int col = parser.token.endColumn;
        int line = parser.token.endLine;
        throw new ShaclcParseException(tErr.getMessage(), line, col);
    }
    parser.finish();
    stream.finish();
}
Also used : ShaclcParseException(org.apache.jena.shacl.compact.reader.ShaclcParseException) TokenMgrError(org.apache.jena.shacl.compact.reader.parser.TokenMgrError) ShaclcParseException(org.apache.jena.shacl.compact.reader.ShaclcParseException) ParseException(org.apache.jena.shacl.compact.reader.parser.ParseException)

Aggregations

ShaclcParseException (org.apache.jena.shacl.compact.reader.ShaclcParseException)1 ParseException (org.apache.jena.shacl.compact.reader.parser.ParseException)1 TokenMgrError (org.apache.jena.shacl.compact.reader.parser.TokenMgrError)1