Class: Dhaka::SpontaneousChannel

Inherits:
Channel
  • Object
show all
Defined in:
lib/dhaka/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



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/dhaka/parser/channel.rb', line 36

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

#to_sObject



32
33
34
# File 'lib/dhaka/parser/channel.rb', line 32

def to_s
  "Spontaneous " + super
end