private int LA(int position) { return LT(position).getTokenType(); }
private Token identifierOrOperatorName() { Token token = null; if ( expectOperator ) { token = operatorName(); } else { token = identifier(); } return token; }
private Token match(int tokenType) throws XPathSyntaxException { LT(1); Token token = (Token) tokens.get( 0 ); if ( token.getTokenType() == tokenType ) { tokens.remove(0); return token; } XPathSyntaxException ex = createSyntaxException( "Expected: " + TokenTypes.getTokenText( tokenType ) ); throw ex; }
private XPathSyntaxException createSyntaxException(String message) { String xpath = this.lexer.getXPath(); int position = LT(1).getTokenBegin(); return new XPathSyntaxException( xpath, position, message ); }
private void throwInvalidAxis(String invalidAxis) throws SAXPathException { String xpath = this.lexer.getXPath(); int position = LT(1).getTokenBegin(); String message = "Expected valid axis name instead of [" + invalidAxis + "]"; throw new XPathSyntaxException( xpath, position, message ); } }