Module: FFIDB::SymbolTable

Includes:
Enumerable
Included in:
Header, Library, LibraryParser
Defined in:
lib/ffidb/symbol_table.rb

Instance Method Summary collapse

Instance Method Details

#each_enum {|enum| ... } ⇒ Enumerator

Yields:

  • (enum)

Yield Parameters:

  • Enum (enum)

Returns:

  • (Enumerator)


58
59
60
61
# File 'lib/ffidb/symbol_table.rb', line 58

def each_enum(&block)
  return self.to_enum(:each_enum) unless block_given?
  self.enums.each(&block)
end

#each_function {|function| ... } ⇒ Enumerator

Yields:

  • (function)

Yield Parameters:

  • Function (function)

Returns:

  • (Enumerator)


85
86
87
88
# File 'lib/ffidb/symbol_table.rb', line 85

def each_function(&block)
  return self.to_enum(:each_function) unless block_given?
  self.functions.each(&block)
end

#each_struct {|struct| ... } ⇒ Enumerator

Yields:

  • (struct)

Yield Parameters:

  • Struct (struct)

Returns:

  • (Enumerator)


67
68
69
70
# File 'lib/ffidb/symbol_table.rb', line 67

def each_struct(&block)
  return self.to_enum(:each_struct) unless block_given?
  self.structs.each(&block)
end

#each_symbol {|symbol| ... } ⇒ Enumerator Also known as: each

Yields:

  • (symbol)

Yield Parameters:

  • Symbolic (symbol)

Returns:

  • (Enumerator)


35
36
37
38
39
40
41
42
# File 'lib/ffidb/symbol_table.rb', line 35

def each_symbol(&block)
  return self.to_enum(:each_symbol) unless block_given?
  self.each_typedef(&block)
  self.each_enum(&block)
  self.each_struct(&block)
  self.each_union(&block)
  self.each_function(&block)
end

#each_type {|type| ... } ⇒ Enumerator

Yields:

  • (type)

Yield Parameters:

  • Type (type)

Returns:

  • (Enumerator)


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ffidb/symbol_table.rb', line 19

def each_type(&block)
  return self.to_enum(:each_type) unless block_given?
  types = {}
  self.each_function do |function| # TODO: each_symbol
    types[function.type.to_s] ||= function.type
    function.parameters.each_value do |parameter|
      types[parameter.type.to_s] ||= parameter.type
    end
  end
  types.values.sort.each(&block)
end

#each_typedef {|typedef| ... } ⇒ Enumerator

Yields:

  • (typedef)

Yield Parameters:

  • Symbolic (symbol)

Returns:

  • (Enumerator)


49
50
51
52
# File 'lib/ffidb/symbol_table.rb', line 49

def each_typedef(&block)
  return self.to_enum(:each_typedef) unless block_given?
  self.typedefs.each(&block)
end

#each_union {|union| ... } ⇒ Enumerator

Yields:

  • (union)

Yield Parameters:

  • Union (union)

Returns:

  • (Enumerator)


76
77
78
79
# File 'lib/ffidb/symbol_table.rb', line 76

def each_union(&block)
  return self.to_enum(:each_union) unless block_given?
  self.unions.each(&block)
end

#typesArray<Type>

Returns:



11
12
13
# File 'lib/ffidb/symbol_table.rb', line 11

def types
  self.each_type.to_a
end