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.



4776
4777
4778
# File 'lib/packcr/parser.rb', line 4776

def initialize
  @memos = {}
end

Instance Method Details

#[](index, rule_name) ⇒ Object



4789
4790
4791
# File 'lib/packcr/parser.rb', line 4789

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

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



4784
4785
4786
4787
# File 'lib/packcr/parser.rb', line 4784

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

#clearObject



4780
4781
4782
# File 'lib/packcr/parser.rb', line 4780

def clear
  @memos.clear
end