Sha256: 540b946a2b1b4bc91a013de9232049aa68bfb6c3f1e5668ba48e7f1553333aa7

Contents?: true

Size: 937 Bytes

Versions: 30

Compression:

Stored size: 937 Bytes

Contents

require 'rd/block-element'
require 'rd/element'

module RD
  class List < BlockElement
    include NonterminalElement
    attr_reader :items
    
    def initialize
      @items = []
    end
    
    alias each_item each_child
  
    def children
      @items
    end
  end
  
  class ListItem < BlockElement
    include NonterminalElement
    
    attr_reader :content
    
    def initialize
      @content = []
    end
    
    alias each_block each_child
    
    def children
      @content
    end
  end
  
  class ItemList < List
    def accept(visitor)
      visitor.visit_ItemList(self)
    end
  end
  class ItemListItem < ListItem
    def accept(visitor)
      visitor.visit_ItemListItem(self)
    end
  end
  
  class EnumList < List
    def accept(visitor)
      visitor.visit_EnumList(self)
    end
  end
  class EnumListItem < ListItem
    def accept(visitor)
      visitor.visit_EnumListItem(self)
    end
  end
end # RD

Version data entries

30 entries across 29 versions & 4 rubygems

Version Path
rdtool-0.6.31 lib/rd/list.rb
rdtool-0.6.30 lib/rd/list.rb
rdtool-0.6.29 lib/rd/list.rb
rdtool-0.6.28 lib/rd/list.rb
rdtool-0.6.27 lib/rd/list.rb
rdtool-0.6.26 lib/rd/list.rb
rdtool-0.6.25 lib/rd/list.rb
rdtool-0.6.23 lib/rd/list.rb
rd2odt-0.1.1 lib/rd2odt/rdtool/rd/list.rb
rd2odt-0.1.0 lib/rd2odt/rdtool/rd/list.rb