Class: Dhaka::SpontaneousChannel

Inherits:
Channel
  • Object
show all
Defined in:
lib/parser/channel.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Channel

#end_item, #start_item

Instance Method Summary collapse

Methods inherited from Channel

#eql?, #hash, #initialize, #propagate

Constructor Details

This class inherits a constructor from Dhaka::Channel

Instance Method Details

#pumpObject



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/parser/channel.rb', line 31

def pump
  follow_index = @start_item.next_item_index + 1
  cargo = Set.new
  while follow_symbol = @start_item.production.expansion[follow_index]
    cargo += @grammar.first(follow_symbol)
    return propagate(cargo) unless follow_symbol.nullable
    follow_index += 1
  end
  cargo += @start_item.lookaheadset
  propagate cargo
end

#to_sObject



28
29
30
# File 'lib/parser/channel.rb', line 28

def to_s
  "Spontaneous " + super.to_s
end