GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::tree_print_code Class Reference

#include "pt-pr-code.h"

Inheritance diagram for octave::tree_print_code:
Collaboration diagram for octave::tree_print_code:

Public Member Functions

 tree_print_code (const tree_print_code &)=delete
 
 tree_print_code (std::ostream &os_arg, const std::string &pfx="", bool pr_orig_txt=true)
 
 ~tree_print_code (void)=default
 
tree_print_codeoperator= (const tree_print_code &)=delete
 
void print_fcn_handle_body (tree_expression *)
 
void visit_anon_fcn_handle (tree_anon_fcn_handle &)
 
void visit_argument_list (tree_argument_list &)
 
void visit_binary_expression (tree_binary_expression &)
 
virtual void visit_boolean_expression (tree_boolean_expression &)
 
void visit_break_command (tree_break_command &)
 
void visit_cell (tree_cell &)
 
virtual void visit_classdef (tree_classdef &)
 
virtual void visit_classdef_attribute (tree_classdef_attribute &)
 
virtual void visit_classdef_attribute_list (tree_classdef_attribute_list &)
 
virtual void visit_classdef_body (tree_classdef_body &)
 
virtual void visit_classdef_enum (tree_classdef_enum &)
 
virtual void visit_classdef_enum_block (tree_classdef_enum_block &)
 
virtual void visit_classdef_enum_list (tree_classdef_enum_list &)
 
virtual void visit_classdef_event (tree_classdef_event &)
 
virtual void visit_classdef_events_block (tree_classdef_events_block &)
 
virtual void visit_classdef_events_list (tree_classdef_events_list &)
 
virtual void visit_classdef_methods_block (tree_classdef_methods_block &)
 
virtual void visit_classdef_methods_list (tree_classdef_methods_list &)
 
virtual void visit_classdef_properties_block (tree_classdef_properties_block &)
 
virtual void visit_classdef_property (tree_classdef_property &)
 
virtual void visit_classdef_property_list (tree_classdef_property_list &)
 
virtual void visit_classdef_superclass (tree_classdef_superclass &)
 
virtual void visit_classdef_superclass_list (tree_classdef_superclass_list &)
 
void visit_colon_expression (tree_colon_expression &)
 
void visit_complex_for_command (tree_complex_for_command &)
 
virtual void visit_compound_binary_expression (tree_compound_binary_expression &)
 
void visit_constant (tree_constant &)
 
void visit_continue_command (tree_continue_command &)
 
void visit_decl_command (tree_decl_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_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_metaclass_query (tree_metaclass_query &)
 
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_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_superclass_ref (tree_superclass_ref &)
 
void visit_switch_case (tree_switch_case &)
 
virtual 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)
 
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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ tree_print_code() [1/3]

octave::tree_print_code::tree_print_code ( std::ostream &  os_arg,
const std::string &  pfx = "",
bool  pr_orig_txt = true 
)
inline

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

References m_nesting.

◆ tree_print_code() [2/3]

octave::tree_print_code::tree_print_code ( const tree_print_code )
delete

◆ ~tree_print_code()

octave::tree_print_code::~tree_print_code ( void  )
default

◆ tree_print_code() [3/3]

octave::tree_print_code::tree_print_code ( void  )
private

Member Function Documentation

◆ decrement_indent_level()

◆ increment_indent_level()

◆ indent()

◆ newline()

◆ operator=()

tree_print_code& octave::tree_print_code::operator= ( const tree_print_code )
delete

◆ print_comment_elt()

void octave::tree_print_code::print_comment_elt ( const comment_elt comment_elt)
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().

◆ print_comment_list()

◆ print_fcn_handle_body()

void octave::tree_print_code::print_fcn_handle_body ( tree_expression e)

◆ print_indented_comment()

◆ print_parens()

◆ reset()

void octave::tree_print_code::reset ( void  )
private

◆ reset_indent_level()

void octave::tree_print_code::reset_indent_level ( void  )
inlineprivate

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

References m_curr_print_indent_level.

◆ visit_anon_fcn_handle()

void octave::tree_print_code::visit_anon_fcn_handle ( tree_anon_fcn_handle afh)
virtual

◆ visit_argument_list()

void octave::tree_print_code::visit_argument_list ( tree_argument_list lst)
virtual

◆ visit_binary_expression()

void octave::tree_print_code::visit_binary_expression ( tree_binary_expression expr)
virtual

◆ visit_boolean_expression()

void octave::tree_walker::visit_boolean_expression ( tree_boolean_expression expr)
virtualinherited

◆ visit_break_command()

void octave::tree_print_code::visit_break_command ( tree_break_command )
virtual

Reimplemented from octave::tree_walker.

Definition at line 101 of file pt-pr-code.cc.

References indent(), and m_os.

◆ visit_cell()

void octave::tree_print_code::visit_cell ( tree_cell lst)
virtual

◆ visit_classdef()

void octave::tree_walker::visit_classdef ( tree_classdef )
virtualinherited

Definition at line 606 of file pt-walk.cc.

Referenced by octave::tree_classdef::accept().

◆ visit_classdef_attribute()

void octave::tree_walker::visit_classdef_attribute ( tree_classdef_attribute )
virtualinherited

Definition at line 526 of file pt-walk.cc.

Referenced by octave::tree_classdef_attribute::accept().

◆ visit_classdef_attribute_list()

void octave::tree_walker::visit_classdef_attribute_list ( tree_classdef_attribute_list )
virtualinherited

Definition at line 531 of file pt-walk.cc.

Referenced by octave::tree_classdef_attribute_list::accept().

◆ visit_classdef_body()

void octave::tree_walker::visit_classdef_body ( tree_classdef_body )
virtualinherited

Definition at line 601 of file pt-walk.cc.

Referenced by octave::tree_classdef_body::accept().

◆ visit_classdef_enum()

void octave::tree_walker::visit_classdef_enum ( tree_classdef_enum )
virtualinherited

Definition at line 586 of file pt-walk.cc.

Referenced by octave::tree_classdef_enum::accept().

◆ visit_classdef_enum_block()

void octave::tree_walker::visit_classdef_enum_block ( tree_classdef_enum_block )
virtualinherited

Definition at line 596 of file pt-walk.cc.

Referenced by octave::tree_classdef_enum_block::accept().

◆ visit_classdef_enum_list()

void octave::tree_walker::visit_classdef_enum_list ( tree_classdef_enum_list )
virtualinherited

Definition at line 591 of file pt-walk.cc.

Referenced by octave::tree_classdef_enum_list::accept().

◆ visit_classdef_event()

void octave::tree_walker::visit_classdef_event ( tree_classdef_event )
virtualinherited

Definition at line 571 of file pt-walk.cc.

Referenced by octave::tree_classdef_event::accept().

◆ visit_classdef_events_block()

void octave::tree_walker::visit_classdef_events_block ( tree_classdef_events_block )
virtualinherited

Definition at line 581 of file pt-walk.cc.

Referenced by octave::tree_classdef_events_block::accept().

◆ visit_classdef_events_list()

void octave::tree_walker::visit_classdef_events_list ( tree_classdef_events_list )
virtualinherited

Definition at line 576 of file pt-walk.cc.

Referenced by octave::tree_classdef_events_list::accept().

◆ visit_classdef_methods_block()

void octave::tree_walker::visit_classdef_methods_block ( tree_classdef_methods_block )
virtualinherited

Definition at line 566 of file pt-walk.cc.

Referenced by octave::tree_classdef_methods_block::accept().

◆ visit_classdef_methods_list()

void octave::tree_walker::visit_classdef_methods_list ( tree_classdef_methods_list )
virtualinherited

Definition at line 561 of file pt-walk.cc.

Referenced by octave::tree_classdef_methods_list::accept().

◆ visit_classdef_properties_block()

void octave::tree_walker::visit_classdef_properties_block ( tree_classdef_properties_block )
virtualinherited

Definition at line 556 of file pt-walk.cc.

Referenced by octave::tree_classdef_properties_block::accept().

◆ visit_classdef_property()

void octave::tree_walker::visit_classdef_property ( tree_classdef_property )
virtualinherited

Definition at line 546 of file pt-walk.cc.

Referenced by octave::tree_classdef_property::accept().

◆ visit_classdef_property_list()

void octave::tree_walker::visit_classdef_property_list ( tree_classdef_property_list )
virtualinherited

Definition at line 551 of file pt-walk.cc.

Referenced by octave::tree_classdef_property_list::accept().

◆ visit_classdef_superclass()

void octave::tree_walker::visit_classdef_superclass ( tree_classdef_superclass )
virtualinherited

Definition at line 536 of file pt-walk.cc.

Referenced by octave::tree_classdef_superclass::accept().

◆ visit_classdef_superclass_list()

void octave::tree_walker::visit_classdef_superclass_list ( tree_classdef_superclass_list )
virtualinherited

Definition at line 541 of file pt-walk.cc.

Referenced by octave::tree_classdef_superclass_list::accept().

◆ visit_colon_expression()

void octave::tree_print_code::visit_colon_expression ( tree_colon_expression expr)
virtual

◆ visit_complex_for_command()

◆ visit_compound_binary_expression()

void octave::tree_walker::visit_compound_binary_expression ( tree_compound_binary_expression expr)
virtualinherited

◆ visit_constant()

void octave::tree_print_code::visit_constant ( tree_constant val)
virtual

◆ visit_continue_command()

void octave::tree_print_code::visit_continue_command ( tree_continue_command )
virtual

Reimplemented from octave::tree_walker.

Definition at line 142 of file pt-pr-code.cc.

References indent(), and m_os.

◆ visit_decl_command()

void octave::tree_print_code::visit_decl_command ( tree_decl_command cmd)
virtual

◆ visit_decl_elt()

void octave::tree_print_code::visit_decl_elt ( tree_decl_elt cmd)
virtual

◆ visit_decl_init_list()

void octave::tree_print_code::visit_decl_init_list ( tree_decl_init_list lst)
virtual

◆ visit_do_until_command()

◆ visit_fcn_handle()

void octave::tree_print_code::visit_fcn_handle ( tree_fcn_handle fh)
virtual

◆ visit_function_def()

void octave::tree_print_code::visit_function_def ( tree_function_def fdef)
virtual

◆ visit_identifier()

void octave::tree_print_code::visit_identifier ( tree_identifier id)
virtual

Reimplemented from octave::tree_walker.

Definition at line 384 of file pt-pr-code.cc.

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

◆ visit_if_clause()

◆ visit_if_command()

◆ visit_if_command_list()

◆ visit_index_expression()

◆ visit_matrix()

void octave::tree_print_code::visit_matrix ( tree_matrix lst)
virtual

◆ visit_metaclass_query()

void octave::tree_print_code::visit_metaclass_query ( tree_metaclass_query mcq)
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.

◆ visit_multi_assignment()

◆ visit_no_op_command()

void octave::tree_print_code::visit_no_op_command ( tree_no_op_command cmd)
virtual

◆ visit_octave_user_function()

void octave::tree_print_code::visit_octave_user_function ( octave_user_function fcn)
virtual

◆ visit_octave_user_function_header()

◆ visit_octave_user_function_trailer()

◆ visit_octave_user_script()

void octave::tree_print_code::visit_octave_user_script ( octave_user_script fcn)
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().

◆ visit_parameter_list()

◆ visit_postfix_expression()

void octave::tree_print_code::visit_postfix_expression ( tree_postfix_expression expr)
virtual

◆ visit_prefix_expression()

void octave::tree_print_code::visit_prefix_expression ( tree_prefix_expression expr)
virtual

◆ visit_return_command()

void octave::tree_print_code::visit_return_command ( tree_return_command )
virtual

Reimplemented from octave::tree_walker.

Definition at line 799 of file pt-pr-code.cc.

References indent(), and m_os.

◆ visit_simple_assignment()

◆ visit_simple_for_command()

◆ visit_statement()

◆ visit_statement_list()

void octave::tree_print_code::visit_statement_list ( tree_statement_list lst)
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().

◆ visit_superclass_ref()

void octave::tree_print_code::visit_superclass_ref ( tree_superclass_ref scr)
virtual

◆ visit_switch_case()

◆ visit_switch_case_list()

◆ visit_switch_command()

◆ visit_try_catch_command()

◆ visit_unwind_protect_command()

◆ visit_while_command()

Member Data Documentation

◆ m_beginning_of_line

bool octave::tree_print_code::m_beginning_of_line
private

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

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

◆ m_curr_print_indent_level

int octave::tree_print_code::m_curr_print_indent_level
private

◆ m_nesting

std::stack<char> octave::tree_print_code::m_nesting
private

◆ m_os

◆ m_prefix

std::string octave::tree_print_code::m_prefix
private

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

Referenced by indent().

◆ m_print_original_text

bool octave::tree_print_code::m_print_original_text
private

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

Referenced by visit_constant(), and visit_fcn_handle().

◆ m_suppress_newlines

int octave::tree_print_code::m_suppress_newlines
private

Definition at line 172 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: