public void addToken(String tokenStr) { Integer tokenInt = (Integer)fTokenNames.get(tokenStr); if (tokenInt == null) { tokenInt = new Integer(fTokenNames.size()); fTokenNames.put(tokenInt, tokenStr); } addToken(tokenInt.intValue()); }
addToken(tokens, XPath.Tokens.EXPRTOKEN_LITERAL); starIsMultiplyOperator = true; tokens.addToken(symbolTable.addSymbol(data.substring(litOffset, litOffset + litLength))); if (++currentOffset == endOffset) { break; tokens.addToken(prefixHandle); tokens.addToken(nameHandle); break; } else { addToken(tokens, XPath.Tokens.EXPRTOKEN_FUNCTION_NAME); tokens.addToken(prefixHandle); tokens.addToken(nameHandle); addToken(tokens, XPath.Tokens.EXPRTOKEN_NAMETEST_NAMESPACE); starIsMultiplyOperator = true; tokens.addToken(nameHandle); } else { addToken(tokens, XPath.Tokens.EXPRTOKEN_NAMETEST_QNAME); starIsMultiplyOperator = true; tokens.addToken(prefixHandle); tokens.addToken(nameHandle);
/** * This method adds the specified token to the token list. By * default, this method allows all tokens. However, subclasses * of the XPathExprScanner can override this method in order * to disallow certain tokens from being used in the scanned * XPath expression. This is a convenient way of allowing only * a subset of XPath. */ protected void addToken(XPath.Tokens tokens, int token) throws XPathException { tokens.addToken(token); } // addToken(int)