GNU Octave  9.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:
tree tree_anon_fcn_handle tree_array_list tree_binary_expression tree_colon_expression tree_constant tree_fcn_handle tree_identifier tree_index_expression tree_metaclass_query tree_multi_assignment tree_simple_assignment tree_superclass_ref tree_unary_expression

Public Member Functions

 tree_expression (int l=-1, int c=-1)
 
virtual ~tree_expression ()=default
 
virtual void copy_base (const tree_expression &e)
 
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
 
virtual bool is_assignment_expression () const
 
virtual bool is_binary_expression () const
 
virtual bool is_boolean_expression () const
 
virtual bool is_colon_expression () const
 
virtual bool is_constant () const
 
bool is_for_cmd_expr () const
 
virtual bool is_identifier () const
 
virtual bool is_index_expression () const
 
virtual bool is_matrix () const
 
bool is_postfix_indexed () const
 
virtual bool is_prefix_expression () const
 
virtual bool is_unary_expression () const
 
virtual bool iscell () const
 
virtual octave_lvalue lvalue (tree_evaluator &)
 
virtual bool lvalue_ok () const
 
void mark_as_for_cmd_expr ()
 
tree_expressionmark_in_parens ()
 
virtual std::string name () const
 
virtual std::string oper () const
 
virtual std::string original_text () const
 
int paren_count () const
 
char postfix_index () const
 
bool print_result () const
 
virtual bool rvalue_ok () const
 
tree_expressionset_postfix_index (char type)
 
tree_expressionset_print_flag (bool print)
 
- Public Member Functions inherited from tree
 tree (int l=-1, int c=-1)
 
virtual ~tree ()=default
 
virtual void accept (tree_walker &tw)=0
 
const std::string bp_cond () const
 
virtual int column () const
 
void column (int c)
 
virtual void delete_breakpoint ()
 
bool is_active_breakpoint (tree_evaluator &tw) const
 
bool is_breakpoint () const
 
virtual int line () const
 
void line (int l)
 
bool meets_bp_condition (tree_evaluator &tw) const
 
virtual void set_breakpoint (const std::string &condition)
 
void set_location (int l, int c)
 
std::string str_print_code ()
 

Protected Attributes

bool m_for_cmd_expr
 
int m_num_parens
 
char m_postfix_index_type
 
bool m_print_flag
 

Detailed Description

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

Constructor & Destructor Documentation

◆ tree_expression()

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

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

◆ ~tree_expression()

virtual tree_expression::~tree_expression ( )
virtualdefault

Member Function Documentation

◆ copy_base()

◆ dup()

◆ evaluate()

◆ evaluate_n()

◆ is_assignment_expression()

virtual bool tree_expression::is_assignment_expression ( ) const
inlinevirtual

◆ is_binary_expression()

virtual bool tree_expression::is_binary_expression ( ) const
inlinevirtual

Reimplemented in tree_binary_expression.

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

Referenced by base_parser::maybe_convert_to_braindead_shortcircuit().

◆ is_boolean_expression()

virtual bool tree_expression::is_boolean_expression ( ) const
inlinevirtual

Reimplemented in tree_boolean_expression.

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

◆ is_colon_expression()

virtual bool tree_expression::is_colon_expression ( ) const
inlinevirtual

Reimplemented in tree_colon_expression.

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

◆ is_constant()

virtual bool tree_expression::is_constant ( ) const
inlinevirtual

◆ is_for_cmd_expr()

bool tree_expression::is_for_cmd_expr ( ) const
inline

Definition at line 108 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 ( ) const
inlinevirtual

◆ is_matrix()

virtual bool tree_expression::is_matrix ( ) const
inlinevirtual

Reimplemented in tree_matrix.

Definition at line 62 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 ( ) const
inline

◆ is_prefix_expression()

virtual bool tree_expression::is_prefix_expression ( ) const
inlinevirtual

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

◆ is_unary_expression()

virtual bool tree_expression::is_unary_expression ( ) const
inlinevirtual

Reimplemented in tree_unary_expression.

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

◆ iscell()

virtual bool tree_expression::iscell ( void  ) const
inlinevirtual

Reimplemented in tree_cell.

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

◆ lvalue()

◆ lvalue_ok()

virtual bool tree_expression::lvalue_ok ( ) const
inlinevirtual

◆ mark_as_for_cmd_expr()

void tree_expression::mark_as_for_cmd_expr ( )
inline

Definition at line 106 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 ( )
inline

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

References m_num_parens.

◆ name()

◆ oper()

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

◆ original_text()

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

Reimplemented in tree_constant.

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

◆ paren_count()

int tree_expression::paren_count ( ) const
inline

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

References m_num_parens.

Referenced by tree_print_code::visit_index_expression().

◆ postfix_index()

char tree_expression::postfix_index ( ) const
inline

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

References m_postfix_index_type.

Referenced by tree_identifier::evaluate_n().

◆ print_result()

◆ rvalue_ok()

◆ set_postfix_index()

tree_expression* tree_expression::set_postfix_index ( char  type)
inline

Definition at line 116 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

Member Data Documentation

◆ m_for_cmd_expr

bool tree_expression::m_for_cmd_expr
protected

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

Referenced by is_for_cmd_expr(), and mark_as_for_cmd_expr().

◆ m_num_parens

int tree_expression::m_num_parens
protected

Definition at line 148 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 153 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 160 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: