Class: JMESPath::Token Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/jmespath/token.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

NULL_TOKEN =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Token.new(:eof, '', nil)
BINDING_POWER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  Lexer::T_UNKNOWN           => 0,
  Lexer::T_EOF               => 0,
  Lexer::T_QUOTED_IDENTIFIER => 0,
  Lexer::T_IDENTIFIER        => 0,
  Lexer::T_RBRACKET          => 0,
  Lexer::T_RPAREN            => 0,
  Lexer::T_COMMA             => 0,
  Lexer::T_RBRACE            => 0,
  Lexer::T_NUMBER            => 0,
  Lexer::T_CURRENT           => 0,
  Lexer::T_EXPREF            => 0,
  Lexer::T_COLON             => 0,
  Lexer::T_PIPE              => 1,
  Lexer::T_OR                => 2,
  Lexer::T_AND               => 3,
  Lexer::T_COMPARATOR        => 5,
  Lexer::T_FLATTEN           => 9,
  Lexer::T_STAR              => 20,
  Lexer::T_FILTER            => 21,
  Lexer::T_DOT               => 40,
  Lexer::T_NOT               => 45,
  Lexer::T_LBRACE            => 50,
  Lexer::T_LBRACKET          => 55,
  Lexer::T_LPAREN            => 60,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value, position) ⇒ Token

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Token.

Parameters:

  • type (Symbol)
  • value (Mixed)
  • position (Integer)


37
38
39
# File 'lib/jmespath/token.rb', line 37

def initialize(type, value, position)
  super(type, value, position, BINDING_POWER[type])
end

Instance Attribute Details

#binding_powerObject

Returns the value of attribute binding_power

Returns:

  • (Object)

    the current value of binding_power



3
4
5
# File 'lib/jmespath/token.rb', line 3

def binding_power
  @binding_power
end

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



3
4
5
# File 'lib/jmespath/token.rb', line 3

def position
  @position
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



3
4
5
# File 'lib/jmespath/token.rb', line 3

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/jmespath/token.rb', line 3

def value
  @value
end