Class: C2FFI4RB::Parser
- Inherits:
-
Object
- Object
- C2FFI4RB::Parser
- Defined in:
- lib/c2ffi4rb/parser.rb
Constant Summary collapse
- TYPE_TABLE =
{ ':unsigned-int' => ':uint', ':unsigned-char' => ':uchar', ':unsigned-long' => ':ulong', ':function-pointer' => ':pointer' }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(arr) ⇒ Object
Constructor Details
#initialize ⇒ Parser
Returns a new instance of Parser.
18 19 20 21 22 |
# File 'lib/c2ffi4rb/parser.rb', line 18 def initialize @struct_type = [] @toplevels = [] @anon_counter = 0 end |
Class Method Details
.parse(arr) ⇒ Object
[View source]
14 15 16 |
# File 'lib/c2ffi4rb/parser.rb', line 14 def self.parse(arr) Parser.new.parse(arr) end |
Instance Method Details
#parse(arr) ⇒ Object
[View source]
24 25 26 27 28 29 30 |
# File 'lib/c2ffi4rb/parser.rb', line 24 def parse(arr) arr.each do |form| parse_toplevel(form) end puts @toplevels.join("\n\n") end |