Class: CExtractorTypes::CModule
- Defined in:
- lib/ceedling/c_extractor/c_extractor_types.rb
Overview
Data class representing all extracted content of C module
Instance Attribute Summary collapse
-
#aggregate_definitions ⇒ Object
Returns the value of attribute aggregate_definitions.
-
#element_sequence ⇒ Object
Returns the value of attribute element_sequence.
-
#function_declarations ⇒ Object
Returns the value of attribute function_declarations.
-
#function_definitions ⇒ Object
Returns the value of attribute function_definitions.
-
#macro_definitions ⇒ Object
Returns the value of attribute macro_definitions.
-
#type_definitions ⇒ Object
Returns the value of attribute type_definitions.
-
#variable_declarations ⇒ Object
Returns the value of attribute variable_declarations.
Instance Method Summary collapse
-
#+(other) ⇒ Object
Concatenate two CModule instances.
-
#initialize(variable_declarations: [], function_definitions: [], function_declarations: [], macro_definitions: [], type_definitions: [], aggregate_definitions: [], element_sequence: []) ⇒ CModule
constructor
Constructor to set unassigned fields to empty arrays for convenience.
Constructor Details
#initialize(variable_declarations: [], function_definitions: [], function_declarations: [], macro_definitions: [], type_definitions: [], aggregate_definitions: [], element_sequence: []) ⇒ CModule
Constructor to set unassigned fields to empty arrays for convenience
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 34 def initialize( variable_declarations: [], function_definitions: [], function_declarations: [], macro_definitions: [], type_definitions: [], aggregate_definitions: [], element_sequence: [] ) super end |
Instance Attribute Details
#aggregate_definitions ⇒ Object
Returns the value of attribute aggregate_definitions
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def aggregate_definitions @aggregate_definitions end |
#element_sequence ⇒ Object
Returns the value of attribute element_sequence
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def element_sequence @element_sequence end |
#function_declarations ⇒ Object
Returns the value of attribute function_declarations
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def function_declarations @function_declarations end |
#function_definitions ⇒ Object
Returns the value of attribute function_definitions
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def function_definitions @function_definitions end |
#macro_definitions ⇒ Object
Returns the value of attribute macro_definitions
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def macro_definitions @macro_definitions end |
#type_definitions ⇒ Object
Returns the value of attribute type_definitions
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def type_definitions @type_definitions end |
#variable_declarations ⇒ Object
Returns the value of attribute variable_declarations
23 24 25 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 23 def variable_declarations @variable_declarations end |
Instance Method Details
#+(other) ⇒ Object
Concatenate two CModule instances. element_sequence preserves first operand's items before second operand's items, maintaining source-before-header ordering regardless of line numbers.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ceedling/c_extractor/c_extractor_types.rb', line 49 def +(other) CModule.new( variable_declarations: (self.variable_declarations + other.variable_declarations), function_definitions: (self.function_definitions + other.function_definitions), function_declarations: (self.function_declarations + other.function_declarations), macro_definitions: (self.macro_definitions + other.macro_definitions), type_definitions: (self.type_definitions + other.type_definitions), aggregate_definitions: (self.aggregate_definitions + other.aggregate_definitions), element_sequence: (self.element_sequence + other.element_sequence) ) end |