Class: CType::Base

Inherits:
Object
  • Object
show all
Includes:
Qualifiers
Defined in:
lib/dbc/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.



323
324
325
# File 'lib/dbc/ctype.rb', line 323

def initialize(type)
	@primitive = type
end

Instance Attribute Details

#primitiveObject (readonly)

Returns the value of attribute primitive.



327
328
329
# File 'lib/dbc/ctype.rb', line 327

def primitive
  @primitive
end

Instance Method Details

#evaluate(identifier) ⇒ Object



333
334
335
# File 'lib/dbc/ctype.rb', line 333

def evaluate(identifier)
	self.primitive.evaluate(identifier)
end

#to_init_s(ident = nil) ⇒ Object



337
338
339
340
341
342
# File 'lib/dbc/ctype.rb', line 337

def to_init_s(ident=nil)
	str = ''
	str << 'const ' if @const
	str << 'volatile ' if @volatile
	str << @primitive.to_init_s(ident)
end

#to_sObject



329
330
331
# File 'lib/dbc/ctype.rb', line 329

def to_s
	to_init_s
end