Class: KPeg::Parser::MemoEntry
- Inherits:
-
Object
- Object
- KPeg::Parser::MemoEntry
- Defined in:
- lib/kpeg/parser.rb
Instance Attribute Summary collapse
-
#ans ⇒ Object
readonly
Returns the value of attribute ans.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#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) ⇒ Object
Constructor Details
#initialize(ans, pos) ⇒ MemoEntry
Returns a new instance of MemoEntry.
58 59 60 61 62 |
# File 'lib/kpeg/parser.rb', line 58 def initialize(ans, pos) @ans = ans @pos = pos @uses = 1 end |
Instance Attribute Details
#ans ⇒ Object (readonly)
Returns the value of attribute ans.
64 65 66 |
# File 'lib/kpeg/parser.rb', line 64 def ans @ans end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
64 65 66 |
# File 'lib/kpeg/parser.rb', line 64 def pos @pos end |
#uses ⇒ Object (readonly)
Returns the value of attribute uses.
64 65 66 |
# File 'lib/kpeg/parser.rb', line 64 def uses @uses end |
Instance Method Details
#inc! ⇒ Object
66 67 68 |
# File 'lib/kpeg/parser.rb', line 66 def inc! @uses += 1 end |
#move!(ans, pos) ⇒ Object
70 71 72 73 |
# File 'lib/kpeg/parser.rb', line 70 def move!(ans, pos) @ans = ans @pos = pos end |