![]() |
User Guide
|
Helper class for printing AST back to NMDOL test. More...
Helper class for printing AST back to NMDOL test.
NmodlPrintVisitor transforms AST back to NMODL. This class provided common functionality required by visitor to print nmodl ascii file.
Definition at line 38 of file nmodl_printer.hpp.
#include <nmodl_printer.hpp>
Public Member Functions | |
NMODLPrinter () | |
NMODLPrinter (std::ostream &stream) | |
NMODLPrinter (const std::string &filename) | |
~NMODLPrinter () | |
void | add_indent () |
print whitespaces for indentation More... | |
void | push_level () |
start of new block scope (i.e. More... | |
void | add_element (const std::string &) |
void | add_newline () |
void | pop_level () |
end of current block scope (i.e. More... | |
Private Attributes | |
std::ofstream | ofs |
std::streambuf * | sbuf = nullptr |
std::shared_ptr< std::ostream > | result |
size_t | indent_level = 0 |
|
inline |
Definition at line 46 of file nmodl_printer.hpp.
|
inline |
Definition at line 48 of file nmodl_printer.hpp.
nmodl::printer::NMODLPrinter::NMODLPrinter | ( | const std::string & | filename | ) |
Definition at line 14 of file nmodl_printer.cpp.
|
inline |
Definition at line 52 of file nmodl_printer.hpp.
void nmodl::printer::NMODLPrinter::add_element | ( | const std::string & | name | ) |
Definition at line 40 of file nmodl_printer.cpp.
void nmodl::printer::NMODLPrinter::add_indent | ( | ) |
print whitespaces for indentation
Definition at line 36 of file nmodl_printer.cpp.
void nmodl::printer::NMODLPrinter::add_newline | ( | ) |
Definition at line 44 of file nmodl_printer.cpp.
void nmodl::printer::NMODLPrinter::pop_level | ( | ) |
end of current block scope (i.e.
end with "}") and decreases indentation level
Definition at line 48 of file nmodl_printer.cpp.
void nmodl::printer::NMODLPrinter::push_level | ( | ) |
start of new block scope (i.e.
start with "{") and increases indentation level
Definition at line 30 of file nmodl_printer.cpp.
|
private |
Definition at line 43 of file nmodl_printer.hpp.
|
private |
Definition at line 40 of file nmodl_printer.hpp.
|
private |
Definition at line 42 of file nmodl_printer.hpp.
|
private |
Definition at line 41 of file nmodl_printer.hpp.