Class Token

java.lang.Object
net.sf.saxon.expr.parser.Token

public abstract class Token extends 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 final int
    "after"
    static final int
    Operator "and"
    static final int
    "andAlso" (Saxon extension)
    static final int
    "as" (in XQuery Update rename expression)
    static final int
    ":=" symbol (XQuery only)
    static final int
    At token, "@"
    static final int
    composite token <'attribute' QNAME> (XQuery only)
    static final int
    Token representing the name of an axis and the following "::" symbol
    static final int
    Backtick (introducing a 4.0 string template)
    static final int
    Operator "!"
    static final int
     
    static final int
    "before"
    static final int
     
    static final int
    Keyword "case"
    static final int
    operator "cast as"
    static final int
    operator "castable as"
    static final int
    ":" (XPath 3.0 maps)
    static final int
    "::" symbol
    static final int
    ":*" symbol
    static final int
    Comma token
    static final int
    Operator "||"
    static final int
    "copy" keyword
    static final int
    "count" keyword
    static final int
    declare %
    static final int
    "declare base-uri"
    static final int
    "declare boundary-space"
    static final int
    "declare construction"
    static final int
    "declare context"
    static final int
    "declare copy-namespaces"
    static final int
    "declare decimal-format"
    static final int
    "declare default"
    static final int
    "declare fixed"
    static final int
    "declare function"
    static final int
    Saxon extension: declare type
    static final int
    "declare namespace"
    static final int
    "declare option"
    static final int
    "declare xmlspace"
    static final int
    "declare revalidation"
    static final int
    "declare updating [function]"
    static final int
    "declare variable"
    static final int
    Keyword "default"
    static final int
    "delete node/nodes"
    static final int
    Operator "div"
    static final int
    "$" symbol
    static final int
    "." symbol
    static final int
    ".." symbol
    Lookup table for composite (two-keyword) tokens
    static final int
    composite token <'element' QNAME> (XQuery only)
    static final int
    Keyword "else"
    static final int
    Pseudo-token representing the end of the expression
    static final int
    Equals token ("=")
    static final int
    Keyword "every"
    static final int
    Operator "except"
    static final int
    Arrow operator "=>" (XQuery 3.1)
    static final int
    operator "eq"
    static final int
    operator "ge"
    static final int
    operator "gt"
    static final int
    "first into"
    static final int
    opeartor "le"
    static final int
    operator "lt"
    static final int
    operator "ne"
    static final int
    Operator ">>"
    static final int
    "for" keyword
    static final int
    "for member" (XQuery 4.0)
    static final int
    "for sliding" (XQuery 3.0)
    static final int
    "for tumbling" (XQuery 3.0)
    static final int
    Token representing the name of a function and the following "(" symbol
    static final int
    Operator ">="
    static final int
     
    static final int
    Operator ">"
    static final int
    # symbol
    static final int
     
    static final int
    operator "idiv"
    static final int
    Keyword "if"
    static final int
    Pseudo-token representing implicit end of expression (the parser doesn't care what follows the expression)
    static final int
    "import module"
    static final int
    "import schema"
    static final int
    Keyword "in"
    static final int
    "insert node/nodes"
    static final int
    operator "instance of"
    static final int
    Operator "intersect"
    static final int
    "into"
    static final int
    Operator "is"
    static final int
    composite token: <keyword "{"> (XQuery only)
    static final int
    `name(` for a reserved function name, e.g.
    static final int
    "last into"
    static final int
    Constant identifying the token number of the last token to be classified as an operator
    static final int
    "{" symbol (XQuery only)
    static final int
    Operator "<="
    static final int
    "let" keyword (XQuery only)
    static final int
    Left parenthesis
    static final int
    Left square bracket
    static final int
    Operator "<"
    static final int
    Arrow operator "=>" (XQuery 3.1)
    static final int
    Mathematical divide operator "÷"
    static final int
    Mathematical multiply operator "×"
    static final int
    Binary minus operator
    static final int
    Operator "mod"
    static final int
    Keyword "modify"
    static final int
    "module namespace"
    static final int
    Multiply operator, "*" when used in an operator context
    static final int
    Name token (a QName, in general)
    static final int
    Token representing a function name and the following "#" symbol
    static final int
    composite token <'namespace' QNAME> (XQuery only)
    static final int
    Operator not-equals.
    static final int
    Unary minus sign
    static final int
    Numeric literal
    static final int
    Operator "or"
    static final int
    "orElse" (Saxon extension)
    static final int
    "otherwise" (Saxon extension)
    static final int
    percent sign '%'
    static final int
    composite token <'pi' QNAME> (XQuery only)
    static final int
    Operator "+"
    static final int
    A token representing an XQuery pragma.
    static final int
    Operator "<<"
    static final int
    "prefix:*" token
    static final int
    Question mark symbol.
    static final int
    operator "??"
    static final int
    "}" symbol (XQuery only)
    static final int
    "rename node"
    static final int
    "replace node/nodes"
    static final int
    "replace value"
    static final int
    Keyword "return"
    static final int
    Right parenthesis
    static final int
    Right square bracket
    static final int
    Keyword "satisfies"
    static final int
    semicolon separator
    static final int
    Forwards "/"
    static final int
    Double forwards slash, "//"
    static final int
    Keyword "some"
    static final int
    "*" symbol when used as a wildcard
    static final int
    First part of a string template.
    static final int
    String literal
    static final int
    Complete string constructor with no embedded expressions
    static final int
    "*:" token
    static final int
    Keyword "switch" (XQuery 1.1)
    static final int
     
    static final int
    "<" at the start of a tag (XQuery only).
    static final int
    Ketword "then"
    static final int
    Thin arrow operator "->" (XQuery 4.0)
    static final int
    Operator "to"
    static final String[]
    The following strings are used to represent tokens in error messages
    static final int
    operator "treat as"
    static final int
    Keyword "typeswitch"
    static final int
    "union" or "|" token
    static final int
    Pseudo-token representing the start of the expression
    static final int
    Various compound symbols supporting XQuery validation expression
    static final int
     
    static final int
     
    static final int
     
    static final int
    Keyword "where"
    static final int
    Keyword "while"
    static final int
    "with"
    static final int
    "xquery encoding"
    static final int
    "xquery version"
  • Method Summary

    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)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • 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)