Class: CType::Base
Instance Attribute Summary collapse
-
#primitive ⇒ Object
readonly
Returns the value of attribute primitive.
Instance Method Summary collapse
- #evaluate(identifier) ⇒ Object
-
#initialize(type) ⇒ Base
constructor
A new instance of Base.
- #to_init_s(ident = nil) ⇒ Object
- #to_s ⇒ Object
Methods included from Qualifiers
Constructor Details
#initialize(type) ⇒ Base
Returns a new instance of Base.
328 329 330 |
# File 'lib/caphir/ctype.rb', line 328 def initialize(type) @primitive = type end |
Instance Attribute Details
#primitive ⇒ Object (readonly)
Returns the value of attribute primitive.
332 333 334 |
# File 'lib/caphir/ctype.rb', line 332 def primitive @primitive end |
Instance Method Details
#evaluate(identifier) ⇒ Object
338 339 340 |
# File 'lib/caphir/ctype.rb', line 338 def evaluate(identifier) self.primitive.evaluate(identifier) end |
#to_init_s(ident = nil) ⇒ Object
342 343 344 345 346 347 348 |
# File 'lib/caphir/ctype.rb', line 342 def to_init_s(ident=nil) str = '' str << 'const ' if @const str << 'volatile ' if @volatile str << 'restrict ' if @restrict str << @primitive.to_init_s(ident) end |
#to_s ⇒ Object
334 335 336 |
# File 'lib/caphir/ctype.rb', line 334 def to_s to_init_s end |