Class: Rubycc::Front::AST::Program
- Inherits:
-
Data
- Object
- Data
- Rubycc::Front::AST::Program
- Defined in:
- lib/rubycc/front/ast.rb
Overview
Whole translation unit. functions is an array of FunctionDef,
FunctionDecl (prototype) and GlobalDecl (file-scope variable) nodes in
source order. init_attributes maps a function name to the
InitAttributes its declarations carried; it is a property of the unit
rather than of any one node because the attribute may be written on a
prototype that precedes or follows the definition (see
Parser#register_init_attributes). Names never defined here appear in it
too and are dropped by the generator. visibility_attributes maps an
identifier to an explicit GNU ELF visibility; it is kept at program
scope because an exported declaration often precedes its definition.
Instance Attribute Summary collapse
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#init_attributes ⇒ Object
readonly
Returns the value of attribute init_attributes.
-
#visibility_attributes ⇒ Object
readonly
Returns the value of attribute visibility_attributes.
Instance Method Summary collapse
-
#initialize(functions:, init_attributes: {}, visibility_attributes: {}) ⇒ Program
constructor
A new instance of Program.
Constructor Details
#initialize(functions:, init_attributes: {}, visibility_attributes: {}) ⇒ Program
Returns a new instance of Program.
522 523 524 |
# File 'lib/rubycc/front/ast.rb', line 522 def initialize(functions:, init_attributes: {}, visibility_attributes: {}) super end |
Instance Attribute Details
#functions ⇒ Object (readonly)
Returns the value of attribute functions
521 522 523 |
# File 'lib/rubycc/front/ast.rb', line 521 def functions @functions end |
#init_attributes ⇒ Object (readonly)
Returns the value of attribute init_attributes
521 522 523 |
# File 'lib/rubycc/front/ast.rb', line 521 def init_attributes @init_attributes end |
#visibility_attributes ⇒ Object (readonly)
Returns the value of attribute visibility_attributes
521 522 523 |
# File 'lib/rubycc/front/ast.rb', line 521 def visibility_attributes @visibility_attributes end |