module BELParser::Language::Signature

Signature defines the interface for language-specific signatures used to check expression semantics.

Public Instance Methods

<=>(other) click to toggle source
# File lib/bel_parser/language/signature.rb, line 29
def <=>(other)
  return 1 if other.nil?
  size <=> other.size
end
semantic_ast() click to toggle source
# File lib/bel_parser/language/signature.rb, line 8
def semantic_ast
  raise NotImplementedError, "#{__method__} is not implemented."
end
size() click to toggle source
# File lib/bel_parser/language/signature.rb, line 16
def size
  count = 0
  nodes = [semantic_ast]
  until nodes.empty?
    n = nodes.shift
    if n
      count += 1
      nodes.concat(n.children) if n.respond_to?(:children)
    end
  end
  count
end
string_form() click to toggle source
# File lib/bel_parser/language/signature.rb, line 12
def string_form
  raise NotImplementedError, "#{__method__} is not implemented."
end
to_s() click to toggle source
# File lib/bel_parser/language/signature.rb, line 34
def to_s
  string_form
end