GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
tree_constant Class Reference

#include "pt-const.h"

Inheritance diagram for tree_constant:
tree_expression tree

Public Member Functions

 tree_constant (const octave_value &v, const std::string &ot, int l=-1, int c=-1)
 
 tree_constant (const octave_value &v, int l=-1, int c=-1)
 
 tree_constant (int l=-1, int c=-1)
 
 ~tree_constant ()=default
 
void accept (tree_walker &tw)
 
tree_expressiondup (symbol_scope &scope) const
 
octave_value evaluate (tree_evaluator &, int nargout=1)
 
octave_value_list evaluate_n (tree_evaluator &tw, int nargout=1)
 
bool is_constant () const
 
void maybe_mutate ()
 
std::string original_text () const
 
void print (std::ostream &os, bool pr_as_read_syntax=false, bool pr_orig_txt=true)
 
void print_raw (std::ostream &os, bool pr_as_read_syntax=false, bool pr_orig_txt=true)
 
bool rvalue_ok () const
 
void stash_original_text (const std::string &s)
 
octave_value value ()
 
- Public Member Functions inherited from tree_expression
 tree_expression (int l=-1, int c=-1)
 
virtual ~tree_expression ()=default
 
virtual void copy_base (const tree_expression &e)
 
virtual bool is_assignment_expression () const
 
virtual bool is_binary_expression () const
 
virtual bool is_boolean_expression () const
 
virtual bool is_colon_expression () 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
 
int paren_count () const
 
char postfix_index () const
 
bool print_result () 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
 
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 ()
 

Additional Inherited Members

- Protected Attributes inherited from tree_expression
bool m_for_cmd_expr
 
int m_num_parens
 
char m_postfix_index_type
 
bool m_print_flag
 

Detailed Description

Definition at line 47 of file pt-const.h.

Constructor & Destructor Documentation

◆ tree_constant() [1/3]

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

Definition at line 51 of file pt-const.h.

Referenced by dup().

◆ tree_constant() [2/3]

tree_constant::tree_constant ( const octave_value v,
int  l = -1,
int  c = -1 
)
inline

Definition at line 55 of file pt-const.h.

◆ tree_constant() [3/3]

tree_constant::tree_constant ( const octave_value v,
const std::string &  ot,
int  l = -1,
int  c = -1 
)
inline

Definition at line 59 of file pt-const.h.

◆ ~tree_constant()

tree_constant::~tree_constant ( )
default

Member Function Documentation

◆ accept()

void tree_constant::accept ( tree_walker tw)
inlinevirtual

Implements tree.

Definition at line 86 of file pt-const.h.

References tree_walker::visit_constant().

◆ dup()

tree_expression * tree_constant::dup ( symbol_scope scope) const
virtual

Implements tree_expression.

Definition at line 64 of file pt-const.cc.

References tree_constant(), tree::column(), and tree_expression::copy_base().

◆ evaluate()

octave_value tree_constant::evaluate ( tree_evaluator ,
int  nargout = 1 
)
inlinevirtual

Implements tree_expression.

Definition at line 98 of file pt-const.h.

References error(), and value().

Referenced by evaluate_n().

◆ evaluate_n()

octave_value_list tree_constant::evaluate_n ( tree_evaluator tw,
int  nargout = 1 
)
inlinevirtual

Implements tree_expression.

Definition at line 106 of file pt-const.h.

References evaluate(), and ovl().

◆ is_constant()

bool tree_constant::is_constant ( ) const
inlinevirtual

Reimplemented from tree_expression.

Definition at line 70 of file pt-const.h.

◆ maybe_mutate()

void tree_constant::maybe_mutate ( void  )
inline

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

References octave_value::maybe_mutate().

◆ original_text()

std::string tree_constant::original_text ( ) const
inlinevirtual

Reimplemented from tree_expression.

Definition at line 96 of file pt-const.h.

◆ print()

void tree_constant::print ( std::ostream &  os,
bool  pr_as_read_syntax = false,
bool  pr_orig_txt = true 
)

Definition at line 44 of file pt-const.cc.

References octave_value::print().

◆ print_raw()

void tree_constant::print_raw ( std::ostream &  os,
bool  pr_as_read_syntax = false,
bool  pr_orig_txt = true 
)

Definition at line 54 of file pt-const.cc.

References octave_value::print_raw().

Referenced by tree_print_code::visit_constant().

◆ rvalue_ok()

bool tree_constant::rvalue_ok ( ) const
inlinevirtual

Reimplemented from tree_expression.

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

◆ stash_original_text()

void tree_constant::stash_original_text ( const std::string &  s)
inline

◆ value()

octave_value tree_constant::value ( )
inline

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

Referenced by evaluate().


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