Class: BinaryParser::Expression::Token::Variable

Inherits:
BinaryParser::Expression::Token show all
Defined in:
lib/binary_parser/general_class/expression.rb

Direct Known Subclasses

Control, Length, Nextbits, Value

Defined Under Namespace

Classes: Control, Length, Nextbits, Value

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BinaryParser::Expression::Token

#to_rpn

Methods inherited from BinaryParser::Expression

#%, #*, #+, #-, #/, #binary_op, #coerce, control_var, #control_var?, #eval, immediate, #immediate?, length_var, #length_var?, nextbits_var, #nextbits_var?, #to_exp, value_var, #value_var?, #variable_tokens

Constructor Details

#initialize(symbol) ⇒ Variable

Returns a new instance of Variable.



129
130
131
132
# File 'lib/binary_parser/general_class/expression.rb', line 129

def initialize(symbol)
  raise BadManipulationError, "Argument should be Symbol." unless symbol.is_a?(Symbol)
  @symbol = symbol
end

Instance Attribute Details

#symbolObject (readonly)

Returns the value of attribute symbol.



127
128
129
# File 'lib/binary_parser/general_class/expression.rb', line 127

def symbol
  @symbol
end