"Fossies" - the Fresh Open Source Software Archive

Member "ivtools-ivtools-2.0.4/src/ComTerp/assignfunc.h" (9 Oct 2020, 3816 Bytes) of package /linux/misc/ivtools-ivtools-2.0.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "assignfunc.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 1997,1999 Vectaport Inc.
    3  *
    4  * Permission to use, copy, modify, distribute, and sell this software and
    5  * its documentation for any purpose is hereby granted without fee, provided
    6  * that the above copyright notice appear in all copies and that both that
    7  * copyright notice and this permission notice appear in supporting
    8  * documentation, and that the names of the copyright holders not be used in
    9  * advertising or publicity pertaining to distribution of the software
   10  * without specific, written prior permission.  The copyright holders make
   11  * no representations about the suitability of this software for any purpose.
   12  * It is provided "as is" without express or implied warranty.
   13  *
   14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
   15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
   16  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
   17  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
   18  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
   19  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
   20  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   21  * 
   22  */
   23 
   24 #if !defined(_assignfunc_h)
   25 #define _assignfunc_h
   26 
   27 #include <ComTerp/numfunc.h>
   28 
   29 class ComTerp;
   30 class ComValue;
   31 
   32 //: = (assign) operator.
   33 class AssignFunc : public ComFunc {
   34 public:
   35     AssignFunc(ComTerp*);
   36 
   37     virtual boolean post_eval() { return true; }
   38     virtual void execute();
   39     virtual const char* docstring() { 
   40       return "= is the assignment operator"; }
   41 
   42     CLASS_SYMID("AssignFunc");
   43 };
   44 
   45 //: %= (mod assign) operator .
   46 class ModAssignFunc : public AssignFunc {
   47 public:
   48     ModAssignFunc(ComTerp*);
   49 
   50     virtual void execute();
   51     virtual const char* docstring() { 
   52       return "\%= is the mod assignment operator"; }
   53 };
   54 
   55 //: *= (multiply assign) operator .
   56 class MpyAssignFunc : public AssignFunc {
   57 public:
   58     MpyAssignFunc(ComTerp*);
   59 
   60     virtual void execute();
   61     virtual const char* docstring() { 
   62       return "*= is the multiply assignment operator"; }
   63 };
   64 
   65 //: *= (add assign) operator .
   66 class AddAssignFunc : public AssignFunc {
   67 public:
   68     AddAssignFunc(ComTerp*);
   69 
   70     virtual void execute();
   71     virtual const char* docstring() { 
   72       return "+= is the add assignment operator"; }
   73 };
   74 
   75 //: += (subtract assign) operator .
   76 class SubAssignFunc : public AssignFunc {
   77 public:
   78     SubAssignFunc(ComTerp*);
   79 
   80     virtual void execute();
   81     virtual const char* docstring() { 
   82       return "-= is the minus assignment operator"; }
   83 };
   84 
   85 //: /= (divide assign) operator .
   86 class DivAssignFunc : public AssignFunc {
   87 public:
   88     DivAssignFunc(ComTerp*);
   89 
   90     virtual void execute();
   91     virtual const char* docstring() { 
   92       return "/= is the division assignment operator"; }
   93 };
   94 
   95 //: ++(increment before) operator.
   96 class IncrFunc : public AssignFunc {
   97 public:
   98     IncrFunc(ComTerp*);
   99 
  100     virtual void execute();
  101     virtual const char* docstring() { 
  102       return "++ is the increment-before operator (prefix) and the "; }
  103 };
  104 
  105 //: (increment after)++  operator.
  106 class IncrAfterFunc : public AssignFunc {
  107 public:
  108     IncrAfterFunc(ComTerp*);
  109 
  110     virtual void execute();
  111     virtual const char* docstring() { 
  112       return "increment-after as well (postfix)"; }
  113 };
  114 
  115 //: --(decrement before)  operator.
  116 class DecrFunc : public AssignFunc {
  117 public:
  118     DecrFunc(ComTerp*);
  119 
  120     virtual void execute();
  121     virtual const char* docstring() { 
  122       return "-- is the decrement-before operator (prefix) and the "; }
  123 };
  124 
  125 //: (decrement after)--  operator.
  126 class DecrAfterFunc : public AssignFunc {
  127 public:
  128     DecrAfterFunc(ComTerp*);
  129 
  130     virtual void execute();
  131     virtual const char* docstring() { 
  132       return "decrement-after as well (postfix)"; }
  133 };
  134 
  135 #endif /* !defined(_assignfunc_h) */