Class: Packcr::Parser::LrMemoTable
- Inherits:
-
Object
- Object
- Packcr::Parser::LrMemoTable
- Defined in:
- lib/packcr/parser.rb
Instance Method Summary collapse
- #[](index, rule_name) ⇒ Object
- #[]=(index, rule_name, memo) ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ LrMemoTable
constructor
A new instance of LrMemoTable.
Constructor Details
#initialize ⇒ LrMemoTable
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 |
#clear ⇒ Object
4780 4781 4782 |
# File 'lib/packcr/parser.rb', line 4780 def clear @memos.clear end |