Class: Rubex::AST::Statement::CBaseType
- Defined in:
- lib/rubex/ast/statement/c_base_type.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
- #==(other) ⇒ Object
- #analyse_statement(_local_scope) ⇒ Object
-
#initialize(type, name, value = nil) ⇒ CBaseType
constructor
A new instance of CBaseType.
Methods inherited from Base
Constructor Details
#initialize(type, name, value = nil) ⇒ CBaseType
Returns a new instance of CBaseType.
7 8 9 10 11 |
# File 'lib/rubex/ast/statement/c_base_type.rb', line 7 def initialize(type, name, value = nil) @type = type @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rubex/ast/statement/c_base_type.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_base_type.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/rubex/ast/statement/c_base_type.rb', line 5 def value @value end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/rubex/ast/statement/c_base_type.rb', line 13 def ==(other) self.class == other.class && type == other.class && name == other.name && value == other.value end |
#analyse_statement(_local_scope) ⇒ Object
20 21 22 |
# File 'lib/rubex/ast/statement/c_base_type.rb', line 20 def analyse_statement(_local_scope) @type = Rubex::Helpers.determine_dtype @type end |