Module: Alf::Engine::Cog

Constant Summary collapse

EMPTY_CHILDREN =
[].freeze
EMPTY_OPTIONS =
{}.freeze

Instance Attribute Summary

Attributes included from Compiler::Cog

#compiler, #expr

Instance Method Summary collapse

Methods included from Compiler::Cog

#cog_orders, #initialize, #orderedby?, #relation_type, #to_ascii_tree, #to_cog, #to_relation

Instance Method Details

#argumentsObject


37
38
39
# File 'lib/alf/engine/cog.rb', line 37

def arguments
  EMPTY_CHILDREN
end

#childrenObject


16
17
18
19
20
# File 'lib/alf/engine/cog.rb', line 16

def children
  return operands  if respond_to?(:operands)
  return [operand] if respond_to?(:operand)
  EMPTY_CHILDREN
end

#each(&bl) ⇒ Object


11
12
13
14
# File 'lib/alf/engine/cog.rb', line 11

def each(&bl)
  return to_enum unless block_given?
  _each(&bl)
end

#optionsObject


41
42
43
# File 'lib/alf/engine/cog.rb', line 41

def options
  EMPTY_OPTIONS
end

#to_sObject


22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/alf/engine/cog.rb', line 22

def to_s
  label = ""
  label << self.class.name.to_s[/Engine::(.*?)$/, 1].to_s
  label << " ..."
  unless (args = arguments).empty?
    label << ", "
    label << args.map{|arg| Support.to_lispy(arg, "[unsupported]") }.join(', ')
  end
  unless (opts = options).empty?
    label << ", "
    label << Support.to_lispy(options, "[unsupported]")
  end
  label
end