Class: LrState
- Includes:
- Indexable
- Defined in:
- lib/rpdf2txt-rockit/parsetable_generation.rb
Instance Attribute Summary collapse
-
#closure ⇒ Object
readonly
Returns the value of attribute closure.
-
#final_items ⇒ Object
readonly
Returns the value of attribute final_items.
-
#kernel_items ⇒ Object
readonly
Returns the value of attribute kernel_items.
Attributes included from Indexable
Instance Method Summary collapse
- #consistent? ⇒ Boolean
-
#initialize(kernelItems) ⇒ LrState
constructor
A new instance of LrState.
- #inspect ⇒ Object
- #length ⇒ Object
- #reduce_state? ⇒ Boolean
Constructor Details
#initialize(kernelItems) ⇒ LrState
Returns a new instance of LrState.
86 87 88 89 90 91 92 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 86 def initialize(kernelItems) @kernel_items = kernelItems calc_closure(kernelItems) # Do it lazily instead? @final_items = kernelItems.select {|i| i.final?} @reduce_state = @final_items.length > 0 @consistent = kernelItems.length == 1 end |
Instance Attribute Details
#closure ⇒ Object (readonly)
Returns the value of attribute closure.
84 85 86 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 84 def closure @closure end |
#final_items ⇒ Object (readonly)
Returns the value of attribute final_items.
84 85 86 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 84 def final_items @final_items end |
#kernel_items ⇒ Object (readonly)
Returns the value of attribute kernel_items.
84 85 86 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 84 def kernel_items @kernel_items end |
Instance Method Details
#consistent? ⇒ Boolean
98 99 100 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 98 def consistent? @consistent end |
#inspect ⇒ Object
106 107 108 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 106 def inspect "State(#{@kernel_items.inspect})" end |
#length ⇒ Object
102 103 104 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 102 def length @kernel_items.length end |
#reduce_state? ⇒ Boolean
94 95 96 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 94 def reduce_state? @reduce_state end |