Class: Rubex::AST::TopStatement::CBindings
- Inherits:
-
Object
- Object
- Rubex::AST::TopStatement::CBindings
- Defined in:
- lib/rubex/ast/top_statement/c_bindings.rb
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
-
#lib ⇒ Object
readonly
Returns the value of attribute lib.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #analyse_statement(local_scope) ⇒ Object
- #generate_code(code) ⇒ Object
-
#initialize(lib, comp_opts, declarations, location) ⇒ CBindings
constructor
A new instance of CBindings.
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
#declarations ⇒ Object (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 |
#lib ⇒ Object (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 |
#location ⇒ Object (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 |