Class: CType::Base

Inherits:
Object
  • Object
show all
Includes:
Qualifiers
Defined in:
lib/caphir/ctype.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Qualifiers

#add_qualifier

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

#primitiveObject (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_sObject



334
335
336
# File 'lib/caphir/ctype.rb', line 334

def to_s
	to_init_s
end