class TopStmt

Attributes

command[RW]

Public Class Methods

new( str, hash ) click to toggle source
# File lib/statsailr/block_builder/sts_block.rb, line 40
def initialize( str, hash )
  @command = str
  @opts = hash
end
new_from_gram_node( node ) click to toggle source
# File lib/statsailr/block_builder/sts_block.rb, line 45
def self.new_from_gram_node( node )
  command_name = node.e1
  top_opts = node.e2
  if (! top_opts.nil? ) && (top_opts.size != 0 )
    hash = {}
    top_opts.each(){|nd|
      top_opt_key = nd.e1
      if(!nd.e2.nil?)
        top_opt_val = type_adjust( nd.e2.e1 , nd.e2.type )
      else
        top_opt_val = nil
      end
      hash[top_opt_key] = top_opt_val
    }
  else
    hash = {}
  end
  return TopStmt.new( command_name, hash)
end