Search in sources :

Example 1 with ParseException

use of org.apache.jena.sparql.sse.lang.parser.ParseException in project jena by apache.

the class SSE_Parser method term.

public static void term(Reader reader, ParseHandler handler) {
    SSE_ParserCore p = new SSE_ParserCore(reader);
    p.setHandler(handler);
    try {
        p.term();
    // Checks for EOF 
    //            //<EOF> test : EOF is always token 0.
    //            if ( p.token_source.getNextToken().kind != 0 )
    //                throw new SSEParseException("Trailing characters after "+item, item.getLine(), item.getColumn()) ;
    } catch (ParseException ex) {
        throw new SSEParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn);
    } catch (TokenMgrError tErr) {
        // Last valid token : not the same as token error message - but this should not happen
        int col = p.token.endColumn;
        int line = p.token.endLine;
        throw new SSEParseException(tErr.getMessage(), line, col);
    }
//catch (JenaException ex)  { throw new TurtleParseException(ex.getMessage(), ex) ; }
}
Also used : SSEParseException(org.apache.jena.sparql.sse.SSEParseException) TokenMgrError(org.apache.jena.sparql.sse.lang.parser.TokenMgrError) ParseException(org.apache.jena.sparql.sse.lang.parser.ParseException) SSEParseException(org.apache.jena.sparql.sse.SSEParseException) SSE_ParserCore(org.apache.jena.sparql.sse.lang.parser.SSE_ParserCore)

Example 2 with ParseException

use of org.apache.jena.sparql.sse.lang.parser.ParseException in project jena by apache.

the class SSE_Parser method parse.

public static void parse(Reader reader, ParseHandler handler) {
    SSE_ParserCore p = new SSE_ParserCore(reader);
    p.setHandler(handler);
    try {
        p.parse();
    } catch (ParseException ex) {
        throw new SSEParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn);
    } catch (TokenMgrError tErr) {
        // Last valid token : not the same as token error message - but this should not happen
        int col = p.token.endColumn;
        int line = p.token.endLine;
        throw new SSEParseException(tErr.getMessage(), line, col);
    }
//catch (JenaException ex)  { throw new TurtleParseException(ex.getMessage(), ex) ; }
}
Also used : SSEParseException(org.apache.jena.sparql.sse.SSEParseException) TokenMgrError(org.apache.jena.sparql.sse.lang.parser.TokenMgrError) ParseException(org.apache.jena.sparql.sse.lang.parser.ParseException) SSEParseException(org.apache.jena.sparql.sse.SSEParseException) SSE_ParserCore(org.apache.jena.sparql.sse.lang.parser.SSE_ParserCore)

Aggregations

SSEParseException (org.apache.jena.sparql.sse.SSEParseException)2 ParseException (org.apache.jena.sparql.sse.lang.parser.ParseException)2 SSE_ParserCore (org.apache.jena.sparql.sse.lang.parser.SSE_ParserCore)2 TokenMgrError (org.apache.jena.sparql.sse.lang.parser.TokenMgrError)2