Class: Chelsy::BitField
Overview
Struct or Union member with bit-field
Unnamed bit-field :: A bit-field declaration with no declarator, but only a colon and a width
Instance Attribute Summary collapse
-
#bits ⇒ Object
readonly
Returns the value of attribute bits.
-
#declaration ⇒ Object
readonly
Returns the value of attribute declaration.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(bits, declaration = nil, **rest) ⇒ BitField
constructor
A new instance of BitField.
Constructor Details
#initialize(bits, declaration = nil, **rest) ⇒ BitField
Returns a new instance of BitField.
162 163 164 165 166 167 |
# File 'lib/chelsy/ast.rb', line 162 def initialize(bits, declaration=nil, **rest) @declaration = Syntax::Declaration.ensure(declaration) if declaration @bits = bits && Syntax::BitField.ensure(bits) super **rest end |
Instance Attribute Details
#bits ⇒ Object (readonly)
Returns the value of attribute bits.
160 161 162 |
# File 'lib/chelsy/ast.rb', line 160 def bits @bits end |
#declaration ⇒ Object (readonly)
Returns the value of attribute declaration.
160 161 162 |
# File 'lib/chelsy/ast.rb', line 160 def declaration @declaration end |