#include "pt-pr-code.h"
Private Member Functions | |
tree_print_code (void) | |
void | decrement_indent_level (void) |
void | increment_indent_level (void) |
void | indent (void) |
void | newline (const char *alt_txt=", ") |
void | print_comment_elt (const comment_elt &comment_elt) |
void | print_comment_list (comment_list *comment_list) |
void | print_indented_comment (comment_list *comment_list) |
void | print_parens (const tree_expression &expr, const char *txt) |
void | reset (void) |
void | reset_indent_level (void) |
Private Attributes | |
bool | m_beginning_of_line |
int | m_curr_print_indent_level |
std::stack< char > | m_nesting |
std::ostream & | m_os |
std::string | m_prefix |
bool | m_print_original_text |
int | m_suppress_newlines |
Definition at line 45 of file pt-pr-code.h.
|
inline |
Definition at line 49 of file pt-pr-code.h.
References m_nesting.
|
delete |
|
default |
|
private |
|
inlineprivate |
Definition at line 178 of file pt-pr-code.h.
References m_curr_print_indent_level.
Referenced by print_indented_comment(), visit_complex_for_command(), visit_do_until_command(), visit_if_clause(), visit_no_op_command(), visit_simple_for_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
inlineprivate |
Definition at line 176 of file pt-pr-code.h.
References m_curr_print_indent_level.
Referenced by print_indented_comment(), visit_complex_for_command(), visit_do_until_command(), visit_if_clause(), visit_octave_user_function(), visit_simple_for_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1136 of file pt-pr-code.cc.
References m_beginning_of_line, m_curr_print_indent_level, m_os, and m_prefix.
Referenced by newline(), print_comment_elt(), visit_anon_fcn_handle(), visit_binary_expression(), visit_break_command(), visit_cell(), visit_colon_expression(), visit_complex_for_command(), visit_constant(), visit_continue_command(), visit_decl_command(), visit_do_until_command(), visit_fcn_handle(), visit_function_def(), visit_identifier(), visit_if_command(), visit_if_command_list(), visit_index_expression(), visit_matrix(), visit_multi_assignment(), visit_no_op_command(), visit_octave_user_function_header(), visit_postfix_expression(), visit_prefix_expression(), visit_return_command(), visit_simple_assignment(), visit_simple_for_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1153 of file pt-pr-code.cc.
References indent(), m_beginning_of_line, m_os, and m_suppress_newlines.
Referenced by print_comment_elt(), print_comment_list(), visit_complex_for_command(), visit_do_until_command(), visit_if_clause(), visit_octave_user_function_header(), visit_octave_user_function_trailer(), visit_simple_for_command(), visit_statement(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
delete |
|
private |
Definition at line 1189 of file pt-pr-code.cc.
References indent(), len, m_beginning_of_line, m_os, newline(), and octave::comment_elt::text().
Referenced by print_comment_list().
|
private |
Definition at line 1249 of file pt-pr-code.cc.
References octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), newline(), and print_comment_elt().
Referenced by print_indented_comment(), visit_complex_for_command(), visit_do_until_command(), visit_if_command(), visit_octave_user_function_header(), visit_simple_for_command(), visit_statement(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
void octave::tree_print_code::print_fcn_handle_body | ( | tree_expression * | e | ) |
Definition at line 1123 of file pt-pr-code.cc.
References octave::tree::accept(), and m_suppress_newlines.
Referenced by octave::anonymous_fcn_handle::print_raw(), and visit_anon_fcn_handle().
|
private |
Definition at line 1268 of file pt-pr-code.cc.
References decrement_indent_level(), increment_indent_level(), and print_comment_list().
Referenced by visit_complex_for_command(), visit_do_until_command(), visit_if_command(), visit_if_command_list(), visit_octave_user_function_trailer(), visit_simple_for_command(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1180 of file pt-pr-code.cc.
References m_os, n, and octave::tree_expression::paren_count().
Referenced by visit_anon_fcn_handle(), visit_binary_expression(), visit_cell(), visit_colon_expression(), visit_constant(), visit_fcn_handle(), visit_identifier(), visit_index_expression(), visit_matrix(), visit_multi_assignment(), visit_postfix_expression(), visit_prefix_expression(), and visit_simple_assignment().
|
private |
Definition at line 1171 of file pt-pr-code.cc.
References m_beginning_of_line, m_curr_print_indent_level, and m_nesting.
Referenced by visit_octave_user_function(), and visit_octave_user_script().
|
inlineprivate |
Definition at line 174 of file pt-pr-code.h.
References m_curr_print_indent_level.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 41 of file pt-pr-code.cc.
References octave::tree_parameter_list::accept(), octave::tree_anon_fcn_handle::expression(), indent(), m_os, octave::tree_anon_fcn_handle::parameter_list(), print_fcn_handle_body(), and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 60 of file pt-pr-code.cc.
References octave::tree::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), and m_os.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 79 of file pt-pr-code.cc.
References octave::tree::accept(), indent(), octave::tree_binary_expression::lhs(), m_os, octave::tree_binary_expression::oper(), print_parens(), and octave::tree_binary_expression::rhs().
|
virtualinherited |
Reimplemented in octave::jit_convert, and octave::tree_evaluator.
Definition at line 65 of file pt-walk.cc.
References octave::tree_walker::visit_binary_expression().
Referenced by octave::tree_boolean_expression::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 101 of file pt-pr-code.cc.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 601 of file pt-pr-code.cc.
References octave::tree_argument_list::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), indent(), m_nesting, m_os, and print_parens().
|
virtualinherited |
Definition at line 606 of file pt-walk.cc.
Referenced by octave::tree_classdef::accept().
|
virtualinherited |
Definition at line 526 of file pt-walk.cc.
Referenced by octave::tree_classdef_attribute::accept().
|
virtualinherited |
Definition at line 531 of file pt-walk.cc.
Referenced by octave::tree_classdef_attribute_list::accept().
|
virtualinherited |
Definition at line 601 of file pt-walk.cc.
Referenced by octave::tree_classdef_body::accept().
|
virtualinherited |
Definition at line 586 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum::accept().
|
virtualinherited |
Definition at line 596 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum_block::accept().
|
virtualinherited |
Definition at line 591 of file pt-walk.cc.
Referenced by octave::tree_classdef_enum_list::accept().
|
virtualinherited |
Definition at line 571 of file pt-walk.cc.
Referenced by octave::tree_classdef_event::accept().
|
virtualinherited |
Definition at line 581 of file pt-walk.cc.
Referenced by octave::tree_classdef_events_block::accept().
|
virtualinherited |
Definition at line 576 of file pt-walk.cc.
Referenced by octave::tree_classdef_events_list::accept().
|
virtualinherited |
Definition at line 566 of file pt-walk.cc.
Referenced by octave::tree_classdef_methods_block::accept().
|
virtualinherited |
Definition at line 561 of file pt-walk.cc.
Referenced by octave::tree_classdef_methods_list::accept().
|
virtualinherited |
Definition at line 556 of file pt-walk.cc.
Referenced by octave::tree_classdef_properties_block::accept().
|
virtualinherited |
Definition at line 546 of file pt-walk.cc.
Referenced by octave::tree_classdef_property::accept().
|
virtualinherited |
Definition at line 551 of file pt-walk.cc.
Referenced by octave::tree_classdef_property_list::accept().
|
virtualinherited |
Definition at line 536 of file pt-walk.cc.
Referenced by octave::tree_classdef_superclass::accept().
|
virtualinherited |
Definition at line 541 of file pt-walk.cc.
Referenced by octave::tree_classdef_superclass_list::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 109 of file pt-pr-code.cc.
References octave::tree::accept(), octave::tree_colon_expression::base(), octave::tree_colon_expression::increment(), indent(), octave::tree_colon_expression::limit(), m_os, and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 253 of file pt-pr-code.cc.
References octave::tree_argument_list::accept(), octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_complex_for_command::body(), octave::tree_complex_for_command::control_expr(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_complex_for_command::leading_comment(), octave::tree_complex_for_command::left_hand_side(), m_nesting, m_os, newline(), print_comment_list(), print_indented_comment(), and octave::tree_complex_for_command::trailing_comment().
|
virtualinherited |
Reimplemented in octave::tree_evaluator.
Definition at line 70 of file pt-walk.cc.
References octave::tree_walker::visit_binary_expression().
Referenced by octave::tree_compound_binary_expression::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 681 of file pt-pr-code.cc.
References indent(), m_os, m_print_original_text, print_parens(), and octave::tree_constant::print_raw().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 142 of file pt-pr-code.cc.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 150 of file pt-pr-code.cc.
References octave::tree_decl_init_list::accept(), indent(), octave::tree_decl_command::initializer_list(), m_os, and octave::tree_decl_command::name().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 182 of file pt-pr-code.cc.
References octave::tree_identifier::accept(), octave::tree::accept(), octave::tree_decl_elt::expression(), octave::tree_decl_elt::ident(), and m_os.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 163 of file pt-pr-code.cc.
References octave::tree_decl_elt::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), and m_os.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 1075 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_while_command::body(), octave::tree_while_command::condition(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_while_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and octave::tree_while_command::trailing_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 693 of file pt-pr-code.cc.
References indent(), m_os, m_print_original_text, print_parens(), and octave::tree_fcn_handle::print_raw().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 371 of file pt-pr-code.cc.
References octave::f(), octave::tree_function_def::function(), octave_value::function_value(), and indent().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 384 of file pt-pr-code.cc.
References indent(), m_os, and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 397 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_if_clause::commands(), octave::tree_if_clause::condition(), decrement_indent_level(), increment_indent_level(), and newline().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 419 of file pt-pr-code.cc.
References octave::tree_if_command_list::accept(), octave::tree_if_command::cmd_list(), indent(), octave::tree_if_command::leading_comment(), m_os, print_comment_list(), print_indented_comment(), and octave::tree_if_command::trailing_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 440 of file pt-pr-code.cc.
References octave::tree_if_clause::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), indent(), octave::tree_if_clause::is_else_clause(), octave::tree_if_clause::leading_comment(), m_os, and print_indented_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 472 of file pt-pr-code.cc.
References octave::tree_argument_list::accept(), octave::tree::accept(), octave::tree_index_expression::arg_lists(), octave::tree_index_expression::arg_names(), octave::tree_index_expression::dyn_fields(), octave::tree_index_expression::expression(), indent(), m_nesting, m_os, n, panic_impossible, octave::tree_expression::paren_count(), print_parens(), and octave::tree_index_expression::type_tags().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 570 of file pt-pr-code.cc.
References octave::tree_argument_list::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), indent(), m_nesting, m_os, and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 1117 of file pt-pr-code.cc.
References octave::tree_metaclass_query::class_name(), and m_os.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 632 of file pt-pr-code.cc.
References octave::tree_argument_list::accept(), octave::tree::accept(), indent(), octave::tree_multi_assignment::left_hand_side(), len, octave::base_list< elt_type >::length(), m_nesting, m_os, octave::tree_multi_assignment::oper(), print_parens(), and octave::tree_multi_assignment::right_hand_side().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 670 of file pt-pr-code.cc.
References decrement_indent_level(), indent(), octave::tree_no_op_command::is_end_of_fcn_or_script(), m_curr_print_indent_level, m_os, and octave::tree_no_op_command::original_command().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 307 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave_user_code::body(), increment_indent_level(), reset(), visit_octave_user_function_header(), and visit_octave_user_function_trailer().
void octave::tree_print_code::visit_octave_user_function_header | ( | octave_user_function & | fcn | ) |
Definition at line 328 of file pt-pr-code.cc.
References octave::tree_parameter_list::accept(), indent(), octave_user_function::leading_comment(), m_os, octave_function::name(), newline(), octave_user_function::parameter_list(), print_comment_list(), and octave_user_function::return_list().
Referenced by octave::jit_function_info::jit_function_info(), octave_user_function::print_code_function_header(), and visit_octave_user_function().
void octave::tree_print_code::visit_octave_user_function_trailer | ( | octave_user_function & | fcn | ) |
Definition at line 363 of file pt-pr-code.cc.
References newline(), print_indented_comment(), and octave_user_function::trailing_comment().
Referenced by octave::jit_function_info::jit_function_info(), octave_user_function::print_code_function_trailer(), and visit_octave_user_function().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 296 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave_user_code::body(), and reset().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 705 of file pt-pr-code.cc.
References octave::tree_decl_elt::accept(), octave::base_list< elt_type >::begin(), octave::base_list< elt_type >::end(), octave::tree_parameter_list::is_input_list(), len, octave::base_list< elt_type >::length(), m_nesting, m_os, octave::tree_parameter_list::takes_varargs(), and octave::tree_parameter_list::varargs_symbol_name().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 765 of file pt-pr-code.cc.
References octave::tree::accept(), indent(), m_os, octave::tree_unary_expression::oper(), octave::tree_unary_expression::operand(), and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 782 of file pt-pr-code.cc.
References octave::tree::accept(), indent(), m_os, octave::tree_unary_expression::oper(), octave::tree_unary_expression::operand(), and print_parens().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 799 of file pt-pr-code.cc.
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 807 of file pt-pr-code.cc.
References octave::tree::accept(), indent(), octave::tree_simple_assignment::left_hand_side(), m_os, octave::tree_simple_assignment::oper(), print_parens(), and octave::tree_simple_assignment::right_hand_side().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 200 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_simple_for_command::body(), octave::tree_simple_for_command::control_expr(), decrement_indent_level(), octave::tree_simple_for_command::in_parallel(), increment_indent_level(), indent(), octave::tree_simple_for_command::leading_comment(), octave::tree_simple_for_command::left_hand_side(), m_os, octave::tree_simple_for_command::maxproc_expr(), newline(), print_comment_list(), print_indented_comment(), and octave::tree_simple_for_command::trailing_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 829 of file pt-pr-code.cc.
References octave::tree::accept(), octave::tree_statement::command(), octave::tree_statement::comment_text(), octave::tree_statement::expression(), m_os, newline(), print_comment_list(), and octave::tree_statement::print_result().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 861 of file pt-pr-code.cc.
Referenced by octave::jit_function_info::jit_function_info().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 1111 of file pt-pr-code.cc.
References octave::tree_superclass_ref::class_name(), m_os, and octave::tree_superclass_ref::method_name().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 871 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_switch_case::case_label(), octave::tree_switch_case::commands(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_switch_case::is_default_case(), octave::tree_switch_case::leading_comment(), m_os, newline(), and print_comment_list().
|
virtualinherited |
Reimplemented in octave::jit_convert, octave::tree_evaluator, octave::tree_breakpoint, and octave::ctor_analyzer.
Definition at line 255 of file pt-walk.cc.
References octave::tree_switch_case::accept(), octave::base_list< elt_type >::begin(), and octave::base_list< elt_type >::end().
Referenced by octave::tree_switch_case_list::accept().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 904 of file pt-pr-code.cc.
References octave::tree_switch_case_list::accept(), octave::tree::accept(), octave::tree_switch_command::case_list(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_switch_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and octave::tree_switch_command::switch_value().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 938 of file pt-pr-code.cc.
References octave::tree_identifier::accept(), octave::tree_statement_list::accept(), octave::tree_try_catch_command::body(), octave::tree_try_catch_command::cleanup(), decrement_indent_level(), octave::tree_try_catch_command::identifier(), increment_indent_level(), indent(), octave::tree_try_catch_command::leading_comment(), m_os, octave::tree_try_catch_command::middle_comment(), newline(), print_comment_list(), print_indented_comment(), and octave::tree_try_catch_command::trailing_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 993 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree_unwind_protect_command::body(), octave::tree_unwind_protect_command::cleanup(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_unwind_protect_command::leading_comment(), m_os, octave::tree_unwind_protect_command::middle_comment(), newline(), print_comment_list(), print_indented_comment(), and octave::tree_unwind_protect_command::trailing_comment().
|
virtual |
Reimplemented from octave::tree_walker.
Definition at line 1041 of file pt-pr-code.cc.
References octave::tree_statement_list::accept(), octave::tree::accept(), octave::tree_while_command::body(), octave::tree_while_command::condition(), decrement_indent_level(), increment_indent_level(), indent(), octave::tree_while_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and octave::tree_while_command::trailing_comment().
|
private |
Definition at line 169 of file pt-pr-code.h.
Referenced by indent(), newline(), print_comment_elt(), and reset().
|
private |
Definition at line 166 of file pt-pr-code.h.
Referenced by decrement_indent_level(), increment_indent_level(), indent(), reset(), reset_indent_level(), and visit_no_op_command().
|
private |
Definition at line 161 of file pt-pr-code.h.
Referenced by tree_print_code(), reset(), visit_cell(), visit_complex_for_command(), visit_index_expression(), visit_matrix(), visit_multi_assignment(), and visit_parameter_list().
|
private |
Definition at line 157 of file pt-pr-code.h.
Referenced by indent(), newline(), print_comment_elt(), print_parens(), visit_anon_fcn_handle(), visit_argument_list(), visit_binary_expression(), visit_break_command(), visit_cell(), visit_colon_expression(), visit_complex_for_command(), visit_constant(), visit_continue_command(), visit_decl_command(), visit_decl_elt(), visit_decl_init_list(), visit_do_until_command(), visit_fcn_handle(), visit_identifier(), visit_if_command(), visit_if_command_list(), visit_index_expression(), visit_matrix(), visit_metaclass_query(), visit_multi_assignment(), visit_no_op_command(), visit_octave_user_function_header(), visit_parameter_list(), visit_postfix_expression(), visit_prefix_expression(), visit_return_command(), visit_simple_assignment(), visit_simple_for_command(), visit_statement(), visit_superclass_ref(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 159 of file pt-pr-code.h.
Referenced by indent().
|
private |
Definition at line 163 of file pt-pr-code.h.
Referenced by visit_constant(), and visit_fcn_handle().
|
private |
Definition at line 172 of file pt-pr-code.h.
Referenced by newline(), and print_fcn_handle_body().