Class: NonTerminal
- Inherits:
-
GrammarSymbol
- Object
- Element
- GrammarSymbol
- NonTerminal
- Includes:
- Indexable
- Defined in:
- lib/rpdf2txt-rockit/parsetable_generation.rb,
lib/rpdf2txt-rockit/grammar.rb
Overview
Decorate the grammar symbols with some additional info we’re gonna need
Instance Attribute Summary collapse
-
#derives_epsilon ⇒ Object
writeonly
Sets the attribute derives_epsilon.
-
#nonkernel_items ⇒ Object
readonly
Returns the value of attribute nonkernel_items.
Attributes included from Indexable
Attributes inherited from GrammarSymbol
Attributes inherited from Element
#sub_elements, #tree_specification
Instance Method Summary collapse
- #calc_nonkernel_items(grammar, itemFactory) ⇒ Object
- #derives_epsilon? ⇒ Boolean
- #nonterminal? ⇒ Boolean
- #terminal? ⇒ Boolean
Methods inherited from GrammarSymbol
#==, #eql?, #hash, #initialize, #inspect, #to_src
Methods inherited from Element
Methods included from SourceCodeDumpable
as_code, as_method_named, as_module_method_named, #create_new, indent_lines, name_hash, #new_of_my_type, #parameter_named, #to_compact_src, #to_src_in_module, #type_to_src
Constructor Details
This class inherits a constructor from GrammarSymbol
Instance Attribute Details
#derives_epsilon=(value) ⇒ Object (writeonly)
Sets the attribute derives_epsilon
142 143 144 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 142 def derives_epsilon=(value) @derives_epsilon = value end |
#nonkernel_items ⇒ Object (readonly)
Returns the value of attribute nonkernel_items.
131 132 133 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 131 def nonkernel_items @nonkernel_items end |
Instance Method Details
#calc_nonkernel_items(grammar, itemFactory) ⇒ Object
132 133 134 135 136 137 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 132 def calc_nonkernel_items(grammar, itemFactory) @nonkernel_items = Array.new grammar.alternatives(self).each do |production| @nonkernel_items.push itemFactory.make(production, 0) end end |
#derives_epsilon? ⇒ Boolean
144 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 144 def derives_epsilon?; @derives_epsilon; end |
#nonterminal? ⇒ Boolean
139 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 139 def nonterminal?; true; end |
#terminal? ⇒ Boolean
140 |
# File 'lib/rpdf2txt-rockit/parsetable_generation.rb', line 140 def terminal?; false; end |