Class: FLGen::Formatter
- Inherits:
-
Object
- Object
- FLGen::Formatter
- Defined in:
- lib/flgen/formatter.rb
Direct Known Subclasses
FileListFormatter, FileListXsimFormatter, VivadoTCLFormatter
Instance Attribute Summary collapse
-
#header_lines ⇒ Object
readonly
Returns the value of attribute header_lines.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context) ⇒ Formatter
constructor
A new instance of Formatter.
- #output(io) ⇒ Object
Constructor Details
#initialize(context) ⇒ Formatter
Returns a new instance of Formatter.
15 16 17 18 |
# File 'lib/flgen/formatter.rb', line 15 def initialize(context) @context = context @header_lines = [] end |
Instance Attribute Details
#header_lines ⇒ Object (readonly)
Returns the value of attribute header_lines.
20 21 22 |
# File 'lib/flgen/formatter.rb', line 20 def header_lines @header_lines end |
Class Method Details
.add_formatter(type, formatter) ⇒ Object
6 7 8 |
# File 'lib/flgen/formatter.rb', line 6 def add_formatter(type, formatter) formatters[type] = formatter end |
.formatters ⇒ Object
10 11 12 |
# File 'lib/flgen/formatter.rb', line 10 def formatters @formatters ||= {} end |
Instance Method Details
#output(io) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/flgen/formatter.rb', line 22 def output(io) print_header(io) print_macros(io) print_include_directoris(io) print_library_direcotries(io) print_library_files(io) print_arguments(io) print_source_files(io) end |