GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
tree_expression Class Referenceabstract

#include "pt-exp.h"

Inheritance diagram for tree_expression:
Collaboration diagram for tree_expression:

Public Member Functions

 tree_expression (const tree_expression &)=delete
 
 tree_expression (int l=-1, int c=-1)
 
virtual ~tree_expression (void)=default
 
virtual void accept (tree_walker &tw)=0
 
const std::string bp_cond (void) const
 
void column (int c)
 
virtual int column (void) const
 
virtual void copy_base (const tree_expression &e)
 
virtual void delete_breakpoint (void)
 
virtual tree_expressiondup (symbol_scope &scope) const =0
 
virtual octave_value evaluate (tree_evaluator &tw, int nargout=1)=0
 
virtual octave_value_list evaluate_n (tree_evaluator &tw, int nargout=1)=0
 
bool is_active_breakpoint (tree_evaluator &tw) const
 
virtual bool is_assignment_expression (void) const
 
virtual bool is_binary_expression (void) const
 
virtual bool is_boolean_expression (void) const
 
bool is_breakpoint (void) const
 
virtual bool is_colon_expression (void) const
 
virtual bool is_constant (void) const
 
bool is_for_cmd_expr (void) const
 
virtual bool is_identifier (void) const
 
virtual bool is_index_expression (void) const
 
virtual bool is_matrix (void) const
 
bool is_postfix_indexed (void) const
 
virtual bool is_prefix_expression (void) const
 
virtual bool is_unary_expression (void) const
 
virtual bool iscell (void) const
 
void line (int l)
 
virtual int line (void) const
 
virtual octave_lvalue lvalue (tree_evaluator &)
 
virtual bool lvalue_ok (void) const
 
void mark_as_for_cmd_expr (void)
 
tree_expressionmark_in_parens (void)
 
bool meets_bp_condition (tree_evaluator &tw) const
 
virtual std::string name (void) const
 
virtual std::string oper (void) const
 
tree_expressionoperator= (const tree_expression &)=delete
 
virtual std::string original_text (void) const
 
int paren_count (void) const
 
char postfix_index (void) const
 
bool print_result (void) const
 
virtual bool rvalue_ok (void) const
 
virtual void set_breakpoint (const std::string &condition)
 
void set_location (int l, int c)
 
tree_expressionset_postfix_index (char type)
 
tree_expressionset_print_flag (bool print)
 
std::string str_print_code (void)
 

Protected Attributes

bool m_for_cmd_expr
 
int m_num_parens
 
char m_postfix_index_type
 
bool m_print_flag
 

Private Attributes

std::string * m_bp_cond
 
int m_column_num
 
int m_line_num
 

Detailed Description

Definition at line 46 of file pt-exp.h.

Constructor & Destructor Documentation

◆ tree_expression() [1/2]

tree_expression::tree_expression ( int  l = -1,
int  c = -1 
)
inline

Definition at line 50 of file pt-exp.h.

◆ tree_expression() [2/2]

tree_expression::tree_expression ( const tree_expression )
delete

◆ ~tree_expression()

virtual tree_expression::~tree_expression ( void  )
virtualdefault

Member Function Documentation

◆ accept()

virtual void tree::accept ( tree_walker tw)
pure virtualinherited

Implemented in tree_postfix_expression, tree_prefix_expression, tree_statement, tree_spmd_command, tree_switch_command, tree_switch_case, tree_if_command, tree_if_clause, tree_matrix, tree_complex_for_command, tree_simple_for_command, tree_do_until_command, tree_while_command, tree_return_command, tree_continue_command, tree_break_command, tree_index_expression, tree_identifier, tree_anon_fcn_handle, tree_fcn_handle, tree_unwind_protect_command, tree_try_catch_command, tree_decl_command, tree_constant, tree_colon_expression, tree_function_def, tree_no_op_command, tree_classdef, tree_classdef_enum_block, tree_classdef_events_block, tree_classdef_methods_block, tree_classdef_properties_block, tree_metaclass_query, tree_superclass_ref, tree_cell, tree_compound_binary_expression, tree_boolean_expression, tree_binary_expression, tree_multi_assignment, tree_simple_assignment, tree_array_list, tree_arguments_block, tree_classdef_element< T >, tree_classdef_element< tree_classdef_methods_list >, tree_classdef_element< tree_classdef_property_list >, tree_classdef_element< tree_classdef_enum_list >, and tree_classdef_element< tree_classdef_events_list >.

Referenced by tree_print_code::print_fcn_handle_body(), tree::str_print_code(), tree_anon_scopes::visit_anon_fcn_handle(), tree_walker::visit_anon_fcn_handle(), tree_walker::visit_arg_validation(), tree_print_code::visit_argument_list(), tree_walker::visit_argument_list(), tree_print_code::visit_binary_expression(), tree_walker::visit_binary_expression(), tree_walker::visit_classdef_attribute(), tree_print_code::visit_colon_expression(), tree_walker::visit_colon_expression(), tree_checker::visit_complex_for_command(), tree_print_code::visit_complex_for_command(), tree_walker::visit_complex_for_command(), tree_print_code::visit_decl_elt(), tree_walker::visit_decl_elt(), tree_print_code::visit_do_until_command(), tree_walker::visit_do_until_command(), tree_print_code::visit_if_clause(), tree_walker::visit_if_clause(), tree_print_code::visit_index_expression(), tree_walker::visit_index_expression(), ctor_analyzer::visit_index_expression(), tree_checker::visit_multi_assignment(), tree_print_code::visit_multi_assignment(), tree_walker::visit_multi_assignment(), ctor_analyzer::visit_multi_assignment(), tree_print_code::visit_postfix_expression(), tree_walker::visit_postfix_expression(), tree_print_code::visit_prefix_expression(), tree_walker::visit_prefix_expression(), tree_checker::visit_simple_assignment(), tree_print_code::visit_simple_assignment(), tree_walker::visit_simple_assignment(), ctor_analyzer::visit_simple_assignment(), tree_checker::visit_simple_for_command(), tree_print_code::visit_simple_for_command(), tree_walker::visit_simple_for_command(), tree_anon_scopes::visit_statement(), tree_breakpoint::visit_statement(), tree_evaluator::visit_statement(), tree_print_code::visit_statement(), tree_walker::visit_statement(), ctor_analyzer::visit_statement(), tree_print_code::visit_switch_case(), tree_walker::visit_switch_case(), tree_print_code::visit_switch_command(), tree_walker::visit_switch_command(), tree_print_code::visit_while_command(), and tree_walker::visit_while_command().

◆ bp_cond()

const std::string tree::bp_cond ( void  ) const
inlineinherited

Definition at line 106 of file pt.h.

References tree::m_bp_cond.

Referenced by tree_statement::bp_cond(), and tree_breakpoint::take_action().

◆ column() [1/2]

void tree::column ( int  c)
inlineinherited

Definition at line 66 of file pt.h.

References tree::m_column_num.

◆ column() [2/2]

◆ copy_base()

◆ delete_breakpoint()

virtual void tree::delete_breakpoint ( void  )
inlinevirtualinherited

Reimplemented in tree_statement.

Definition at line 82 of file pt.h.

References tree::m_bp_cond.

Referenced by tree_statement::delete_breakpoint(), and tree_breakpoint::take_action().

◆ dup()

◆ evaluate()

◆ evaluate_n()

◆ is_active_breakpoint()

◆ is_assignment_expression()

virtual bool tree_expression::is_assignment_expression ( void  ) const
inlinevirtual

◆ is_binary_expression()

virtual bool tree_expression::is_binary_expression ( void  ) const
inlinevirtual

Reimplemented in tree_binary_expression.

Definition at line 80 of file pt-exp.h.

Referenced by base_parser::maybe_convert_to_braindead_shortcircuit().

◆ is_boolean_expression()

virtual bool tree_expression::is_boolean_expression ( void  ) const
inlinevirtual

Reimplemented in tree_boolean_expression.

Definition at line 82 of file pt-exp.h.

◆ is_breakpoint()

bool tree::is_breakpoint ( void  ) const
inlineinherited

Definition at line 94 of file pt.h.

References tree::m_bp_cond.

Referenced by tree_statement::is_breakpoint(), and tree_breakpoint::take_action().

◆ is_colon_expression()

virtual bool tree_expression::is_colon_expression ( void  ) const
inlinevirtual

Reimplemented in tree_colon_expression.

Definition at line 84 of file pt-exp.h.

◆ is_constant()

virtual bool tree_expression::is_constant ( void  ) const
inlinevirtual

◆ is_for_cmd_expr()

bool tree_expression::is_for_cmd_expr ( void  ) const
inline

Definition at line 112 of file pt-exp.h.

References m_for_cmd_expr.

Referenced by tree_colon_expression::evaluate().

◆ is_identifier()

◆ is_index_expression()

virtual bool tree_expression::is_index_expression ( void  ) const
inlinevirtual

◆ is_matrix()

virtual bool tree_expression::is_matrix ( void  ) const
inlinevirtual

Reimplemented in tree_matrix.

Definition at line 66 of file pt-exp.h.

Referenced by base_parser::validate_array_list(), and base_parser::validate_matrix_for_assignment().

◆ is_postfix_indexed()

bool tree_expression::is_postfix_indexed ( void  ) const
inline

◆ is_prefix_expression()

virtual bool tree_expression::is_prefix_expression ( void  ) const
inlinevirtual

Definition at line 76 of file pt-exp.h.

◆ is_unary_expression()

virtual bool tree_expression::is_unary_expression ( void  ) const
inlinevirtual

Reimplemented in tree_unary_expression.

Definition at line 78 of file pt-exp.h.

Referenced by strip_trans_herm().

◆ iscell()

virtual bool tree_expression::iscell ( void  ) const
inlinevirtual

Reimplemented in tree_cell.

Definition at line 68 of file pt-exp.h.

◆ line() [1/2]

void tree::line ( int  l)
inlineinherited

Definition at line 64 of file pt.h.

References tree::m_line_num.

◆ line() [2/2]

virtual int tree::line ( void  ) const
inlinevirtualinherited

Reimplemented in tree_statement.

Definition at line 60 of file pt.h.

References tree::m_line_num.

Referenced by tree_binary_expression::dup(), tree_braindead_shortcircuit_binary_expression::dup(), tree_boolean_expression::dup(), tree_cell::dup(), tree_superclass_ref::dup(), tree_metaclass_query::dup(), tree_colon_expression::dup(), tree_constant::dup(), tree_fcn_handle::dup(), tree_anon_fcn_handle::dup(), tree_identifier::dup(), tree_index_expression::dup(), tree_matrix::dup(), tree_prefix_expression::dup(), tree_postfix_expression::dup(), anon_fcn_validator::error(), tree_identifier::eval_undefined_error(), base_parser::finish_if_command(), base_parser::finish_switch_command(), tree_evaluator::is_logically_true(), tree_statement::line(), base_parser::make_colon_expression(), base_parser::make_fcn_name(), base_parser::make_index_expression(), base_parser::make_indirect_ref(), base_parser::maybe_convert_to_braindead_shortcircuit(), base_parser::maybe_warn_assign_as_truth_value(), base_parser::maybe_warn_variable_switch_label(), tree_breakpoint::take_action(), tree_checker::visit_argument_list(), tree_breakpoint::visit_break_command(), tree_evaluator::visit_break_command(), tree_breakpoint::visit_complex_for_command(), tree_checker::visit_complex_for_command(), tree_evaluator::visit_complex_for_command(), tree_breakpoint::visit_continue_command(), tree_evaluator::visit_continue_command(), tree_breakpoint::visit_decl_command(), tree_evaluator::visit_decl_command(), tree_breakpoint::visit_do_until_command(), tree_evaluator::visit_do_until_command(), tree_evaluator::visit_if_command(), parse_tree_validator::visit_index_expression(), tree_breakpoint::visit_no_op_command(), tree_evaluator::visit_no_op_command(), tree_breakpoint::visit_return_command(), tree_evaluator::visit_return_command(), tree_checker::visit_simple_assignment(), tree_breakpoint::visit_simple_for_command(), tree_checker::visit_simple_for_command(), tree_evaluator::visit_simple_for_command(), tree_breakpoint::visit_switch_command(), tree_evaluator::visit_switch_command(), tree_checker::visit_try_catch_command(), tree_evaluator::visit_try_catch_command(), tree_evaluator::visit_unwind_protect_command(), tree_breakpoint::visit_while_command(), and tree_evaluator::visit_while_command().

◆ lvalue()

◆ lvalue_ok()

virtual bool tree_expression::lvalue_ok ( void  ) const
inlinevirtual

◆ mark_as_for_cmd_expr()

void tree_expression::mark_as_for_cmd_expr ( void  )
inline

Definition at line 110 of file pt-exp.h.

References m_for_cmd_expr.

Referenced by base_parser::make_for_command().

◆ mark_in_parens()

tree_expression* tree_expression::mark_in_parens ( void  )
inline

Definition at line 114 of file pt-exp.h.

References m_num_parens.

◆ meets_bp_condition()

bool tree::meets_bp_condition ( tree_evaluator tw) const
inherited

◆ name()

◆ oper()

virtual std::string tree_expression::oper ( void  ) const
inlinevirtual

◆ operator=()

tree_expression& tree_expression::operator= ( const tree_expression )
delete

◆ original_text()

std::string tree_expression::original_text ( void  ) const
virtual

Reimplemented in tree_constant.

Definition at line 49 of file pt-exp.cc.

◆ paren_count()

int tree_expression::paren_count ( void  ) const
inline

◆ postfix_index()

char tree_expression::postfix_index ( void  ) const
inline

Definition at line 97 of file pt-exp.h.

References m_postfix_index_type.

Referenced by tree_identifier::evaluate_n().

◆ print_result()

◆ rvalue_ok()

◆ set_breakpoint()

virtual void tree::set_breakpoint ( const std::string &  condition)
inlinevirtualinherited

Reimplemented in tree_statement.

Definition at line 74 of file pt.h.

References tree::m_bp_cond.

Referenced by tree_statement::set_breakpoint(), and tree_breakpoint::take_action().

◆ set_location()

void tree::set_location ( int  l,
int  c 
)
inlineinherited

Definition at line 68 of file pt.h.

References tree::m_column_num, and tree::m_line_num.

Referenced by base_parser::finish_array_list(), and tree_statement::set_location().

◆ set_postfix_index()

tree_expression* tree_expression::set_postfix_index ( char  type)
inline

Definition at line 120 of file pt-exp.h.

References m_postfix_index_type.

Referenced by base_parser::make_index_expression(), and base_parser::make_indirect_ref().

◆ set_print_flag()

tree_expression* tree_expression::set_print_flag ( bool  print)
inline

◆ str_print_code()

std::string tree::str_print_code ( void  )
inherited

Definition at line 46 of file pt.cc.

References tree::accept().

Referenced by tree_argument_list::get_arg_names().

Member Data Documentation

◆ m_bp_cond

std::string* tree::m_bp_cond
privateinherited

◆ m_column_num

int tree::m_column_num
privateinherited

Definition at line 120 of file pt.h.

Referenced by tree::column(), and tree::set_location().

◆ m_for_cmd_expr

bool tree_expression::m_for_cmd_expr
protected

Definition at line 161 of file pt-exp.h.

Referenced by is_for_cmd_expr(), and mark_as_for_cmd_expr().

◆ m_line_num

int tree::m_line_num
privateinherited

Definition at line 119 of file pt.h.

Referenced by tree::line(), and tree::set_location().

◆ m_num_parens

int tree_expression::m_num_parens
protected

Definition at line 152 of file pt-exp.h.

Referenced by copy_base(), mark_in_parens(), and paren_count().

◆ m_postfix_index_type

char tree_expression::m_postfix_index_type
protected

Definition at line 157 of file pt-exp.h.

Referenced by copy_base(), is_postfix_indexed(), postfix_index(), and set_postfix_index().

◆ m_print_flag

bool tree_expression::m_print_flag
protected

Definition at line 164 of file pt-exp.h.

Referenced by copy_base(), print_result(), and set_print_flag().


The documentation for this class was generated from the following files: