pt-cbinop.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2008-2012 Jaroslav Hajek
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_tree_cbinop_h)
00024 #define octave_tree_cbinop_h 1
00025 
00026 #include <string>
00027 
00028 class tree_walker;
00029 
00030 class octave_value;
00031 class octave_value_list;
00032 class octave_lvalue;
00033 
00034 #include "ov.h"
00035 #include "pt-binop.h"
00036 #include "symtab.h"
00037 
00038 // Binary expressions that can be reduced to compound operations
00039 
00040 class
00041 tree_compound_binary_expression : public tree_binary_expression
00042 {
00043 public:
00044 
00045   tree_compound_binary_expression (tree_expression *a, tree_expression *b,
00046                                    int l, int c,
00047                                    octave_value::binary_op t,
00048                                    tree_expression *ca, tree_expression *cb,
00049                                    octave_value::compound_binary_op ct)
00050     : tree_binary_expression (a, b, l, c, t), op_lhs (ca), op_rhs (cb),
00051       etype (ct) { }
00052 
00053   octave_value rvalue1 (int nargout = 1);
00054 
00055   octave_value::compound_binary_op cop_type (void) const { return etype; }
00056 
00057 private:
00058 
00059   tree_expression *op_lhs;
00060   tree_expression *op_rhs;
00061   octave_value::compound_binary_op etype;
00062 
00063   // No copying!
00064 
00065   tree_compound_binary_expression (const tree_compound_binary_expression&);
00066 
00067   tree_compound_binary_expression& operator =
00068     (const tree_compound_binary_expression&);
00069 };
00070 
00071 // a "virtual constructor"
00072 
00073 tree_binary_expression *
00074 maybe_compound_binary_expression (tree_expression *a, tree_expression *b,
00075                                   int l = -1, int c = -1,
00076                                   octave_value::binary_op t
00077                                   = octave_value::unknown_binary_op);
00078 
00079 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines