Package net.sf.saxon.expr.parser
Class Token
- java.lang.Object
-
- net.sf.saxon.expr.parser.Token
-
public abstract class Token extends java.lang.ObjectThis 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 intAFTER"after"static intANDOperator "and"static intAND_ALSO"andAlso" (Saxon extension)static intARROWArrow operator "=>" (XQuery 3.1)static intAS"as" (in XQuery Update rename expression)static intASSIGN":=" symbol (XQuery only)static intATAt token, "@"static intATTRIBUTE_QNAMEcomposite token <'attribute' QNAME> (XQuery only)static intAXISToken representing the name of an axis and the following "::" symbolstatic intBANGOperator "!"static intBEFORE"before"static intCASEKeyword "case"static intCAST_ASoperator "cast as"static intCASTABLE_ASoperator "castable as"static intCOLON":" (XPath 3.0 maps)static intCOLONCOLON"::" symbolstatic intCOLONSTAR":*" symbolstatic intCOMMAComma tokenstatic intCONCATOperator "||"static intCOPY"copy" keywordstatic intCOUNT"count" keywordstatic intDECLARE_ANNOTATEDdeclare %static intDECLARE_BASEURI"declare base-uri"static intDECLARE_BOUNDARY_SPACE"declare boundary-space"static intDECLARE_CONSTRUCTION"declare construction"static intDECLARE_CONTEXT"declare context"static intDECLARE_COPY_NAMESPACES"declare copy-namespaces"static intDECLARE_DECIMAL_FORMAT"declare decimal-format"static intDECLARE_DEFAULT"declare default"static intDECLARE_FUNCTION"declare function"static intDECLARE_NAMESPACE"declare namespace"static intDECLARE_OPTION"declare option"static intDECLARE_ORDERING"declare xmlspace"static intDECLARE_REVALIDATION"declare revalidation"static intDECLARE_TYPESaxon extension: declare typestatic intDECLARE_UPDATING"declare updating [function]"static intDECLARE_VARIABLE"declare variable"static intDEFAULTKeyword "default"static intDELETE_NODE"delete node/nodes"static intDIVOperator "div"static intDOLLAR"$" symbolstatic intDOT"." symbolstatic intDOTDOT".." symbolstatic java.util.HashMap<java.lang.String,java.lang.Integer>doubleKeywordsLookup table for composite (two-keyword) tokensstatic intELEMENT_QNAMEcomposite token <'element' QNAME> (XQuery only)static intELSEKeyword "else"static intEOFPseudo-token representing the end of the expressionstatic intEQUALSEquals token ("=")static intEVERYKeyword "every"static intEXCEPTOperator "except"static intFEQoperator "eq"static intFGEoperator "ge"static intFGToperator "gt"static intFIRST_INTO"first into"static intFLEopeartor "le"static intFLToperator "lt"static intFNEoperator "ne"static intFOLLOWSOperator ">>"static intFOR"for" keywordstatic intFOR_MEMBER"for member" (Saxon extension)static intFOR_SLIDING"for sliding" (XQuery 3.0)static intFOR_TUMBLING"for tumbling" (XQuery 3.0)static intFUNCTIONToken representing the name of a function and the following "(" symbolstatic intGEOperator ">="static intGROUP_BYstatic intGTOperator ">"static intHASH# symbolstatic intIDIVoperator "idiv"static intIFKeyword "if"static intIMPLICIT_EOFPseudo-token representing implicit end of expression (the parser doesn't care what follows the expression)static intIMPORT_MODULE"import module"static intIMPORT_SCHEMA"import schema"static intINKeyword "in"static intINSERT_NODE"insert node/nodes"static intINSTANCE_OFoperator "instance of"static intINTERSECTOperator "intersect"static intINTO"into"static intISOperator "is"static intKEYWORD_CURLYcomposite token: <keyword "{"> (XQuery only)static intLAST_INTO"last into"static intLCURLY"{" symbol (XQuery only)static intLEOperator "<="static intLET"let" keyword (XQuery only)static intLPARLeft parenthesisstatic intLSQBLeft square bracketstatic intLTOperator "<"static intMINUSBinary minus operatorstatic intMODOperator "mod"static intMODIFYKeyword "modify"static intMODULE_NAMESPACE"module namespace"static intMULTMultiply operator, "*" when used in an operator contextstatic intNAMEName token (a QName, in general)static intNAMED_FUNCTION_REFToken representing a function name and the following "#" symbolstatic intNAMESPACE_QNAMEcomposite token <'namespace' QNAME> (XQuery only)static intNEOperator not-equals.static intNEGATEUnary minus signstatic intNODEKINDNode kind, e.g.static intNUMBERNumeric literalstatic intOROperator "or"static intOR_ELSE"orElse" (Saxon extension)static intOTHERWISE"otherwise" (Saxon extension)static intPERCENTpercent sign '%'static intPI_QNAMEcomposite token <'pi' QNAME> (XQuery only)static intPLUSOperator "+"static intPRAGMAA token representing an XQuery pragma.static intPRECEDESOperator "<<"static intPREFIX"prefix:*" tokenstatic intQMARKQuestion mark symbol.static intRCURLY"}" symbol (XQuery only)static intRENAME_NODE"rename node"static intREPLACE_NODE"replace node/nodes"static intREPLACE_VALUE"replace value"static intRETURNKeyword "return"static intRPARRight parenthesisstatic intRSQBRight square bracketstatic intSATISFIESKeyword "satisfies"static intSEMICOLONsemicolon separatorstatic intSLASHForwards "/"static intSLASH_SLASHDouble forwards slash, "//"static intSOMEKeyword "some"static intSTAR"*" symbol when used as a wildcardstatic intSTRING_CONSTRUCTOR_INITIALFirst part of a string template.static intSTRING_LITERALString literalstatic intSTRING_LITERAL_BACKTICKEDComplete string template with no embedded expressionsstatic intSUFFIX"*:" tokenstatic intSWITCHKeyword "switch" (XQuery 1.1)static intTAG"<" at the start of a tag (XQuery only).static intTHENKetword "then"static intTOOperator "to"static java.lang.String[]tokensThe following strings are used to represent tokens in error messagesstatic intTREAT_ASoperator "treat as"static intTYPESWITCHKeyword "typeswitch"static intUNION"union" or "|" tokenstatic intUNKNOWNPseudo-token representing the start of the expressionstatic intVALIDATEVarious compound symbols supporting XQuery validation expressionstatic intVALIDATE_LAXstatic intVALIDATE_STRICTstatic intVALIDATE_TYPEstatic intWHEREKeyword "where"static intWITH"with"static intXQUERY_ENCODING"xquery encoding"static intXQUERY_VERSION"xquery version"
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intinverse(int operator)Return the inverse of a relational operator, so that "a op b" can be rewritten as "b inverse(op) a"static booleanisOrderedOperator(int operator)static intnegate(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)
-
-