#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 192 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_spmd_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
inlineprivate |
Definition at line 190 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_spmd_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1204 of file pt-pr-code.cc.
References m_beginning_of_line, m_curr_print_indent_level, m_os, m_prefix, and panic_unless().
Referenced by newline(), print_comment_elt(), visit_anon_fcn_handle(), visit_arguments_block(), 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_spmd_command(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1221 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_spmd_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 1257 of file pt-pr-code.cc.
References indent(), len, m_beginning_of_line, m_os, newline(), and comment_elt::text().
Referenced by print_comment_list().
|
private |
Definition at line 1317 of file pt-pr-code.cc.
References base_list< elt_type >::begin(), 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_spmd_command(), visit_statement(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
void tree_print_code::print_fcn_handle_body | ( | tree_expression * | e | ) |
Definition at line 1191 of file pt-pr-code.cc.
References tree::accept(), and m_suppress_newlines.
Referenced by base_anonymous_fcn_handle::print_raw(), and visit_anon_fcn_handle().
|
private |
Definition at line 1336 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_spmd_command(), visit_switch_command(), visit_try_catch_command(), visit_unwind_protect_command(), and visit_while_command().
|
private |
Definition at line 1248 of file pt-pr-code.cc.
References m_os, n, and 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 1239 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 188 of file pt-pr-code.h.
References m_curr_print_indent_level.
|
virtual |
Reimplemented from tree_walker.
Definition at line 41 of file pt-pr-code.cc.
References tree_parameter_list::accept(), tree_anon_fcn_handle::expression(), indent(), m_os, tree_anon_fcn_handle::parameter_list(), print_fcn_handle_body(), and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 106 of file pt-pr-code.cc.
References panic_impossible.
|
virtual |
Reimplemented from tree_walker.
Definition at line 100 of file pt-pr-code.cc.
References panic_impossible.
|
virtual |
Reimplemented from tree_walker.
Definition at line 112 of file pt-pr-code.cc.
References panic_impossible.
|
virtual |
Reimplemented from tree_walker.
Definition at line 88 of file pt-pr-code.cc.
References panic_impossible.
|
virtual |
Reimplemented from tree_walker.
Definition at line 94 of file pt-pr-code.cc.
References panic_impossible.
|
virtual |
Reimplemented from tree_walker.
Definition at line 60 of file pt-pr-code.cc.
References tree::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), and m_os.
|
virtual |
Reimplemented from tree_walker.
Definition at line 79 of file pt-pr-code.cc.
|
virtual |
Reimplemented from tree_walker.
Definition at line 118 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_binary_expression::lhs(), m_os, tree_binary_expression::oper(), print_parens(), and tree_binary_expression::rhs().
|
virtualinherited |
Reimplemented in tree_evaluator.
Definition at line 147 of file pt-walk.cc.
References tree_walker::visit_binary_expression().
Referenced by tree_boolean_expression::accept().
|
virtual |
Reimplemented from tree_walker.
Definition at line 140 of file pt-pr-code.cc.
|
virtual |
Reimplemented from tree_walker.
Definition at line 669 of file pt-pr-code.cc.
References tree_argument_list::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), indent(), m_nesting, m_os, and print_parens().
|
virtualinherited |
Definition at line 766 of file pt-walk.cc.
References tree_classdef_attribute_list::accept(), tree_classdef_superclass_list::accept(), tree_classdef_body::accept(), tree_identifier::accept(), tree_classdef::attribute_list(), tree_classdef::body(), tree_classdef::ident(), and tree_classdef::superclass_list().
Referenced by tree_classdef::accept().
|
virtualinherited |
Definition at line 616 of file pt-walk.cc.
References tree_identifier::accept(), tree::accept(), tree_classdef_attribute::expression(), and tree_classdef_attribute::ident().
Referenced by tree_classdef_attribute::accept().
|
virtualinherited |
Definition at line 629 of file pt-walk.cc.
Referenced by tree_classdef_attribute_list::accept().
|
virtualinherited |
Definition at line 738 of file pt-walk.cc.
References tree_classdef_body::enum_list(), tree_classdef_body::events_list(), tree_classdef_body::methods_list(), and tree_classdef_body::properties_list().
Referenced by tree_classdef_body::accept().
|
virtualinherited |
Definition at line 716 of file pt-walk.cc.
Referenced by tree_classdef_enum::accept().
|
virtualinherited |
Definition at line 730 of file pt-walk.cc.
References tree_classdef_enum_list::accept(), and tree_classdef_element< T >::element_list().
Referenced by tree_classdef_enum_block::accept().
|
virtualinherited |
Definition at line 721 of file pt-walk.cc.
Referenced by tree_classdef_enum_list::accept().
|
virtualinherited |
Definition at line 694 of file pt-walk.cc.
Referenced by tree_classdef_event::accept().
|
virtualinherited |
Definition at line 708 of file pt-walk.cc.
References tree_classdef_events_list::accept(), and tree_classdef_element< T >::element_list().
Referenced by tree_classdef_events_block::accept().
|
virtualinherited |
Definition at line 699 of file pt-walk.cc.
Referenced by tree_classdef_events_list::accept().
|
virtualinherited |
Definition at line 686 of file pt-walk.cc.
References tree_classdef_methods_list::accept(), and tree_classdef_element< T >::element_list().
Referenced by tree_classdef_methods_block::accept().
|
virtualinherited |
Definition at line 675 of file pt-walk.cc.
References octave_user_function::accept(), and octave_user_function::user_function_value().
Referenced by tree_classdef_methods_list::accept().
|
virtualinherited |
Definition at line 667 of file pt-walk.cc.
References tree_classdef_property_list::accept(), and tree_classdef_element< T >::element_list().
Referenced by tree_classdef_properties_block::accept().
|
virtualinherited |
Definition at line 652 of file pt-walk.cc.
Referenced by tree_classdef_property::accept().
|
virtualinherited |
Definition at line 658 of file pt-walk.cc.
Referenced by tree_classdef_property_list::accept().
|
virtualinherited |
Definition at line 638 of file pt-walk.cc.
Referenced by tree_classdef_superclass::accept().
|
virtualinherited |
Definition at line 643 of file pt-walk.cc.
Referenced by tree_classdef_superclass_list::accept().
|
virtual |
Reimplemented from tree_walker.
Definition at line 148 of file pt-pr-code.cc.
References tree::accept(), tree_colon_expression::base(), tree_colon_expression::increment(), indent(), tree_colon_expression::limit(), m_os, and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 292 of file pt-pr-code.cc.
References tree_argument_list::accept(), tree_statement_list::accept(), tree::accept(), tree_complex_for_command::body(), tree_complex_for_command::control_expr(), decrement_indent_level(), increment_indent_level(), indent(), tree_complex_for_command::leading_comment(), tree_complex_for_command::left_hand_side(), m_nesting, m_os, newline(), print_comment_list(), print_indented_comment(), and tree_complex_for_command::trailing_comment().
|
virtualinherited |
Reimplemented in tree_evaluator.
Definition at line 152 of file pt-walk.cc.
References tree_walker::visit_binary_expression().
Referenced by tree_compound_binary_expression::accept().
|
virtual |
Reimplemented from tree_walker.
Definition at line 749 of file pt-pr-code.cc.
References indent(), m_os, m_print_original_text, print_parens(), and tree_constant::print_raw().
|
virtual |
Reimplemented from tree_walker.
Definition at line 181 of file pt-pr-code.cc.
|
virtual |
Reimplemented from tree_walker.
Definition at line 189 of file pt-pr-code.cc.
References tree_decl_init_list::accept(), indent(), tree_decl_command::initializer_list(), m_os, and tree_decl_command::name().
|
virtual |
Reimplemented from tree_walker.
Definition at line 221 of file pt-pr-code.cc.
References tree_identifier::accept(), tree::accept(), tree_decl_elt::expression(), tree_decl_elt::ident(), and m_os.
|
virtual |
Reimplemented from tree_walker.
Definition at line 202 of file pt-pr-code.cc.
References tree_decl_elt::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), and m_os.
|
virtual |
Reimplemented from tree_walker.
Definition at line 1143 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_while_command::body(), tree_while_command::condition(), decrement_indent_level(), increment_indent_level(), indent(), tree_while_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and tree_while_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 761 of file pt-pr-code.cc.
References indent(), m_os, m_print_original_text, print_parens(), and tree_fcn_handle::print_raw().
|
virtual |
Reimplemented from tree_walker.
Definition at line 439 of file pt-pr-code.cc.
References f, tree_function_def::function(), octave_value::function_value(), and indent().
|
virtual |
Reimplemented from tree_walker.
Definition at line 452 of file pt-pr-code.cc.
References indent(), m_os, and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 465 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_if_clause::commands(), tree_if_clause::condition(), decrement_indent_level(), increment_indent_level(), and newline().
|
virtual |
Reimplemented from tree_walker.
Definition at line 487 of file pt-pr-code.cc.
References tree_if_command_list::accept(), tree_if_command::cmd_list(), indent(), tree_if_command::leading_comment(), m_os, print_comment_list(), print_indented_comment(), and tree_if_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 508 of file pt-pr-code.cc.
References tree_if_clause::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), indent(), tree_if_clause::is_else_clause(), tree_if_clause::leading_comment(), m_os, and print_indented_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 540 of file pt-pr-code.cc.
References tree_argument_list::accept(), tree::accept(), tree_index_expression::arg_lists(), tree_index_expression::arg_names(), tree_index_expression::dyn_fields(), tree_index_expression::expression(), indent(), m_nesting, m_os, n, panic_impossible, tree_expression::paren_count(), print_parens(), and tree_index_expression::type_tags().
|
virtual |
Reimplemented from tree_walker.
Definition at line 638 of file pt-pr-code.cc.
References tree_argument_list::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), indent(), m_nesting, m_os, and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 1185 of file pt-pr-code.cc.
References tree_metaclass_query::class_name(), and m_os.
|
virtual |
Reimplemented from tree_walker.
Definition at line 700 of file pt-pr-code.cc.
References tree_argument_list::accept(), tree::accept(), indent(), tree_multi_assignment::left_hand_side(), len, base_list< elt_type >::length(), m_nesting, m_os, tree_multi_assignment::oper(), print_parens(), and tree_multi_assignment::right_hand_side().
|
virtual |
Reimplemented from tree_walker.
Definition at line 738 of file pt-pr-code.cc.
References decrement_indent_level(), indent(), tree_no_op_command::is_end_of_fcn_or_script(), m_curr_print_indent_level, m_os, and tree_no_op_command::original_command().
|
virtual |
Reimplemented from tree_walker.
Definition at line 375 of file pt-pr-code.cc.
References tree_statement_list::accept(), octave_user_code::body(), increment_indent_level(), reset(), visit_octave_user_function_header(), and visit_octave_user_function_trailer().
void tree_print_code::visit_octave_user_function_header | ( | octave_user_function & | fcn | ) |
Definition at line 396 of file pt-pr-code.cc.
References 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 visit_octave_user_function().
void tree_print_code::visit_octave_user_function_trailer | ( | octave_user_function & | fcn | ) |
Definition at line 431 of file pt-pr-code.cc.
References newline(), print_indented_comment(), and octave_user_function::trailing_comment().
Referenced by visit_octave_user_function().
|
virtual |
Reimplemented from tree_walker.
Definition at line 364 of file pt-pr-code.cc.
References tree_statement_list::accept(), octave_user_code::body(), and reset().
|
virtual |
Reimplemented from tree_walker.
Definition at line 773 of file pt-pr-code.cc.
References tree_decl_elt::accept(), base_list< elt_type >::begin(), base_list< elt_type >::end(), tree_parameter_list::is_input_list(), len, base_list< elt_type >::length(), m_nesting, m_os, tree_parameter_list::takes_varargs(), and tree_parameter_list::varargs_symbol_name().
|
virtual |
Reimplemented from tree_walker.
Definition at line 833 of file pt-pr-code.cc.
References tree::accept(), indent(), m_os, tree_unary_expression::oper(), tree_unary_expression::operand(), and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 850 of file pt-pr-code.cc.
References tree::accept(), indent(), m_os, tree_unary_expression::oper(), tree_unary_expression::operand(), and print_parens().
|
virtual |
Reimplemented from tree_walker.
Definition at line 867 of file pt-pr-code.cc.
|
virtual |
Reimplemented from tree_walker.
Definition at line 875 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_simple_assignment::left_hand_side(), m_os, tree_simple_assignment::oper(), print_parens(), and tree_simple_assignment::right_hand_side().
|
virtual |
Reimplemented from tree_walker.
Definition at line 239 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_simple_for_command::body(), tree_simple_for_command::control_expr(), decrement_indent_level(), tree_simple_for_command::in_parallel(), increment_indent_level(), indent(), tree_simple_for_command::leading_comment(), tree_simple_for_command::left_hand_side(), m_os, tree_simple_for_command::maxproc_expr(), newline(), print_comment_list(), print_indented_comment(), and tree_simple_for_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 335 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree_spmd_command::body(), decrement_indent_level(), increment_indent_level(), indent(), tree_spmd_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and tree_spmd_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 897 of file pt-pr-code.cc.
References tree::accept(), tree_statement::command(), tree_statement::comment_text(), tree_statement::expression(), m_os, newline(), print_comment_list(), and tree_statement::print_result().
|
virtual |
Reimplemented from tree_walker.
Definition at line 929 of file pt-pr-code.cc.
|
virtual |
Reimplemented from tree_walker.
Definition at line 1179 of file pt-pr-code.cc.
References tree_superclass_ref::class_name(), m_os, and tree_superclass_ref::method_name().
|
virtual |
Reimplemented from tree_walker.
Definition at line 939 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_switch_case::case_label(), tree_switch_case::commands(), decrement_indent_level(), increment_indent_level(), indent(), tree_switch_case::is_default_case(), tree_switch_case::leading_comment(), m_os, newline(), and print_comment_list().
|
virtualinherited |
Reimplemented in tree_evaluator, tree_breakpoint, and ctor_analyzer.
Definition at line 345 of file pt-walk.cc.
References tree_switch_case::accept(), base_list< elt_type >::begin(), and base_list< elt_type >::end().
Referenced by tree_switch_case_list::accept().
|
virtual |
Reimplemented from tree_walker.
Definition at line 972 of file pt-pr-code.cc.
References tree_switch_case_list::accept(), tree::accept(), tree_switch_command::case_list(), decrement_indent_level(), increment_indent_level(), indent(), tree_switch_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and tree_switch_command::switch_value().
|
virtual |
Reimplemented from tree_walker.
Definition at line 1006 of file pt-pr-code.cc.
References tree_identifier::accept(), tree_statement_list::accept(), tree_try_catch_command::body(), tree_try_catch_command::cleanup(), decrement_indent_level(), tree_try_catch_command::identifier(), increment_indent_level(), indent(), tree_try_catch_command::leading_comment(), m_os, tree_try_catch_command::middle_comment(), newline(), print_comment_list(), print_indented_comment(), and tree_try_catch_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 1061 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree_unwind_protect_command::body(), tree_unwind_protect_command::cleanup(), decrement_indent_level(), increment_indent_level(), indent(), tree_unwind_protect_command::leading_comment(), m_os, tree_unwind_protect_command::middle_comment(), newline(), print_comment_list(), print_indented_comment(), and tree_unwind_protect_command::trailing_comment().
|
virtual |
Reimplemented from tree_walker.
Definition at line 1109 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_while_command::body(), tree_while_command::condition(), decrement_indent_level(), increment_indent_level(), indent(), tree_while_command::leading_comment(), m_os, newline(), print_comment_list(), print_indented_comment(), and tree_while_command::trailing_comment().
|
private |
Definition at line 183 of file pt-pr-code.h.
Referenced by indent(), newline(), print_comment_elt(), and reset().
|
private |
Definition at line 180 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 175 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 171 of file pt-pr-code.h.
Referenced by indent(), newline(), print_comment_elt(), print_parens(), visit_anon_fcn_handle(), visit_argument_list(), visit_arguments_block(), 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_spmd_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 173 of file pt-pr-code.h.
Referenced by indent().
|
private |
Definition at line 177 of file pt-pr-code.h.
Referenced by visit_constant(), and visit_fcn_handle().
|
private |
Definition at line 186 of file pt-pr-code.h.
Referenced by newline(), and print_fcn_handle_body().