Class: Chelsy::Typedef

Inherits:
Declarative show all
Defined in:
lib/chelsy/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Declarative

#storage

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Methods inherited from Declarative

#extern?, #init, #static?

Constructor Details

#initialize(name, type, **rest) ⇒ Typedef

Returns a new instance of Typedef.



1126
1127
1128
1129
1130
1131
1132
# File 'lib/chelsy/ast.rb', line 1126

def initialize(name, type, **rest)
  @name = Syntax::Ident.ensure(name)
  @type = Syntax::Type.ensure(type)

  rest[:storage] = :typedef
  super(**rest)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



1124
1125
1126
# File 'lib/chelsy/ast.rb', line 1124

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



1124
1125
1126
# File 'lib/chelsy/ast.rb', line 1124

def type
  @type
end