Class: AdLint::Cc1::ScopedVariable
- Inherits:
-
Variable
- Object
- Object
- TypedObject
- Variable
- AdLint::Cc1::ScopedVariable
- Defined in:
- lib/adlint/cc1/object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#scope ⇒ Object
Returns the value of attribute scope.
Attributes inherited from TypedObject
Attributes inherited from Object
Attributes included from Bindable
Instance Method Summary collapse
- #declared_as_auto? ⇒ Boolean
- #declared_as_extern? ⇒ Boolean
-
#initialize(mem, dcl_or_def, type, scope) ⇒ ScopedVariable
constructor
A new instance of ScopedVariable.
Methods inherited from Variable
#assign!, #begin_value_versioning, #end_value_versioning, #enter_value_versioning_group, #function?, #inner?, #leave_value_versioning_group, #name, #named?, #narrow_value_domain!, #outer?, #rollback_all_value_versions!, #thin_latest_value_version!, #uninitialize!, #value, #variable?, #widen_value_domain!
Methods inherited from TypedObject
#to_pointer, #to_pointer_value, #to_value, #to_variable
Methods inherited from Object
#declared_as_register?, #declared_as_static?, #designated_by_lvalue?, #function?, #named?, #storage_class_specifiers, #temporary?, #variable?
Methods included from Bindable
Constructor Details
#initialize(mem, dcl_or_def, type, scope) ⇒ ScopedVariable
Returns a new instance of ScopedVariable.
311 312 313 314 |
# File 'lib/adlint/cc1/object.rb', line 311 def initialize(mem, dcl_or_def, type, scope) super(mem, dcl_or_def, type) @scope = scope end |
Instance Attribute Details
#scope ⇒ Object
Returns the value of attribute scope.
316 317 318 |
# File 'lib/adlint/cc1/object.rb', line 316 def scope @scope end |
Instance Method Details
#declared_as_auto? ⇒ Boolean
326 327 328 329 330 331 332 333 |
# File 'lib/adlint/cc1/object.rb', line 326 def declared_as_auto? if @scope.global? super else sc_spec = first_storage_class_specifier sc_spec.nil? || sc_spec.type == :AUTO end end |
#declared_as_extern? ⇒ Boolean
318 319 320 321 322 323 324 |
# File 'lib/adlint/cc1/object.rb', line 318 def declared_as_extern? if @scope.global? super else sc_spec = first_storage_class_specifier and sc_spec.type == :EXTERN end end |