Class: Rubex::AST::TopStatement::CBindings

Inherits:
Object
  • Object
show all
Defined in:
lib/rubex/ast/top_statement/c_bindings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lib, comp_opts, declarations, location) ⇒ CBindings

Returns a new instance of CBindings.



7
8
9
10
11
12
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 7

def initialize(lib, comp_opts, declarations, location)
  @lib = lib
  @comp_opts = comp_opts
  @declarations = declarations
  @location = location
end

Instance Attribute Details

#declarationsObject (readonly)

Returns the value of attribute declarations.



5
6
7
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 5

def declarations
  @declarations
end

#libObject (readonly)

Returns the value of attribute lib.



5
6
7
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 5

def lib
  @lib
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 5

def location
  @location
end

Instance Method Details

#analyse_statement(local_scope) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 14

def analyse_statement(local_scope)
  unless @declarations
    @declarations = []
    load_predecided_declarations
  end
  @declarations.each do |stat|
    stat.analyse_statement local_scope, extern: true
  end
  local_scope.include_files.push @lib
  update_compiler_config
end

#generate_code(code) ⇒ Object



26
# File 'lib/rubex/ast/top_statement/c_bindings.rb', line 26

def generate_code(code); end