GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-cbinop.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2008-2018 Jaroslav Hajek
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_pt_cbinop_h)
24 #define octave_pt_cbinop_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 class octave_value;
31 class octave_value_list;
32 
33 #include "ov.h"
34 #include "pt-binop.h"
35 #include "pt-walk.h"
36 
37 namespace octave
38 {
39  // Binary expressions that can be reduced to compound operations
40 
42  {
43  public:
44 
46  int l, int c,
50  : tree_binary_expression (a, b, l, c, t), m_lhs (ca), m_rhs (cb),
51  m_etype (ct)
52  { }
53 
55 
56  bool rvalue_ok (void) const { return true; }
57 
58  tree_expression * clhs (void) { return m_lhs; }
59  tree_expression * crhs (void) { return m_rhs; }
60 
61  void accept (tree_walker& tw)
62  {
64  }
65 
66  private:
67 
70 
72 
73  // No copying!
74 
76 
78  (const tree_compound_binary_expression&) = delete;
79  };
80 
81  // a "virtual constructor"
82 
85  int l = -1, int c = -1,
88 }
89 
90 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
91 
92 OCTAVE_DEPRECATED (4.4, "use 'octave::tree_compound_binary_expression' instead")
93 typedef octave::tree_compound_binary_expression tree_compound_binary_expression;
94 
95 #endif
96 
97 #endif
binary_op
Definition: ov.h:94
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
tree_compound_binary_expression(tree_expression *a, tree_expression *b, int l, int c, octave_value::binary_op t, tree_expression *ca, tree_expression *cb, octave_value::compound_binary_op ct)
Definition: pt-cbinop.h:45
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
tree_binary_expression * maybe_compound_binary_expression(tree_expression *a, tree_expression *b, int l, int c, octave_value::binary_op t)
Definition: pt-cbinop.cc:174
virtual void visit_compound_binary_expression(tree_compound_binary_expression &expr)
Definition: pt-walk.cc:40
tree_expression * clhs(void)
Definition: pt-cbinop.h:58
octave_value::compound_binary_op cop_type(void) const
Definition: pt-cbinop.h:54
tree_expression * crhs(void)
Definition: pt-cbinop.h:59
compound_binary_op
Definition: ov.h:119
b
Definition: cellfun.cc:400
octave_value::compound_binary_op m_etype
Definition: pt-cbinop.h:71