Class: Rsec::PInt32

Inherits:
PInt show all
Defined in:
lib/rsec/parsers/prim.rb

Overview

32-bit int parser

Instance Attribute Summary

Attributes inherited from Binary

#left, #right

Attributes included from Parser

#name

Instance Method Summary collapse

Methods inherited from PInt

#_parse, #int_pattern

Methods included from Prim

#sign_strategy_to_pattern

Methods included from Parser

#&, #*, #<<, #>>, #^, #cached, #eof, #fail, #inspect, #join, #map, #maybe, #parse, #parse!, #star, #|

Constructor Details

#initialize(sign_strategy, base) ⇒ PInt32

Returns a new instance of PInt32.



68
69
70
71
72
# File 'lib/rsec/parsers/prim.rb', line 68

def initialize sign_strategy, base
  @base = base
  self.left = int_pattern sign_strategy, base
  self.right = (-(1<<31))..((1<<31)-1)
end