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.
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 |
#clear ⇒ Object
4436 4437 4438 |
# File 'lib/packcr/parser.rb', line 4436 def clear @memos.clear end |