Package net.sf.saxon.expr.parser
Class Token
- java.lang.Object
-
- net.sf.saxon.expr.parser.Token
-
public abstract class Token extends java.lang.Object
This class holds static constants and methods defining the lexical tokens used in XPath and XQuery, and associated keywords.
-
-
Field Summary
Fields Modifier and Type Field Description static int
AFTER
"after"static int
AND
Operator "and"static int
AND_ALSO
"andAlso" (Saxon extension)static int
ARROW
Arrow operator "=>" (XQuery 3.1)static int
AS
"as" (in XQuery Update rename expression)static int
ASSIGN
":=" symbol (XQuery only)static int
AT
At token, "@"static int
ATTRIBUTE_QNAME
composite token <'attribute' QNAME> (XQuery only)static int
AXIS
Token representing the name of an axis and the following "::" symbolstatic int
BANG
Operator "!"static int
BEFORE
"before"static int
CASE
Keyword "case"static int
CAST_AS
operator "cast as"static int
CASTABLE_AS
operator "castable as"static int
COLON
":" (XPath 3.0 maps)static int
COLONCOLON
"::" symbolstatic int
COLONSTAR
":*" symbolstatic int
COMMA
Comma tokenstatic int
CONCAT
Operator "||"static int
COPY
"copy" keywordstatic int
COUNT
"count" keywordstatic int
DECLARE_ANNOTATED
declare %static int
DECLARE_BASEURI
"declare base-uri"static int
DECLARE_BOUNDARY_SPACE
"declare boundary-space"static int
DECLARE_CONSTRUCTION
"declare construction"static int
DECLARE_CONTEXT
"declare context"static int
DECLARE_COPY_NAMESPACES
"declare copy-namespaces"static int
DECLARE_DECIMAL_FORMAT
"declare decimal-format"static int
DECLARE_DEFAULT
"declare default"static int
DECLARE_FUNCTION
"declare function"static int
DECLARE_NAMESPACE
"declare namespace"static int
DECLARE_OPTION
"declare option"static int
DECLARE_ORDERING
"declare xmlspace"static int
DECLARE_REVALIDATION
"declare revalidation"static int
DECLARE_TYPE
Saxon extension: declare typestatic int
DECLARE_UPDATING
"declare updating [function]"static int
DECLARE_VARIABLE
"declare variable"static int
DEFAULT
Keyword "default"static int
DELETE_NODE
"delete node/nodes"static int
DIV
Operator "div"static int
DOLLAR
"$" symbolstatic int
DOT
"." symbolstatic int
DOTDOT
".." symbolstatic java.util.HashMap<java.lang.String,java.lang.Integer>
doubleKeywords
Lookup table for composite (two-keyword) tokensstatic int
ELEMENT_QNAME
composite token <'element' QNAME> (XQuery only)static int
ELSE
Keyword "else"static int
EOF
Pseudo-token representing the end of the expressionstatic int
EQUALS
Equals token ("=")static int
EVERY
Keyword "every"static int
EXCEPT
Operator "except"static int
FEQ
operator "eq"static int
FGE
operator "ge"static int
FGT
operator "gt"static int
FIRST_INTO
"first into"static int
FLE
opeartor "le"static int
FLT
operator "lt"static int
FNE
operator "ne"static int
FOLLOWS
Operator ">>"static int
FOR
"for" keywordstatic int
FOR_MEMBER
"for member" (Saxon extension)static int
FOR_SLIDING
"for sliding" (XQuery 3.0)static int
FOR_TUMBLING
"for tumbling" (XQuery 3.0)static int
FUNCTION
Token representing the name of a function and the following "(" symbolstatic int
GE
Operator ">="static int
GROUP_BY
static int
GT
Operator ">"static int
HASH
# symbolstatic int
IDIV
operator "idiv"static int
IF
Keyword "if"static int
IMPLICIT_EOF
Pseudo-token representing implicit end of expression (the parser doesn't care what follows the expression)static int
IMPORT_MODULE
"import module"static int
IMPORT_SCHEMA
"import schema"static int
IN
Keyword "in"static int
INSERT_NODE
"insert node/nodes"static int
INSTANCE_OF
operator "instance of"static int
INTERSECT
Operator "intersect"static int
INTO
"into"static int
IS
Operator "is"static int
KEYWORD_CURLY
composite token: <keyword "{"> (XQuery only)static int
LAST_INTO
"last into"static int
LCURLY
"{" symbol (XQuery only)static int
LE
Operator "<="static int
LET
"let" keyword (XQuery only)static int
LPAR
Left parenthesisstatic int
LSQB
Left square bracketstatic int
LT
Operator "<"static int
MINUS
Binary minus operatorstatic int
MOD
Operator "mod"static int
MODIFY
Keyword "modify"static int
MODULE_NAMESPACE
"module namespace"static int
MULT
Multiply operator, "*" when used in an operator contextstatic int
NAME
Name token (a QName, in general)static int
NAMED_FUNCTION_REF
Token representing a function name and the following "#" symbolstatic int
NAMESPACE_QNAME
composite token <'namespace' QNAME> (XQuery only)static int
NE
Operator not-equals.static int
NEGATE
Unary minus signstatic int
NODEKIND
Node kind, e.g.static int
NUMBER
Numeric literalstatic int
OR
Operator "or"static int
OR_ELSE
"orElse" (Saxon extension)static int
OTHERWISE
"otherwise" (Saxon extension)static int
PERCENT
percent sign '%'static int
PI_QNAME
composite token <'pi' QNAME> (XQuery only)static int
PLUS
Operator "+"static int
PRAGMA
A token representing an XQuery pragma.static int
PRECEDES
Operator "<<"static int
PREFIX
"prefix:*" tokenstatic int
QMARK
Question mark symbol.static int
RCURLY
"}" symbol (XQuery only)static int
RENAME_NODE
"rename node"static int
REPLACE_NODE
"replace node/nodes"static int
REPLACE_VALUE
"replace value"static int
RETURN
Keyword "return"static int
RPAR
Right parenthesisstatic int
RSQB
Right square bracketstatic int
SATISFIES
Keyword "satisfies"static int
SEMICOLON
semicolon separatorstatic int
SLASH
Forwards "/"static int
SLASH_SLASH
Double forwards slash, "//"static int
SOME
Keyword "some"static int
STAR
"*" symbol when used as a wildcardstatic int
STRING_CONSTRUCTOR_INITIAL
First part of a string template.static int
STRING_LITERAL
String literalstatic int
STRING_LITERAL_BACKTICKED
Complete string template with no embedded expressionsstatic int
SUFFIX
"*:" tokenstatic int
SWITCH
Keyword "switch" (XQuery 1.1)static int
TAG
"<" at the start of a tag (XQuery only).static int
THEN
Ketword "then"static int
TO
Operator "to"static java.lang.String[]
tokens
The following strings are used to represent tokens in error messagesstatic int
TREAT_AS
operator "treat as"static int
TYPESWITCH
Keyword "typeswitch"static int
UNION
"union" or "|" tokenstatic int
UNKNOWN
Pseudo-token representing the start of the expressionstatic int
VALIDATE
Various compound symbols supporting XQuery validation expressionstatic int
VALIDATE_LAX
static int
VALIDATE_STRICT
static int
VALIDATE_TYPE
static int
WHERE
Keyword "where"static int
WITH
"with"static int
XQUERY_ENCODING
"xquery encoding"static int
XQUERY_VERSION
"xquery version"
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
inverse(int operator)
Return the inverse of a relational operator, so that "a op b" can be rewritten as "b inverse(op) a"static boolean
isOrderedOperator(int operator)
static int
negate(int operator)
Return the negation of a relational operator, so that "a op b" can be rewritten as not(b op' a)
-
-
-
Field Detail
-
IMPLICIT_EOF
public static final int IMPLICIT_EOF
Pseudo-token representing implicit end of expression (the parser doesn't care what follows the expression)- See Also:
- Constant Field Values
-
EOF
public static final int EOF
Pseudo-token representing the end of the expression- See Also:
- Constant Field Values
-
UNION
public static final int UNION
"union" or "|" token- See Also:
- Constant Field Values
-
SLASH
public static final int SLASH
Forwards "/"- See Also:
- Constant Field Values
-
AT
public static final int AT
At token, "@"- See Also:
- Constant Field Values
-
LSQB
public static final int LSQB
Left square bracket- See Also:
- Constant Field Values
-
LPAR
public static final int LPAR
Left parenthesis- See Also:
- Constant Field Values
-
EQUALS
public static final int EQUALS
Equals token ("=")- See Also:
- Constant Field Values
-
COMMA
public static final int COMMA
Comma token- See Also:
- Constant Field Values
-
SLASH_SLASH
public static final int SLASH_SLASH
Double forwards slash, "//"- See Also:
- Constant Field Values
-
OR
public static final int OR
Operator "or"- See Also:
- Constant Field Values
-
AND
public static final int AND
Operator "and"- See Also:
- Constant Field Values
-
GT
public static final int GT
Operator ">"- See Also:
- Constant Field Values
-
LT
public static final int LT
Operator "<"- See Also:
- Constant Field Values
-
GE
public static final int GE
Operator ">="- See Also:
- Constant Field Values
-
LE
public static final int LE
Operator "<="- See Also:
- Constant Field Values
-
PLUS
public static final int PLUS
Operator "+"- See Also:
- Constant Field Values
-
MINUS
public static final int MINUS
Binary minus operator- See Also:
- Constant Field Values
-
MULT
public static final int MULT
Multiply operator, "*" when used in an operator context- See Also:
- Constant Field Values
-
DIV
public static final int DIV
Operator "div"- See Also:
- Constant Field Values
-
MOD
public static final int MOD
Operator "mod"- See Also:
- Constant Field Values
-
IS
public static final int IS
Operator "is"- See Also:
- Constant Field Values
-
DOLLAR
public static final int DOLLAR
"$" symbol- See Also:
- Constant Field Values
-
NE
public static final int NE
Operator not-equals. That is, "!="- See Also:
- Constant Field Values
-
INTERSECT
public static final int INTERSECT
Operator "intersect"- See Also:
- Constant Field Values
-
EXCEPT
public static final int EXCEPT
Operator "except"- See Also:
- Constant Field Values
-
RETURN
public static final int RETURN
Keyword "return"- See Also:
- Constant Field Values
-
THEN
public static final int THEN
Ketword "then"- See Also:
- Constant Field Values
-
ELSE
public static final int ELSE
Keyword "else"- See Also:
- Constant Field Values
-
WHERE
public static final int WHERE
Keyword "where"- See Also:
- Constant Field Values
-
TO
public static final int TO
Operator "to"- See Also:
- Constant Field Values
-
CONCAT
public static final int CONCAT
Operator "||"- See Also:
- Constant Field Values
-
IN
public static final int IN
Keyword "in"- See Also:
- Constant Field Values
-
SOME
public static final int SOME
Keyword "some"- See Also:
- Constant Field Values
-
EVERY
public static final int EVERY
Keyword "every"- See Also:
- Constant Field Values
-
SATISFIES
public static final int SATISFIES
Keyword "satisfies"- See Also:
- Constant Field Values
-
FUNCTION
public static final int FUNCTION
Token representing the name of a function and the following "(" symbol- See Also:
- Constant Field Values
-
AXIS
public static final int AXIS
Token representing the name of an axis and the following "::" symbol- See Also:
- Constant Field Values
-
IF
public static final int IF
Keyword "if"- See Also:
- Constant Field Values
-
PRECEDES
public static final int PRECEDES
Operator "<<"- See Also:
- Constant Field Values
-
FOLLOWS
public static final int FOLLOWS
Operator ">>"- See Also:
- Constant Field Values
-
BANG
public static final int BANG
Operator "!"- See Also:
- Constant Field Values
-
COLONCOLON
public static final int COLONCOLON
"::" symbol- See Also:
- Constant Field Values
-
COLONSTAR
public static final int COLONSTAR
":*" symbol- See Also:
- Constant Field Values
-
NAMED_FUNCTION_REF
public static final int NAMED_FUNCTION_REF
Token representing a function name and the following "#" symbol- See Also:
- Constant Field Values
-
HASH
public static final int HASH
# symbol- See Also:
- Constant Field Values
-
INSTANCE_OF
public static final int INSTANCE_OF
operator "instance of"- See Also:
- Constant Field Values
-
CAST_AS
public static final int CAST_AS
operator "cast as"- See Also:
- Constant Field Values
-
TREAT_AS
public static final int TREAT_AS
operator "treat as"- See Also:
- Constant Field Values
-
FEQ
public static final int FEQ
operator "eq"- See Also:
- Constant Field Values
-
FNE
public static final int FNE
operator "ne"- See Also:
- Constant Field Values
-
FGT
public static final int FGT
operator "gt"- See Also:
- Constant Field Values
-
FLT
public static final int FLT
operator "lt"- See Also:
- Constant Field Values
-
FGE
public static final int FGE
operator "ge"- See Also:
- Constant Field Values
-
FLE
public static final int FLE
opeartor "le"- See Also:
- Constant Field Values
-
IDIV
public static final int IDIV
operator "idiv"- See Also:
- Constant Field Values
-
CASTABLE_AS
public static final int CASTABLE_AS
operator "castable as"- See Also:
- Constant Field Values
-
ASSIGN
public static final int ASSIGN
":=" symbol (XQuery only)- See Also:
- Constant Field Values
-
LCURLY
public static final int LCURLY
"{" symbol (XQuery only)- See Also:
- Constant Field Values
-
KEYWORD_CURLY
public static final int KEYWORD_CURLY
composite token: <keyword "{"> (XQuery only)- See Also:
- Constant Field Values
-
ELEMENT_QNAME
public static final int ELEMENT_QNAME
composite token <'element' QNAME> (XQuery only)- See Also:
- Constant Field Values
-
ATTRIBUTE_QNAME
public static final int ATTRIBUTE_QNAME
composite token <'attribute' QNAME> (XQuery only)- See Also:
- Constant Field Values
-
PI_QNAME
public static final int PI_QNAME
composite token <'pi' QNAME> (XQuery only)- See Also:
- Constant Field Values
-
NAMESPACE_QNAME
public static final int NAMESPACE_QNAME
composite token <'namespace' QNAME> (XQuery only)- See Also:
- Constant Field Values
-
TYPESWITCH
public static final int TYPESWITCH
Keyword "typeswitch"- See Also:
- Constant Field Values
-
SWITCH
public static final int SWITCH
Keyword "switch" (XQuery 1.1)- See Also:
- Constant Field Values
-
CASE
public static final int CASE
Keyword "case"- See Also:
- Constant Field Values
-
MODIFY
public static final int MODIFY
Keyword "modify"- See Also:
- Constant Field Values
-
NODEKIND
public static final int NODEKIND
Node kind, e.g. "node()" or "comment()"- See Also:
- Constant Field Values
-
SUFFIX
public static final int SUFFIX
"*:" token- See Also:
- Constant Field Values
-
AS
public static final int AS
"as" (in XQuery Update rename expression)- See Also:
- Constant Field Values
-
GROUP_BY
public static final int GROUP_BY
- See Also:
- Constant Field Values
-
FOR_TUMBLING
public static final int FOR_TUMBLING
"for tumbling" (XQuery 3.0)- See Also:
- Constant Field Values
-
FOR_SLIDING
public static final int FOR_SLIDING
"for sliding" (XQuery 3.0)- See Also:
- Constant Field Values
-
FOR_MEMBER
public static final int FOR_MEMBER
"for member" (Saxon extension)- See Also:
- Constant Field Values
-
COLON
public static final int COLON
":" (XPath 3.0 maps)- See Also:
- Constant Field Values
-
ARROW
public static final int ARROW
Arrow operator "=>" (XQuery 3.1)- See Also:
- Constant Field Values
-
STRING_CONSTRUCTOR_INITIAL
public static final int STRING_CONSTRUCTOR_INITIAL
First part of a string template. Token value includes all the text from ``[ up to the first `{- See Also:
- Constant Field Values
-
OTHERWISE
public static final int OTHERWISE
"otherwise" (Saxon extension)- See Also:
- Constant Field Values
-
AND_ALSO
public static final int AND_ALSO
"andAlso" (Saxon extension)- See Also:
- Constant Field Values
-
OR_ELSE
public static final int OR_ELSE
"orElse" (Saxon extension)- See Also:
- Constant Field Values
-
XQUERY_VERSION
public static final int XQUERY_VERSION
"xquery version"- See Also:
- Constant Field Values
-
XQUERY_ENCODING
public static final int XQUERY_ENCODING
"xquery encoding"- See Also:
- Constant Field Values
-
DECLARE_NAMESPACE
public static final int DECLARE_NAMESPACE
"declare namespace"- See Also:
- Constant Field Values
-
DECLARE_DEFAULT
public static final int DECLARE_DEFAULT
"declare default"- See Also:
- Constant Field Values
-
DECLARE_CONSTRUCTION
public static final int DECLARE_CONSTRUCTION
"declare construction"- See Also:
- Constant Field Values
-
DECLARE_BASEURI
public static final int DECLARE_BASEURI
"declare base-uri"- See Also:
- Constant Field Values
-
DECLARE_BOUNDARY_SPACE
public static final int DECLARE_BOUNDARY_SPACE
"declare boundary-space"- See Also:
- Constant Field Values
-
DECLARE_DECIMAL_FORMAT
public static final int DECLARE_DECIMAL_FORMAT
"declare decimal-format"- See Also:
- Constant Field Values
-
IMPORT_SCHEMA
public static final int IMPORT_SCHEMA
"import schema"- See Also:
- Constant Field Values
-
IMPORT_MODULE
public static final int IMPORT_MODULE
"import module"- See Also:
- Constant Field Values
-
DECLARE_VARIABLE
public static final int DECLARE_VARIABLE
"declare variable"- See Also:
- Constant Field Values
-
DECLARE_CONTEXT
public static final int DECLARE_CONTEXT
"declare context"- See Also:
- Constant Field Values
-
DECLARE_FUNCTION
public static final int DECLARE_FUNCTION
"declare function"- See Also:
- Constant Field Values
-
MODULE_NAMESPACE
public static final int MODULE_NAMESPACE
"module namespace"- See Also:
- Constant Field Values
-
VALIDATE
public static final int VALIDATE
Various compound symbols supporting XQuery validation expression- See Also:
- Constant Field Values
-
VALIDATE_STRICT
public static final int VALIDATE_STRICT
- See Also:
- Constant Field Values
-
VALIDATE_LAX
public static final int VALIDATE_LAX
- See Also:
- Constant Field Values
-
VALIDATE_TYPE
public static final int VALIDATE_TYPE
- See Also:
- Constant Field Values
-
PERCENT
public static final int PERCENT
percent sign '%'- See Also:
- Constant Field Values
-
DECLARE_ORDERING
public static final int DECLARE_ORDERING
"declare xmlspace"- See Also:
- Constant Field Values
-
DECLARE_COPY_NAMESPACES
public static final int DECLARE_COPY_NAMESPACES
"declare copy-namespaces"- See Also:
- Constant Field Values
-
DECLARE_OPTION
public static final int DECLARE_OPTION
"declare option"- See Also:
- Constant Field Values
-
DECLARE_REVALIDATION
public static final int DECLARE_REVALIDATION
"declare revalidation"- See Also:
- Constant Field Values
-
INSERT_NODE
public static final int INSERT_NODE
"insert node/nodes"- See Also:
- Constant Field Values
-
DELETE_NODE
public static final int DELETE_NODE
"delete node/nodes"- See Also:
- Constant Field Values
-
REPLACE_NODE
public static final int REPLACE_NODE
"replace node/nodes"- See Also:
- Constant Field Values
-
REPLACE_VALUE
public static final int REPLACE_VALUE
"replace value"- See Also:
- Constant Field Values
-
RENAME_NODE
public static final int RENAME_NODE
"rename node"- See Also:
- Constant Field Values
-
FIRST_INTO
public static final int FIRST_INTO
"first into"- See Also:
- Constant Field Values
-
LAST_INTO
public static final int LAST_INTO
"last into"- See Also:
- Constant Field Values
-
AFTER
public static final int AFTER
"after"- See Also:
- Constant Field Values
-
BEFORE
public static final int BEFORE
"before"- See Also:
- Constant Field Values
-
INTO
public static final int INTO
"into"- See Also:
- Constant Field Values
-
WITH
public static final int WITH
"with"- See Also:
- Constant Field Values
-
DECLARE_UPDATING
public static final int DECLARE_UPDATING
"declare updating [function]"- See Also:
- Constant Field Values
-
DECLARE_ANNOTATED
public static final int DECLARE_ANNOTATED
declare %- See Also:
- Constant Field Values
-
DECLARE_TYPE
public static final int DECLARE_TYPE
Saxon extension: declare type- See Also:
- Constant Field Values
-
SEMICOLON
public static final int SEMICOLON
semicolon separator- See Also:
- Constant Field Values
-
NAME
public static final int NAME
Name token (a QName, in general)- See Also:
- Constant Field Values
-
STRING_LITERAL
public static final int STRING_LITERAL
String literal- See Also:
- Constant Field Values
-
RSQB
public static final int RSQB
Right square bracket- See Also:
- Constant Field Values
-
RPAR
public static final int RPAR
Right parenthesis- See Also:
- Constant Field Values
-
DOT
public static final int DOT
"." symbol- See Also:
- Constant Field Values
-
DOTDOT
public static final int DOTDOT
".." symbol- See Also:
- Constant Field Values
-
STAR
public static final int STAR
"*" symbol when used as a wildcard- See Also:
- Constant Field Values
-
PREFIX
public static final int PREFIX
"prefix:*" token- See Also:
- Constant Field Values
-
NUMBER
public static final int NUMBER
Numeric literal- See Also:
- Constant Field Values
-
FOR
public static final int FOR
"for" keyword- See Also:
- Constant Field Values
-
DEFAULT
public static final int DEFAULT
Keyword "default"- See Also:
- Constant Field Values
-
QMARK
public static final int QMARK
Question mark symbol. That is, "?"- See Also:
- Constant Field Values
-
RCURLY
public static final int RCURLY
"}" symbol (XQuery only)- See Also:
- Constant Field Values
-
LET
public static final int LET
"let" keyword (XQuery only)- See Also:
- Constant Field Values
-
TAG
public static final int TAG
"<" at the start of a tag (XQuery only). The pseudo-XML syntax that follows is read character-by-character by the XQuery parser- See Also:
- Constant Field Values
-
PRAGMA
public static final int PRAGMA
A token representing an XQuery pragma. This construct "(# .... #)" is regarded as a single token, for the QueryParser to sort out.- See Also:
- Constant Field Values
-
COPY
public static final int COPY
"copy" keyword- See Also:
- Constant Field Values
-
COUNT
public static final int COUNT
"count" keyword- See Also:
- Constant Field Values
-
STRING_LITERAL_BACKTICKED
public static final int STRING_LITERAL_BACKTICKED
Complete string template with no embedded expressions- See Also:
- Constant Field Values
-
NEGATE
public static final int NEGATE
Unary minus sign- See Also:
- Constant Field Values
-
tokens
public static final java.lang.String[] tokens
The following strings are used to represent tokens in error messages
-
doubleKeywords
public static java.util.HashMap<java.lang.String,java.lang.Integer> doubleKeywords
Lookup table for composite (two-keyword) tokens
-
UNKNOWN
public static final int UNKNOWN
Pseudo-token representing the start of the expression- See Also:
- Constant Field Values
-
-
Method Detail
-
inverse
public static int inverse(int operator)
Return the inverse of a relational operator, so that "a op b" can be rewritten as "b inverse(op) a"- Parameters:
operator
- the operator whose inverse is required- Returns:
- the inverse operator
-
negate
public static int negate(int operator)
Return the negation of a relational operator, so that "a op b" can be rewritten as not(b op' a)- Parameters:
operator
- the operator to be negated- Returns:
- the negated operator
-
isOrderedOperator
public static boolean isOrderedOperator(int operator)
-
-