Class: Rsec::PInt32
Overview
32-bit int parser
Instance Attribute Summary
Attributes inherited from Binary
Attributes included from Parser
Instance Method Summary collapse
-
#initialize(sign_strategy, base) ⇒ PInt32
constructor
A new instance of PInt32.
Methods inherited from PInt
Methods included from Prim
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 |