protected static void throwException(String msg, int line, int column) { throw new SSEParseException("[" + line + ", " + column + "] " + msg, line, column) ; }
public static void throwParseException(String msg, int line, int column) { throw new SSEParseException("Line " + line + ", column " + column + ": " + msg, line, column) ; } }
public static void throwParseException(String msg, int line, int column) { throw new SSEParseException("Line " + line + ", column " + column + ": " + msg, line, column) ; } }
protected static void throwException(String msg, int line, int column) { throw new SSEParseException("[" + line + ", " + column + "] " + msg, line, column) ; }
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) ; } } }
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) ; } } }
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) ; } }
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) ; } }
private static Node parseNode(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( item.isSymbol() ) { String str = item.getSymbol() ; if ( "true".equalsIgnoreCase(str) ) return NodeConst.nodeTrue ; if ( "false".equalsIgnoreCase(str) ) return NodeConst.nodeFalse ; throw new SSEParseException("Not a node: "+item, item.getLine(), item.getColumn()) ; } if ( ! item.isNode() ) throw new SSEParseException("Not a node: "+item, item.getLine(), item.getColumn()) ; return item.getNode() ; }
private static Node parseNode(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( item.isSymbol() ) { String str = item.getSymbol() ; if ( "true".equalsIgnoreCase(str) ) return NodeConst.nodeTrue ; if ( "false".equalsIgnoreCase(str) ) return NodeConst.nodeFalse ; throw new SSEParseException("Not a node: "+item, item.getLine(), item.getColumn()) ; } if ( ! item.isNode() ) throw new SSEParseException("Not a node: "+item, item.getLine(), item.getColumn()) ; return item.getNode() ; }
private static String parseSymbol(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( ! item.isSymbol() ) throw new SSEParseException("Not a symbol: "+item, item.getLine(), item.getColumn()) ; return item.getSymbol() ; }
private static String parseSymbol(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( ! item.isSymbol() ) throw new SSEParseException("Not a symbol: "+item, item.getLine(), item.getColumn()) ; return item.getSymbol() ; }