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 }.freeze
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.
16 17 18 19 20 |
# File 'lib/c2ffi4rb/parser.rb', line 16 def initialize @struct_type = {} @toplevels = [] @anon_counter = 0 end |
Class Method Details
Instance Method Details
#parse(arr) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/c2ffi4rb/parser.rb', line 22 def parse(arr) arr.each do |form| s = parse_toplevel(form) @toplevels << s if s end @toplevels.each do |t| puts case t when String puts "#{t}" when Array t.each do |l| puts "#{l}" end end end end |