java.lang.Object
org.loboevolution.apache.xpath.compiler.OpCodes

public class OpCodes extends Object
Operations codes for XPath.

Code for the descriptions of the operations codes: [UPPER CASE] indicates a literal value, [lower case] is a description of a value, ([length] always indicates the length of the operation, including the operations code and the length integer.) {UPPER CASE} indicates the given production, {description} is the description of a new production, (For instance, {boolean expression} means some expression that should be resolved to a boolean.) * means that it occurs zero or more times, + means that it occurs one or more times, ? means that it is optional.

returns: indicates what the production should return.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The end of the axes types.
    static final int
    [FROM_stepType] [length, including predicates] [length of just the step, without the predicates] {node test} {predicates}?
    static final int
    [ELEMWILDCARD] Means ELEMWILDCARD ("*"), used instead of string index in some places.
    static final int
    [EMPTY] Empty slot to indicate NULL.
    static final int
    [ENDOP] Some operators may like to have a terminator.
    static final int
    ancestor axes opcode.
    static final int
    ancestor-or-self axes opcode.
    static final int
    attribute axes opcode.
    static final int
    children axes opcode.
    static final int
    descendants axes opcode.
    static final int
    descendants-of-self axes opcode.
    static final int
    following axes opcode.
    static final int
    following-siblings axes opcode.
    static final int
    namespace axes opcode.
    static final int
    parent axes opcode.
    static final int
    preceding axes opcode.
    static final int
    preceding-sibling axes opcode.
    static final int
    '/' axes opcode.
    static final int
    self axes opcode.
    static final int
    For match patterns.
    static final int
    For match patterns.
    static final int
    For match patterns.
    static final int
    [NODENAME] [index to ns token or EMPTY] [index to name token]
    static final int
    [NODETYPE_ANY] No size or arguments.
    static final int
    [NODETYPE_COMMENT] No size or arguments.
    static final int
    [NODETYPE_ANY] No size or arguments.
    static final int
    [NODETYPE_NODE] No size or arguments.
    static final int
    [NODETYPE_PI] [index to token] Note: must not overlap function OP number!
    static final int
    [NODETYPE_ROOT] No size or arguments.
    static final int
    [NODETYPE_TEXT] No size or arguments.
    static final int
    [OP_AND] [length] {boolean expression} {boolean expression}
    static final int
    [OP_ARGUMENT] (final Function argument.)
    static final int
    [OP_BOOL] (cast operation) [length] {expression}
    static final int
    [OP_DIV] [length] {number expression} {number expression}
    static final int
    [OP_EQUALS] [length] {expression} {expression}
    static final int
    [OP_EXTFUNCTION] (Extension function.)
    static final int
    [OP_FUNCTION] [length] [FUNC_name] {OP_ARGUMENT} [ENDOP]
    static final int
    [OP_GROUP] [length] {expression}
    static final int
    [OP_GT] (greater-than) [length] {number expression} {number expression}
    static final int
    [OP_GTE] (greater-than-or-equals) [length] {number expression} {number expression}
    static final int
    [OP_LITERAL] [3] [index to token]
    static final int
    [OP_LOCATIONPATH] [length] {FROM_stepType} | {function} {predicate} [ENDOP]
    static final int
    [OP_LOCATIONPATHPATTERN] [length] {FROM_stepType} | {function}{predicate} [ENDOP] returns: XNodeSet
    static final int
    [OP_LT] (less-than) [length] {number expression} {number expression}
    static final int
    [OP_LTE] (less-than-or-equals) [length] {number expression} {number expression}
    static final int
    [OP_MATCHPATTERN] [length] {PathExpr}+
    static final int
    [OP_MINUS] [length] {number expression} {number expression}
    static final int
    [OP_MOD] [length] {number expression} {number expression}
    static final int
    [OP_MULT] [length] {number expression} {number expression}
    static final int
    [OP_NEG] [length] {number expression}
    static final int
    [OP_NOTEQUALS] [length] {expression} {expression}
    static final int
    [OP_NUMBER] (cast operation) [length] {expression}
    static final int
    [OP_NUMBERLIT] (Number literal.) [3] [index to token]
    static final int
    [OP_OR] [length] {boolean expression} {boolean expression}
    static final int
    [OP_PLUS] [length] {number expression} {number expression}
    static final int
    [OP_PREDICATE] [length] {expression} [ENDOP] (For safety)
    static final int
    [OP_QUO] [length] {number expression} {number expression}
    static final int
    [OP_STRING] (cast operation) [length] {expression}
    static final int
    [OP_UNION] [length] {PathExpr}+
    static final int
    [OP_VARIABLE] [4] [index to namespace token, or EMPTY] [index to function name token]
    static final int
    [OP_XPATH] [length] {expression}
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • ENDOP

      public static final int ENDOP
      [ENDOP] Some operators may like to have a terminator.
      See Also:
    • EMPTY

      public static final int EMPTY
      [EMPTY] Empty slot to indicate NULL.
      See Also:
    • ELEMWILDCARD

      public static final int ELEMWILDCARD
      [ELEMWILDCARD] Means ELEMWILDCARD ("*"), used instead of string index in some places.
      See Also:
    • OP_XPATH

      public static final int OP_XPATH
      [OP_XPATH] [length] {expression}

      returns: XNodeSet XNumber XString XBoolean XRTree XObject

      See Also:
    • OP_OR

      public static final int OP_OR
      [OP_OR] [length] {boolean expression} {boolean expression}

      returns: XBoolean

      See Also:
    • OP_AND

      public static final int OP_AND
      [OP_AND] [length] {boolean expression} {boolean expression}

      returns: XBoolean

      See Also:
    • OP_NOTEQUALS

      public static final int OP_NOTEQUALS
      [OP_NOTEQUALS] [length] {expression} {expression}

      returns: XBoolean

      See Also:
    • OP_EQUALS

      public static final int OP_EQUALS
      [OP_EQUALS] [length] {expression} {expression}

      returns: XBoolean

      See Also:
    • OP_LTE

      public static final int OP_LTE
      [OP_LTE] (less-than-or-equals) [length] {number expression} {number expression}

      returns: XBoolean

      See Also:
    • OP_LT

      public static final int OP_LT
      [OP_LT] (less-than) [length] {number expression} {number expression}

      returns: XBoolean

      See Also:
    • OP_GTE

      public static final int OP_GTE
      [OP_GTE] (greater-than-or-equals) [length] {number expression} {number expression}

      returns: XBoolean

      See Also:
    • OP_GT

      public static final int OP_GT
      [OP_GT] (greater-than) [length] {number expression} {number expression}

      returns: XBoolean

      See Also:
    • OP_PLUS

      public static final int OP_PLUS
      [OP_PLUS] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_MINUS

      public static final int OP_MINUS
      [OP_MINUS] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_MULT

      public static final int OP_MULT
      [OP_MULT] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_DIV

      public static final int OP_DIV
      [OP_DIV] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_MOD

      public static final int OP_MOD
      [OP_MOD] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_QUO

      public static final int OP_QUO
      [OP_QUO] [length] {number expression} {number expression}

      returns: XNumber

      See Also:
    • OP_NEG

      public static final int OP_NEG
      [OP_NEG] [length] {number expression}

      returns: XNumber

      See Also:
    • OP_STRING

      public static final int OP_STRING
      [OP_STRING] (cast operation) [length] {expression}

      returns: XString

      See Also:
    • OP_BOOL

      public static final int OP_BOOL
      [OP_BOOL] (cast operation) [length] {expression}

      returns: XBoolean

      See Also:
    • OP_NUMBER

      public static final int OP_NUMBER
      [OP_NUMBER] (cast operation) [length] {expression}

      returns: XBoolean

      See Also:
    • OP_UNION

      public static final int OP_UNION
      [OP_UNION] [length] {PathExpr}+

      returns: XNodeSet

      See Also:
    • OP_LITERAL

      public static final int OP_LITERAL
      [OP_LITERAL] [3] [index to token]

      returns: XString

      See Also:
    • OP_VARIABLE

      public static final int OP_VARIABLE
      [OP_VARIABLE] [4] [index to namespace token, or EMPTY] [index to function name token]

      returns: XString

      See Also:
    • OP_GROUP

      public static final int OP_GROUP
      [OP_GROUP] [length] {expression}

      returns: XNodeSet XNumber XString XBoolean XRTree XObject

      See Also:
    • OP_EXTFUNCTION

      public static final int OP_EXTFUNCTION
      [OP_EXTFUNCTION] (Extension function.) [length] [index to namespace token] [index to function name token] {OP_ARGUMENT}

      returns: XNodeSet XNumber XString XBoolean XRTree XObject

      See Also:
    • OP_FUNCTION

      public static final int OP_FUNCTION
      [OP_FUNCTION] [length] [FUNC_name] {OP_ARGUMENT} [ENDOP]

      returns: XNodeSet XNumber XString XBoolean XRTree XObject

      See Also:
    • OP_ARGUMENT

      public static final int OP_ARGUMENT
      [OP_ARGUMENT] (final Function argument.) [length] {expression}

      returns: XNodeSet XNumber XString XBoolean XRTree XObject

      See Also:
    • OP_NUMBERLIT

      public static final int OP_NUMBERLIT
      [OP_NUMBERLIT] (Number literal.) [3] [index to token]

      returns: XString

      See Also:
    • OP_LOCATIONPATH

      public static final int OP_LOCATIONPATH
      [OP_LOCATIONPATH] [length] {FROM_stepType} | {function} {predicate} [ENDOP]

      (Note that element and attribute namespaces and names can be wildcarded '*'.)

      returns: XNodeSet

      See Also:
    • OP_PREDICATE

      public static final int OP_PREDICATE
      [OP_PREDICATE] [length] {expression} [ENDOP] (For safety)

      returns: XBoolean or XNumber

      See Also:
    • OP_MATCHPATTERN

      public static final int OP_MATCHPATTERN
      [OP_MATCHPATTERN] [length] {PathExpr}+

      returns: XNodeSet

      See Also:
    • OP_LOCATIONPATHPATTERN

      public static final int OP_LOCATIONPATHPATTERN
      [OP_LOCATIONPATHPATTERN] [length] {FROM_stepType} | {function}{predicate} [ENDOP] returns: XNodeSet
      See Also:
    • NODETYPE_COMMENT

      public static final int NODETYPE_COMMENT
      [NODETYPE_COMMENT] No size or arguments. Note: must not overlap function OP number!

      returns: XBoolean

      See Also:
    • NODETYPE_TEXT

      public static final int NODETYPE_TEXT
      [NODETYPE_TEXT] No size or arguments. Note: must not overlap function OP number!

      returns: XBoolean

      See Also:
    • NODETYPE_PI

      public static final int NODETYPE_PI
      [NODETYPE_PI] [index to token] Note: must not overlap function OP number!

      returns: XBoolean

      See Also:
    • NODETYPE_NODE

      public static final int NODETYPE_NODE
      [NODETYPE_NODE] No size or arguments. Note: must not overlap function OP number!

      returns: XBoolean

      See Also:
    • NODENAME

      public static final int NODENAME
      [NODENAME] [index to ns token or EMPTY] [index to name token]

      returns: XBoolean

      See Also:
    • NODETYPE_ROOT

      public static final int NODETYPE_ROOT
      [NODETYPE_ROOT] No size or arguments.

      returns: XBoolean

      See Also:
    • NODETYPE_ANYELEMENT

      public static final int NODETYPE_ANYELEMENT
      [NODETYPE_ANY] No size or arguments.

      returns: XBoolean

      See Also:
    • NODETYPE_FUNCTEST

      public static final int NODETYPE_FUNCTEST
      [NODETYPE_ANY] No size or arguments.

      returns: XBoolean

      See Also:
    • AXES_START_TYPES

      public static final int AXES_START_TYPES
      [FROM_stepType] [length, including predicates] [length of just the step, without the predicates] {node test} {predicates}?

      returns: XBoolean

      See Also:
    • FROM_ANCESTORS

      public static final int FROM_ANCESTORS
      ancestor axes opcode.
      See Also:
    • FROM_ANCESTORS_OR_SELF

      public static final int FROM_ANCESTORS_OR_SELF
      ancestor-or-self axes opcode.
      See Also:
    • FROM_ATTRIBUTES

      public static final int FROM_ATTRIBUTES
      attribute axes opcode.
      See Also:
    • FROM_CHILDREN

      public static final int FROM_CHILDREN
      children axes opcode.
      See Also:
    • FROM_DESCENDANTS

      public static final int FROM_DESCENDANTS
      descendants axes opcode.
      See Also:
    • FROM_DESCENDANTS_OR_SELF

      public static final int FROM_DESCENDANTS_OR_SELF
      descendants-of-self axes opcode.
      See Also:
    • FROM_FOLLOWING

      public static final int FROM_FOLLOWING
      following axes opcode.
      See Also:
    • FROM_FOLLOWING_SIBLINGS

      public static final int FROM_FOLLOWING_SIBLINGS
      following-siblings axes opcode.
      See Also:
    • FROM_PARENT

      public static final int FROM_PARENT
      parent axes opcode.
      See Also:
    • FROM_PRECEDING

      public static final int FROM_PRECEDING
      preceding axes opcode.
      See Also:
    • FROM_PRECEDING_SIBLINGS

      public static final int FROM_PRECEDING_SIBLINGS
      preceding-sibling axes opcode.
      See Also:
    • FROM_SELF

      public static final int FROM_SELF
      self axes opcode.
      See Also:
    • FROM_NAMESPACE

      public static final int FROM_NAMESPACE
      namespace axes opcode.
      See Also:
    • FROM_ROOT

      public static final int FROM_ROOT
      '/' axes opcode.
      See Also:
    • MATCH_ATTRIBUTE

      public static final int MATCH_ATTRIBUTE
      For match patterns.
      See Also:
    • MATCH_ANY_ANCESTOR

      public static final int MATCH_ANY_ANCESTOR
      For match patterns.
      See Also:
    • MATCH_IMMEDIATE_ANCESTOR

      public static final int MATCH_IMMEDIATE_ANCESTOR
      For match patterns.
      See Also:
    • AXES_END_TYPES

      public static final int AXES_END_TYPES
      The end of the axes types.
      See Also:
  • Constructor Details

    • OpCodes

      public OpCodes()