Class: Packcr::Parser::LrMemoTable

Inherits:
Object
  • Object
show all
Defined in:
lib/packcr/parser.rb

Instance Method Summary collapse

Constructor Details

#initializeLrMemoTable

Returns a new instance of LrMemoTable.



4432
4433
4434
# File 'lib/packcr/parser.rb', line 4432

def initialize
  @memos = {}
end

Instance Method Details

#[](index, rule_name) ⇒ Object



4445
4446
4447
# File 'lib/packcr/parser.rb', line 4445

def [](index, rule_name)
  @memos.dig(index, rule_name)
end

#[]=(index, rule_name, memo) ⇒ Object



4440
4441
4442
4443
# File 'lib/packcr/parser.rb', line 4440

def []=(index, rule_name, memo)
  entry = @memos[index] ||= {}
  entry[rule_name] = memo
end

#clearObject



4436
4437
4438
# File 'lib/packcr/parser.rb', line 4436

def clear
  @memos.clear
end