Public Member Functions | Private Member Functions | Private Attributes

tree_print_code Class Reference

#include "pt-pr-code.h"

Inheritance diagram for tree_print_code:
Inheritance graph
Collaboration diagram for tree_print_code:
Collaboration graph

List of all members.

Public Member Functions

 tree_print_code (std::ostream &os_arg, const std::string &pfx=std::string(), bool pr_orig_txt=true)
 ~tree_print_code (void)
void print_fcn_handle_body (tree_statement_list *)
void visit_anon_fcn_handle (tree_anon_fcn_handle &)
void visit_argument_list (tree_argument_list &)
void visit_binary_expression (tree_binary_expression &)
void visit_break_command (tree_break_command &)
void visit_cell (tree_cell &)
void visit_colon_expression (tree_colon_expression &)
void visit_complex_for_command (tree_complex_for_command &)
void visit_constant (tree_constant &)
void visit_continue_command (tree_continue_command &)
void visit_decl_elt (tree_decl_elt &)
void visit_decl_init_list (tree_decl_init_list &)
void visit_do_until_command (tree_do_until_command &)
void visit_fcn_handle (tree_fcn_handle &)
void visit_function_def (tree_function_def &)
void visit_global_command (tree_global_command &)
void visit_identifier (tree_identifier &)
void visit_if_clause (tree_if_clause &)
void visit_if_command (tree_if_command &)
void visit_if_command_list (tree_if_command_list &)
void visit_index_expression (tree_index_expression &)
void visit_matrix (tree_matrix &)
void visit_multi_assignment (tree_multi_assignment &)
void visit_no_op_command (tree_no_op_command &)
void visit_octave_user_function (octave_user_function &)
void visit_octave_user_function_header (octave_user_function &)
void visit_octave_user_function_trailer (octave_user_function &)
void visit_octave_user_script (octave_user_script &)
void visit_parameter_list (tree_parameter_list &)
void visit_postfix_expression (tree_postfix_expression &)
void visit_prefix_expression (tree_prefix_expression &)
void visit_return_command (tree_return_command &)
void visit_return_list (tree_return_list &)
void visit_simple_assignment (tree_simple_assignment &)
void visit_simple_for_command (tree_simple_for_command &)
void visit_statement (tree_statement &)
void visit_statement_list (tree_statement_list &)
void visit_static_command (tree_static_command &)
void visit_switch_case (tree_switch_case &)
void visit_switch_case_list (tree_switch_case_list &)
void visit_switch_command (tree_switch_command &)
void visit_try_catch_command (tree_try_catch_command &)
void visit_unwind_protect_command (tree_unwind_protect_command &)
void visit_while_command (tree_while_command &)

Private Member Functions

 tree_print_code (void)
 tree_print_code (const tree_print_code &)
void decrement_indent_level (void)
void do_decl_command (tree_decl_command &cmd)
void increment_indent_level (void)
void indent (void)
void newline (const char *alt_txt=", ")
tree_print_codeoperator= (const tree_print_code &)
void print_comment_elt (const octave_comment_elt &comment_elt)
void print_comment_list (octave_comment_list *comment_list)
void print_indented_comment (octave_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 beginning_of_line
int curr_print_indent_level
std::stack< charnesting
std::ostream & os
std::string prefix
bool print_original_text
int suppress_newlines

Detailed Description

Definition at line 37 of file pt-pr-code.h.

Constructor & Destructor Documentation

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]

Member Function Documentation

void tree_print_code::decrement_indent_level ( void   )  [inline, private]
void tree_print_code::do_decl_command ( tree_decl_command cmd  )  [private]
void tree_print_code::increment_indent_level ( void   )  [inline, private]
void tree_print_code::indent ( void   )  [private]
void tree_print_code::newline ( const char alt_txt = ", "  )  [private]
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

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]
void tree_print_code::print_fcn_handle_body ( tree_statement_list b  ) 
void tree_print_code::print_indented_comment ( octave_comment_list comment_list  )  [private]
void tree_print_code::print_parens ( const tree_expression expr,
const char txt 
) [private]
void tree_print_code::reset ( void   )  [private]
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]
void tree_print_code::visit_argument_list ( tree_argument_list lst  )  [virtual]
void tree_print_code::visit_binary_expression ( tree_binary_expression expr  )  [virtual]
void tree_print_code::visit_break_command ( tree_break_command  )  [virtual]

Implements tree_walker.

Definition at line 100 of file

References indent(), and os.

void tree_print_code::visit_cell ( tree_cell lst  )  [virtual]
void tree_print_code::visit_colon_expression ( tree_colon_expression expr  )  [virtual]
void tree_print_code::visit_complex_for_command ( tree_complex_for_command cmd  )  [virtual]
void tree_print_code::visit_constant ( tree_constant val  )  [virtual]

Implements tree_walker.

Definition at line 728 of file

References indent(), os, print_original_text, print_parens(), and tree_constant::print_raw().

void tree_print_code::visit_continue_command ( tree_continue_command  )  [virtual]

Implements tree_walker.

Definition at line 141 of file

References indent(), and os.

void tree_print_code::visit_decl_elt ( tree_decl_elt cmd  )  [virtual]
void tree_print_code::visit_decl_init_list ( tree_decl_init_list lst  )  [virtual]
void tree_print_code::visit_do_until_command ( tree_do_until_command cmd  )  [virtual]
void tree_print_code::visit_fcn_handle ( tree_fcn_handle fh  )  [virtual]

Implements tree_walker.

Definition at line 740 of file

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]
void tree_print_code::visit_global_command ( tree_global_command cmd  )  [virtual]

Implements tree_walker.

Definition at line 162 of file

References do_decl_command().

void tree_print_code::visit_identifier ( tree_identifier id  )  [virtual]

Implements tree_walker.

Definition at line 450 of file

References indent(), os, and print_parens().

void tree_print_code::visit_if_clause ( tree_if_clause cmd  )  [virtual]
void tree_print_code::visit_if_command ( tree_if_command cmd  )  [virtual]
void tree_print_code::visit_if_command_list ( tree_if_command_list lst  )  [virtual]
void tree_print_code::visit_index_expression ( tree_index_expression expr  )  [virtual]
void tree_print_code::visit_matrix ( tree_matrix lst  )  [virtual]
void tree_print_code::visit_multi_assignment ( tree_multi_assignment expr  )  [virtual]
void tree_print_code::visit_no_op_command ( tree_no_op_command cmd  )  [virtual]

Implements tree_walker.

Definition at line 720 of file

References indent(), tree_no_op_command::original_command(), and os.

void tree_print_code::visit_octave_user_function ( octave_user_function fcn  )  [virtual]
void tree_print_code::visit_octave_user_function_header ( octave_user_function fcn  ) 
void tree_print_code::visit_octave_user_function_trailer ( octave_user_function fcn  ) 
void tree_print_code::visit_octave_user_script ( octave_user_script fcn  )  [virtual]

Implements tree_walker.

Definition at line 307 of file

References tree_statement_list::accept(), octave_user_script::body(), and reset().

void tree_print_code::visit_parameter_list ( tree_parameter_list lst  )  [virtual]
void tree_print_code::visit_postfix_expression ( tree_postfix_expression expr  )  [virtual]
void tree_print_code::visit_prefix_expression ( tree_prefix_expression expr  )  [virtual]
void tree_print_code::visit_return_command ( tree_return_command  )  [virtual]

Implements tree_walker.

Definition at line 805 of file

References indent(), and os.

void tree_print_code::visit_return_list ( tree_return_list lst  )  [virtual]
void tree_print_code::visit_simple_assignment ( tree_simple_assignment expr  )  [virtual]
void tree_print_code::visit_simple_for_command ( tree_simple_for_command cmd  )  [virtual]
void tree_print_code::visit_statement ( tree_statement stmt  )  [virtual]
void tree_print_code::visit_statement_list ( tree_statement_list lst  )  [virtual]
void tree_print_code::visit_static_command ( tree_static_command cmd  )  [virtual]

Implements tree_walker.

Definition at line 168 of file

References do_decl_command().

void tree_print_code::visit_switch_case ( tree_switch_case cs  )  [virtual]
void tree_print_code::visit_switch_case_list ( tree_switch_case_list lst  )  [virtual]
void tree_print_code::visit_switch_command ( tree_switch_command cmd  )  [virtual]
void tree_print_code::visit_try_catch_command ( tree_try_catch_command cmd  )  [virtual]
void tree_print_code::visit_unwind_protect_command ( tree_unwind_protect_command cmd  )  [virtual]
void tree_print_code::visit_while_command ( tree_while_command cmd  )  [virtual]

Member Data Documentation

Definition at line 158 of file pt-pr-code.h.

Referenced by indent(), newline(), print_comment_elt(), and reset().

Definition at line 155 of file pt-pr-code.h.

Referenced by indent(), and reset().

std::stack<char> tree_print_code::nesting [private]
std::ostream& tree_print_code::os [private]
std::string tree_print_code::prefix [private]

Definition at line 148 of file pt-pr-code.h.

Referenced by indent().

Definition at line 152 of file pt-pr-code.h.

Referenced by visit_constant(), and visit_fcn_handle().

Definition at line 161 of file pt-pr-code.h.

Referenced by newline(), and print_fcn_handle_body().

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines