37 constexpr static std::size_t INDENT_STEP = 2;
41 std::size_t _indent{ 0 };
51 PrintVisitor(std::ostream& os = std::cout, std::size_t step = INDENT_STEP)
76 [[nodiscard]] TCALC_INLINE
auto _gen_indent()
const
78 return std::string(_indent,
' ');
85 TCALC_INLINE
void _step_indent() { _indent += _step; }
91 TCALC_INLINE
void _unstep_indent() { _indent -= _step; }
Base visitor class with default return type.
Definition base.hpp:46
Visitor for printing AST.
Definition print.hpp:35
PrintVisitor(std::ostream &os=std::cout, std::size_t step=INDENT_STEP)
Construct a new Print Visitor object.
Definition print.hpp:51
_TCALC_EXPECTED_NS::expected< T, Error > Result
Result type.
Definition error.hpp:153
Base class for AST nodes.
std::shared_ptr< NT > NodePtr
Shared pointer to a node.
Definition node.hpp:119