Class: Rubex::AST::Statement::CArrayDecl
- Defined in:
- lib/rubex/ast/statement/c_array_decl.rb
Instance Attribute Summary collapse
-
#array_list ⇒ Object
readonly
Returns the value of attribute array_list.
-
#dimension ⇒ Object
readonly
Returns the value of attribute dimension.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
Instance Method Summary collapse
- #analyse_statement(local_scope, extern: false) ⇒ Object
- #generate_code(code, local_scope) ⇒ Object
-
#initialize(type, array_ref, array_list, location) ⇒ CArrayDecl
constructor
A new instance of CArrayDecl.
- #rescan_declarations(local_scope) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(type, array_ref, array_list, location) ⇒ CArrayDecl
Returns a new instance of CArrayDecl.
7 8 9 10 11 12 13 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 7 def initialize(type, array_ref, array_list, location) super(location) @name = array_ref.name @array_list = array_list @dimension = array_ref.pos[0] @type = Rubex::TYPE_MAPPINGS[type].new end |
Instance Attribute Details
#array_list ⇒ Object (readonly)
Returns the value of attribute array_list.
5 6 7 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 5 def array_list @array_list end |
#dimension ⇒ Object (readonly)
Returns the value of attribute dimension.
5 6 7 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 5 def dimension @dimension end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 5 def type @type end |
Instance Method Details
#analyse_statement(local_scope, extern: false) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 15 def analyse_statement(local_scope, extern: false) @dimension.analyse_types local_scope create_symbol_table_entry local_scope return if @array_list.nil? analyse_array_list local_scope verify_array_list_types local_scope end |
#generate_code(code, local_scope) ⇒ Object
23 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 23 def generate_code(code, local_scope); end |
#rescan_declarations(local_scope) ⇒ Object
25 |
# File 'lib/rubex/ast/statement/c_array_decl.rb', line 25 def rescan_declarations(local_scope); end |