Class: AdLint::Cc1::NamedVariable

Inherits:
OuterVariable show all
Includes:
Nameable
Defined in:
lib/adlint/cc1/object.rb

Direct Known Subclasses

AliasVariable

Instance Attribute Summary

Attributes included from Nameable

#name

Attributes inherited from OuterVariable

#representative_element

Attributes inherited from ScopedVariable

#scope

Attributes inherited from TypedObject

#type

Attributes inherited from Object

#declarations_and_definitions

Attributes included from Bindable

#binding

Instance Method Summary collapse

Methods included from Nameable

#named?

Methods inherited from OuterVariable

#assign!, #begin_value_versioning, #end_value_versioning, #enter_value_versioning_group, #inner?, #inner_variable_at, #inner_variable_named, #leave_value_versioning_group, #rollback_all_value_versions!, #thin_latest_value_version!

Methods inherited from ScopedVariable

#declared_as_auto?, #declared_as_extern?

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_auto?, #declared_as_extern?, #declared_as_register?, #declared_as_static?, #function?, #named?, #storage_class_specifiers, #variable?

Methods included from Bindable

#be_alias_to, #bind_to

Constructor Details

#initialize(mem, dcl_or_def, scope) ⇒ NamedVariable

Returns a new instance of NamedVariable.



515
516
517
518
# File 'lib/adlint/cc1/object.rb', line 515

def initialize(mem, dcl_or_def, scope)
  self.name = dcl_or_def.identifier.value
  super(mem, dcl_or_def, dcl_or_def.type, scope)
end

Instance Method Details

#designated_by_lvalue?Boolean

Returns:

  • (Boolean)


524
525
526
# File 'lib/adlint/cc1/object.rb', line 524

def designated_by_lvalue?
  true
end

#pretty_print(pp) ⇒ Object



533
534
535
# File 'lib/adlint/cc1/object.rb', line 533

def pretty_print(pp)
  Summary.new(object_id, name, type, binding.memory).pretty_print(pp)
end

#temporary?Boolean

Returns:

  • (Boolean)


520
521
522
# File 'lib/adlint/cc1/object.rb', line 520

def temporary?
  false
end

#to_named_variableObject

NOTE: This method should be overridden by PhantomVariable.



529
530
531
# File 'lib/adlint/cc1/object.rb', line 529

def to_named_variable
  self
end