#include "pt-pr-code.h"
Definition at line 37 of file pt-pr-code.h.
tree_print_code::tree_print_code | ( | std::ostream & | os_arg, | |
const std::string & | pfx = std::string () , |
|||
bool | pr_orig_txt = true | |||
) | [inline] |
Definition at line 42 of file pt-pr-code.h.
tree_print_code::~tree_print_code | ( | void | ) | [inline] |
Definition at line 54 of file pt-pr-code.h.
tree_print_code::tree_print_code | ( | void | ) | [private] |
tree_print_code::tree_print_code | ( | const tree_print_code & | ) | [private] |
void tree_print_code::decrement_indent_level | ( | void | ) | [inline, private] |
Definition at line 169 of file pt-pr-code.h.
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(), and visit_while_command().
void tree_print_code::do_decl_command | ( | tree_decl_command & | cmd | ) | [private] |
Definition at line 149 of file pt-pr-code.cc.
References tree_decl_init_list::accept(), indent(), tree_decl_command::initializer_list(), tree_decl_command::name(), and os.
Referenced by visit_global_command(), and visit_static_command().
void tree_print_code::increment_indent_level | ( | void | ) | [inline, private] |
Definition at line 167 of file pt-pr-code.h.
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(), and visit_while_command().
void tree_print_code::indent | ( | void | ) | [private] |
Definition at line 1191 of file pt-pr-code.cc.
References beginning_of_line, curr_print_indent_level, os, and prefix.
Referenced by do_decl_command(), 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_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(), and visit_while_command().
void tree_print_code::newline | ( | const char * | alt_txt = ", " |
) | [private] |
Definition at line 1209 of file pt-pr-code.cc.
References beginning_of_line, os, and 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(), and visit_while_command().
tree_print_code& tree_print_code::operator= | ( | const tree_print_code & | ) | [private] |
void tree_print_code::print_comment_elt | ( | const octave_comment_elt & | comment_elt | ) | [private] |
Definition at line 1242 of file pt-pr-code.cc.
References beginning_of_line, indent(), newline(), os, and octave_comment_elt::text().
Referenced by print_comment_list().
void tree_print_code::print_comment_list | ( | octave_comment_list * | comment_list | ) | [private] |
Definition at line 1296 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(), and visit_while_command().
void tree_print_code::print_fcn_handle_body | ( | tree_statement_list * | b | ) |
Definition at line 1152 of file pt-pr-code.cc.
References tree::accept(), tree_statement::expression(), octave_base_list< elt_type >::front(), octave_base_list< elt_type >::length(), and suppress_newlines.
Referenced by octave_fcn_handle::print_raw(), and visit_anon_fcn_handle().
void tree_print_code::print_indented_comment | ( | octave_comment_list * | comment_list | ) | [private] |
Definition at line 1315 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(), and visit_while_command().
void tree_print_code::print_parens | ( | const tree_expression & | expr, | |
const char * | txt | |||
) | [private] |
Definition at line 1233 of file pt-pr-code.cc.
References os, 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().
void tree_print_code::reset | ( | void | ) | [private] |
Definition at line 1224 of file pt-pr-code.cc.
References beginning_of_line, curr_print_indent_level, and nesting.
Referenced by visit_octave_user_function(), and visit_octave_user_script().
void tree_print_code::reset_indent_level | ( | void | ) | [inline, private] |
Definition at line 165 of file pt-pr-code.h.
void tree_print_code::visit_anon_fcn_handle | ( | tree_anon_fcn_handle & | afh | ) | [virtual] |
Implements tree_walker.
Definition at line 38 of file pt-pr-code.cc.
References tree_parameter_list::accept(), tree_anon_fcn_handle::body(), indent(), os, tree_anon_fcn_handle::parameter_list(), print_fcn_handle_body(), and print_parens().
void tree_print_code::visit_argument_list | ( | tree_argument_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 59 of file pt-pr-code.cc.
References tree::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), and os.
void tree_print_code::visit_binary_expression | ( | tree_binary_expression & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 78 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_binary_expression::lhs(), tree_binary_expression::oper(), os, print_parens(), and tree_binary_expression::rhs().
void tree_print_code::visit_break_command | ( | tree_break_command & | ) | [virtual] |
void tree_print_code::visit_cell | ( | tree_cell & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 651 of file pt-pr-code.cc.
References tree_argument_list::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), indent(), nesting, os, and print_parens().
void tree_print_code::visit_colon_expression | ( | tree_colon_expression & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 108 of file pt-pr-code.cc.
References tree::accept(), tree_colon_expression::base(), tree_colon_expression::increment(), indent(), tree_colon_expression::limit(), os, and print_parens().
void tree_print_code::visit_complex_for_command | ( | tree_complex_for_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 264 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree::accept(), tree_argument_list::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(), nesting, newline(), os, print_comment_list(), print_indented_comment(), and tree_complex_for_command::trailing_comment().
void tree_print_code::visit_constant | ( | tree_constant & | val | ) | [virtual] |
Implements tree_walker.
Definition at line 728 of file pt-pr-code.cc.
References indent(), os, print_original_text, print_parens(), and tree_constant::print_raw().
void tree_print_code::visit_continue_command | ( | tree_continue_command & | ) | [virtual] |
void tree_print_code::visit_decl_elt | ( | tree_decl_elt & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 174 of file pt-pr-code.cc.
References tree::accept(), tree_identifier::accept(), tree_decl_elt::expression(), tree_decl_elt::ident(), and os.
void tree_print_code::visit_decl_init_list | ( | tree_decl_init_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 192 of file pt-pr-code.cc.
References tree_decl_elt::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), and os.
void tree_print_code::visit_do_until_command | ( | tree_do_until_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 1116 of file pt-pr-code.cc.
References tree::accept(), tree_statement_list::accept(), tree_while_command::body(), tree_while_command::condition(), decrement_indent_level(), increment_indent_level(), indent(), tree_while_command::leading_comment(), newline(), os, print_comment_list(), print_indented_comment(), and tree_while_command::trailing_comment().
void tree_print_code::visit_fcn_handle | ( | tree_fcn_handle & | fh | ) | [virtual] |
Implements tree_walker.
Definition at line 740 of file pt-pr-code.cc.
References indent(), os, print_original_text, print_parens(), and tree_fcn_handle::print_raw().
void tree_print_code::visit_function_def | ( | tree_function_def & | fdef | ) | [virtual] |
Implements tree_walker.
Definition at line 437 of file pt-pr-code.cc.
References octave_function::accept(), f, tree_function_def::function(), octave_value::function_value(), and indent().
void tree_print_code::visit_global_command | ( | tree_global_command & | cmd | ) | [virtual] |
void tree_print_code::visit_identifier | ( | tree_identifier & | id | ) | [virtual] |
Implements tree_walker.
Definition at line 450 of file pt-pr-code.cc.
References indent(), os, and print_parens().
void tree_print_code::visit_if_clause | ( | tree_if_clause & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 463 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().
void tree_print_code::visit_if_command | ( | tree_if_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 485 of file pt-pr-code.cc.
References tree_if_command_list::accept(), tree_if_command::cmd_list(), indent(), tree_if_command::leading_comment(), os, print_comment_list(), print_indented_comment(), and tree_if_command::trailing_comment().
void tree_print_code::visit_if_command_list | ( | tree_if_command_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 506 of file pt-pr-code.cc.
References tree_if_clause::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), indent(), tree_if_clause::is_else_clause(), tree_if_clause::leading_comment(), os, and print_indented_comment().
void tree_print_code::visit_index_expression | ( | tree_index_expression & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 538 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::expression(), indent(), Array< T >::length(), nesting, os, panic_impossible, tree_expression::paren_count(), print_parens(), and tree_index_expression::type_tags().
void tree_print_code::visit_matrix | ( | tree_matrix & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 620 of file pt-pr-code.cc.
References tree_argument_list::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), indent(), nesting, os, and print_parens().
void tree_print_code::visit_multi_assignment | ( | tree_multi_assignment & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 682 of file pt-pr-code.cc.
References tree::accept(), tree_argument_list::accept(), indent(), tree_multi_assignment::left_hand_side(), octave_base_list< elt_type >::length(), nesting, tree_multi_assignment::oper(), os, print_parens(), and tree_multi_assignment::right_hand_side().
void tree_print_code::visit_no_op_command | ( | tree_no_op_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 720 of file pt-pr-code.cc.
References indent(), tree_no_op_command::original_command(), and os.
void tree_print_code::visit_octave_user_function | ( | octave_user_function & | fcn | ) | [virtual] |
Implements tree_walker.
Definition at line 318 of file pt-pr-code.cc.
References tree_statement_list::accept(), octave_user_function::body(), decrement_indent_level(), 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 339 of file pt-pr-code.cc.
References tree_parameter_list::accept(), indent(), octave_user_function::leading_comment(), octave_base_list< elt_type >::length(), octave_function::name(), nesting, newline(), os, octave_user_function::parameter_list(), print_comment_list(), octave_user_function::return_list(), octave_user_function::takes_var_return(), and octave_user_function::takes_varargs().
Referenced by octave_user_function::print_code_function_header(), and visit_octave_user_function().
void tree_print_code::visit_octave_user_function_trailer | ( | octave_user_function & | fcn | ) |
Definition at line 429 of file pt-pr-code.cc.
References newline(), print_indented_comment(), and octave_user_function::trailing_comment().
Referenced by octave_user_function::print_code_function_trailer(), and visit_octave_user_function().
void tree_print_code::visit_octave_user_script | ( | octave_user_script & | fcn | ) | [virtual] |
Implements tree_walker.
Definition at line 307 of file pt-pr-code.cc.
References tree_statement_list::accept(), octave_user_script::body(), and reset().
void tree_print_code::visit_parameter_list | ( | tree_parameter_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 752 of file pt-pr-code.cc.
References tree_decl_elt::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), and os.
void tree_print_code::visit_postfix_expression | ( | tree_postfix_expression & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 771 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_unary_expression::oper(), tree_unary_expression::operand(), os, and print_parens().
void tree_print_code::visit_prefix_expression | ( | tree_prefix_expression & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 788 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_unary_expression::oper(), tree_unary_expression::operand(), os, and print_parens().
void tree_print_code::visit_return_command | ( | tree_return_command & | ) | [virtual] |
void tree_print_code::visit_return_list | ( | tree_return_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 813 of file pt-pr-code.cc.
References tree_index_expression::accept(), octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), and os.
void tree_print_code::visit_simple_assignment | ( | tree_simple_assignment & | expr | ) | [virtual] |
Implements tree_walker.
Definition at line 832 of file pt-pr-code.cc.
References tree::accept(), indent(), tree_simple_assignment::left_hand_side(), tree_simple_assignment::oper(), os, print_parens(), and tree_simple_assignment::right_hand_side().
void tree_print_code::visit_simple_for_command | ( | tree_simple_for_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 211 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(), tree_simple_for_command::maxproc_expr(), newline(), os, print_comment_list(), print_indented_comment(), and tree_simple_for_command::trailing_comment().
void tree_print_code::visit_statement | ( | tree_statement & | stmt | ) | [virtual] |
Implements tree_walker.
Definition at line 854 of file pt-pr-code.cc.
References tree::accept(), tree_statement::command(), tree_statement::comment_text(), tree_statement::expression(), newline(), os, print_comment_list(), and tree_statement::print_result().
void tree_print_code::visit_statement_list | ( | tree_statement_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 892 of file pt-pr-code.cc.
References tree_statement::accept(), octave_base_list< elt_type >::begin(), and octave_base_list< elt_type >::end().
void tree_print_code::visit_static_command | ( | tree_static_command & | cmd | ) | [virtual] |
void tree_print_code::visit_switch_case | ( | tree_switch_case & | cs | ) | [virtual] |
Implements tree_walker.
Definition at line 904 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(), newline(), os, and print_comment_list().
void tree_print_code::visit_switch_case_list | ( | tree_switch_case_list & | lst | ) | [virtual] |
Implements tree_walker.
Definition at line 937 of file pt-pr-code.cc.
References tree_switch_case::accept(), octave_base_list< elt_type >::begin(), and octave_base_list< elt_type >::end().
void tree_print_code::visit_switch_command | ( | tree_switch_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 951 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(), newline(), os, print_comment_list(), print_indented_comment(), and tree_switch_command::switch_value().
void tree_print_code::visit_try_catch_command | ( | tree_try_catch_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 985 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree_try_catch_command::body(), tree_try_catch_command::cleanup(), decrement_indent_level(), increment_indent_level(), indent(), tree_try_catch_command::leading_comment(), tree_try_catch_command::middle_comment(), newline(), os, print_comment_list(), print_indented_comment(), and tree_try_catch_command::trailing_comment().
void tree_print_code::visit_unwind_protect_command | ( | tree_unwind_protect_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 1034 of file pt-pr-code.cc.
References tree_statement_list::accept(), tree_unwind_protect_command::body(), tree_unwind_protect_command::cleanup(), tree_unwind_protect_command::leading_comment(), tree_unwind_protect_command::middle_comment(), and tree_unwind_protect_command::trailing_comment().
void tree_print_code::visit_while_command | ( | tree_while_command & | cmd | ) | [virtual] |
Implements tree_walker.
Definition at line 1082 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(), newline(), os, print_comment_list(), print_indented_comment(), and tree_while_command::trailing_comment().
bool tree_print_code::beginning_of_line [private] |
Definition at line 158 of file pt-pr-code.h.
Referenced by indent(), newline(), print_comment_elt(), and reset().
int tree_print_code::curr_print_indent_level [private] |
Definition at line 155 of file pt-pr-code.h.
std::stack<char> tree_print_code::nesting [private] |
Definition at line 150 of file pt-pr-code.h.
Referenced by reset(), visit_cell(), visit_complex_for_command(), visit_index_expression(), visit_matrix(), visit_multi_assignment(), and visit_octave_user_function_header().
std::ostream& tree_print_code::os [private] |
Definition at line 146 of file pt-pr-code.h.
Referenced by do_decl_command(), 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_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_multi_assignment(), visit_no_op_command(), visit_octave_user_function_header(), visit_parameter_list(), visit_postfix_expression(), visit_prefix_expression(), visit_return_command(), visit_return_list(), visit_simple_assignment(), visit_simple_for_command(), visit_statement(), visit_switch_case(), visit_switch_command(), visit_try_catch_command(), and visit_while_command().
std::string tree_print_code::prefix [private] |
Definition at line 148 of file pt-pr-code.h.
Referenced by indent().
bool tree_print_code::print_original_text [private] |
Definition at line 152 of file pt-pr-code.h.
Referenced by visit_constant(), and visit_fcn_handle().
int tree_print_code::suppress_newlines [private] |
Definition at line 161 of file pt-pr-code.h.
Referenced by newline(), and print_fcn_handle_body().