Class: FFI::Generator::Type

Inherits:
Node
  • Object
show all
Defined in:
lib/generator/type.rb

Direct Known Subclasses

Function, Function::Argument, Struct

Defined Under Namespace

Classes: Declaration

Constant Summary collapse

ArraySizeRE =
/([0-9\+\-\*\/\(\)]+)/
ArrayRE =
/^a\(#{ArraySizeRE}\)/

Instance Attribute Summary collapse

Attributes inherited from Node

#symname

Instance Method Summary collapse

Methods inherited from Node

#get_attr

Constructor Details

#initialize(params = { }) ⇒ Type

Returns a new instance of Type.



44
45
46
47
48
49
50
51
# File 'lib/generator/type.rb', line 44

def initialize(params = { })
  super
  params = { :declaration => get_full_decl, :typedefs => { } }.merge(params)
  @full_decl = params[:declaration]
  @typedefs = params[:typedefs] || { }
  @declaration = Declaration.new(@full_decl)
  @is_pointer = 0
end

Instance Attribute Details

#full_declObject (readonly)

Returns the value of attribute full_decl.



4
5
6
# File 'lib/generator/type.rb', line 4

def full_decl
  @full_decl
end

Instance Method Details

#to_sObject



52
53
54
# File 'lib/generator/type.rb', line 52

def to_s
  ffi_type_from(@full_decl)
end