Class: KPeg::CompiledParser::MemoEntry
- Inherits:
-
Object
- Object
- KPeg::CompiledParser::MemoEntry
- Defined in:
- lib/kpeg/compiled_parser.rb
Instance Attribute Summary collapse
-
#ans ⇒ Object
readonly
Returns the value of attribute ans.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#uses ⇒ Object
readonly
Returns the value of attribute uses.
Instance Method Summary collapse
- #inc! ⇒ Object
-
#initialize(ans, pos) ⇒ MemoEntry
constructor
A new instance of MemoEntry.
- #move!(ans, pos, result) ⇒ Object
Constructor Details
#initialize(ans, pos) ⇒ MemoEntry
Returns a new instance of MemoEntry.
191 192 193 194 195 196 |
# File 'lib/kpeg/compiled_parser.rb', line 191 def initialize(ans, pos) @ans = ans @pos = pos @uses = 1 @result = nil end |
Instance Attribute Details
#ans ⇒ Object (readonly)
Returns the value of attribute ans.
198 199 200 |
# File 'lib/kpeg/compiled_parser.rb', line 198 def ans @ans end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
198 199 200 |
# File 'lib/kpeg/compiled_parser.rb', line 198 def pos @pos end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
198 199 200 |
# File 'lib/kpeg/compiled_parser.rb', line 198 def result @result end |
#uses ⇒ Object (readonly)
Returns the value of attribute uses.
198 199 200 |
# File 'lib/kpeg/compiled_parser.rb', line 198 def uses @uses end |
Instance Method Details
#inc! ⇒ Object
200 201 202 |
# File 'lib/kpeg/compiled_parser.rb', line 200 def inc! @uses += 1 end |
#move!(ans, pos, result) ⇒ Object
204 205 206 207 208 |
# File 'lib/kpeg/compiled_parser.rb', line 204 def move!(ans, pos, result) @ans = ans @pos = pos @result = result end |