class Parser::Lexer::StackState
Public Class Methods
Source
# File lib/parser/lexer/stack_state.rb, line 6 def initialize(name) @name = name.freeze clear end
Public Instance Methods
Source
# File lib/parser/lexer/stack_state.rb, line 29 def lexpop @stack = ((@stack >> 1) | (@stack & 1)) @stack[0] == 1 end
Source
# File lib/parser/lexer/stack_state.rb, line 22 def pop bit_value = @stack & 1 @stack >>= 1 bit_value == 1 end
Source
# File lib/parser/lexer/stack_state.rb, line 15 def push(bit) bit_value = bit ? 1 : 0 @stack = (@stack << 1) | bit_value bit end