Class: SFRP::Low::Set
- Inherits:
-
Object
- Object
- SFRP::Low::Set
- Defined in:
- lib/sfrp/low/set.rb
Instance Attribute Summary collapse
-
#functions ⇒ Object
readonly
Returns the value of attribute functions.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#macros ⇒ Object
readonly
Returns the value of attribute macros.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#structs ⇒ Object
readonly
Returns the value of attribute structs.
-
#typedefs ⇒ Object
readonly
Returns the value of attribute typedefs.
Instance Method Summary collapse
- #<<(element) ⇒ Object
-
#initialize(&block) ⇒ Set
constructor
A new instance of Set.
- #to_output ⇒ Object
Constructor Details
#initialize(&block) ⇒ Set
9 10 11 12 13 14 15 16 |
# File 'lib/sfrp/low/set.rb', line 9 def initialize(&block) @typedefs = [] @structs = [] @functions = [] @macros = [] @includes = [] block.call(self) if block end |
Instance Attribute Details
#functions ⇒ Object (readonly)
Returns the value of attribute functions.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def functions @functions end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def includes @includes end |
#macros ⇒ Object (readonly)
Returns the value of attribute macros.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def macros @macros end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def end |
#structs ⇒ Object (readonly)
Returns the value of attribute structs.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def structs @structs end |
#typedefs ⇒ Object (readonly)
Returns the value of attribute typedefs.
7 8 9 |
# File 'lib/sfrp/low/set.rb', line 7 def typedefs @typedefs end |
Instance Method Details
#<<(element) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/sfrp/low/set.rb', line 24 def <<(element) case element when Typedef @typedefs << element when Structure @structs << element when Function @functions << element when Macro @macros << element when Include @includes << element else raise end end |
#to_output ⇒ Object
18 19 20 21 22 |
# File 'lib/sfrp/low/set.rb', line 18 def to_output Output::Set.new do |dest_set| dest_set.create_file('main', 'c', main_file_content) end end |