Class: AdLint::Cc1::Object
- Inherits:
-
Object
- Object
- AdLint::Cc1::Object
- Includes:
- Bindable
- Defined in:
- lib/adlint/cc1/object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#declarations_and_definitions ⇒ Object
readonly
Returns the value of attribute declarations_and_definitions.
Attributes included from Bindable
Instance Method Summary collapse
- #declared_as_auto? ⇒ Boolean
- #declared_as_extern? ⇒ Boolean
- #declared_as_register? ⇒ Boolean
- #declared_as_static? ⇒ Boolean
- #designated_by_lvalue? ⇒ Boolean
- #function? ⇒ Boolean
-
#initialize(dcl_or_def = nil) ⇒ Object
constructor
A new instance of Object.
- #named? ⇒ Boolean
- #storage_class_specifiers ⇒ Object
- #temporary? ⇒ Boolean
- #variable? ⇒ Boolean
Methods included from Bindable
Constructor Details
#initialize(dcl_or_def = nil) ⇒ Object
Returns a new instance of Object.
91 92 93 |
# File 'lib/adlint/cc1/object.rb', line 91 def initialize(dcl_or_def = nil) @declarations_and_definitions = [dcl_or_def].compact end |
Instance Attribute Details
#declarations_and_definitions ⇒ Object (readonly)
Returns the value of attribute declarations_and_definitions.
95 96 97 |
# File 'lib/adlint/cc1/object.rb', line 95 def declarations_and_definitions @declarations_and_definitions end |
Instance Method Details
#declared_as_auto? ⇒ Boolean
112 113 114 |
# File 'lib/adlint/cc1/object.rb', line 112 def declared_as_auto? sc_spec = first_storage_class_specifier and sc_spec.type == :AUTO end |
#declared_as_extern? ⇒ Boolean
103 104 105 106 |
# File 'lib/adlint/cc1/object.rb', line 103 def declared_as_extern? sc_spec = first_storage_class_specifier sc_spec.nil? || sc_spec.type == :EXTERN end |
#declared_as_register? ⇒ Boolean
116 117 118 |
# File 'lib/adlint/cc1/object.rb', line 116 def declared_as_register? sc_spec = first_storage_class_specifier and sc_spec.type == :REGISTER end |
#declared_as_static? ⇒ Boolean
108 109 110 |
# File 'lib/adlint/cc1/object.rb', line 108 def declared_as_static? sc_spec = first_storage_class_specifier and sc_spec.type == :STATIC end |
#designated_by_lvalue? ⇒ Boolean
120 121 122 |
# File 'lib/adlint/cc1/object.rb', line 120 def designated_by_lvalue? subclass_responsibility end |
#function? ⇒ Boolean
132 133 134 |
# File 'lib/adlint/cc1/object.rb', line 132 def function? subclass_responsibility end |
#named? ⇒ Boolean
124 125 126 |
# File 'lib/adlint/cc1/object.rb', line 124 def named? subclass_responsibility end |
#storage_class_specifiers ⇒ Object
97 98 99 100 101 |
# File 'lib/adlint/cc1/object.rb', line 97 def storage_class_specifiers @declarations_and_definitions.map { |dcl_or_def| dcl_or_def.storage_class_specifier }.compact end |
#temporary? ⇒ Boolean
128 129 130 |
# File 'lib/adlint/cc1/object.rb', line 128 def temporary? subclass_responsibility end |
#variable? ⇒ Boolean
136 137 138 |
# File 'lib/adlint/cc1/object.rb', line 136 def variable? subclass_responsibility end |