Class: Rubycc::Front::AST::GlobalDecl
- Inherits:
-
Data
- Object
- Data
- Rubycc::Front::AST::GlobalDecl
- Defined in:
- lib/rubycc/front/ast.rb
Overview
A file-scope (global) variable declaration. type is the declared
Rubycc::Type (int, char, a pointer, a one-dimensional array or a
struct/union). At most one of two initializer fields is set:
initializer_value is a plain scalar-integer initializer folded to a
Ruby Integer on the spot (the common "int g = 1 + 2;" case, kept folded
so nothing downstream re-evaluates it), while initializer_node carries
a still-unfolded initializer the generator lowers itself — a brace
initializer-list (AST::InitializerList) for an aggregate or scalar, a
string literal for a char array, or an address constant for a pointer
(a null pointer, "&other_global", a decayed global array name or a
string literal). Both are nil for an uninitialized global, which lands
in .bss. const and storage carry the same top-level const flag and
storage-class specifier (nil/:static/:extern) as VariableDecl; the
generator diagnoses writes against a const global but does not yet act
on the storage class (Phase B). alignas carries the same _Alignas
boundary VariableDecl does.
Instance Attribute Summary collapse
-
#alignas ⇒ Object
readonly
Returns the value of attribute alignas.
-
#const ⇒ Object
readonly
Returns the value of attribute const.
-
#initializer_node ⇒ Object
readonly
Returns the value of attribute initializer_node.
-
#initializer_value ⇒ Object
readonly
Returns the value of attribute initializer_value.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Attribute Details
#alignas ⇒ Object (readonly)
Returns the value of attribute alignas
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def alignas @alignas end |
#const ⇒ Object (readonly)
Returns the value of attribute const
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def const @const end |
#initializer_node ⇒ Object (readonly)
Returns the value of attribute initializer_node
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def initializer_node @initializer_node end |
#initializer_value ⇒ Object (readonly)
Returns the value of attribute initializer_value
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def initializer_value @initializer_value end |
#name ⇒ Object (readonly)
Returns the value of attribute name
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def name @name end |
#storage ⇒ Object (readonly)
Returns the value of attribute storage
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def storage @storage end |
#token ⇒ Object (readonly)
Returns the value of attribute token
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def token @token end |
#type ⇒ Object (readonly)
Returns the value of attribute type
98 99 100 |
# File 'lib/rubycc/front/ast.rb', line 98 def type @type end |