FFI::Generator::Function

Public Class Methods

new(params = { }) click to toggle source
    # File lib/generator/function.rb, line 16
16:       def initialize(params = { })
17:         super
18:         @type = get_attr('type')
19:       end

Public Instance Methods

to_s() click to toggle source
    # File lib/generator/function.rb, line 20
20:       def to_s
21:         params = get_params(@node).inject([]) do |array, node|
22:           array << Argument.new(:node => node, :typedefs => @typedefs).to_s
23:         end
24:         @indent_str + "attach_function :#{@symname}, [ #{params.join(', ')} ], #{get_rtype}"
25:       end

Private Instance Methods

get_params(node) click to toggle source
    # File lib/generator/function.rb, line 27
27:       def get_params(node)
28:         parmlist = node / './attributelist/parmlist/parm'
29:       end
get_rtype() click to toggle source
    # File lib/generator/function.rb, line 30
30:       def get_rtype
31:         pointer = get_attr('decl').scan(/^f\(.*\)\.(p)/).flatten[0]
32:         declaration = pointer ? "p.#{get_attr('type')}" : get_attr('type')
33:         Type.new(:declaration => declaration, :typedefs => @typedefs).to_s
34:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.