File indexing completed on 2025-01-19 06:54:53
0001 // instructions.h - definitions low-level instructions emitted by the compiler 0002 // 0003 /* 0004 Copyright 2005-2011 Tomas Mecir <kmuddy@kmuddy.com> 0005 Copyright 2005 Alex Bache <alexbache@ntlworld.com> 0006 0007 This program is free software; you can redistribute it and/or 0008 modify it under the terms of the GNU General Public License as 0009 published by the Free Software Foundation; either version 2 of 0010 the License, or (at your option) any later version. 0011 0012 This program is distributed in the hope that it will be useful, 0013 but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0015 GNU General Public License for more details. 0016 0017 You should have received a copy of the GNU General Public License 0018 along with this program. If not, see <http://www.gnu.org/licenses/>. 0019 */ 0020 0021 #ifndef INSTRUCTIONS_H 0022 #define INSTRUCTIONS_H 0023 0024 #include "cvalue.h" 0025 #include <kmuddy_export.h> 0026 0027 //*************************************************************** 0028 // Class to define a compiled instruction 0029 //*************************************************************** 0030 0031 class KMUDDY_EXPORT instruction 0032 { 0033 public: 0034 enum instruction_type 0035 { 0036 push_value, 0037 push_variable, 0038 and_op, 0039 or_op, 0040 not_op, 0041 greater_than, 0042 greater_or_equal, 0043 less_than, 0044 less_or_equal, 0045 equals, 0046 not_equal, 0047 add, 0048 sub, 0049 mult, 0050 div, 0051 unary_minus, 0052 cast_to_int, 0053 cast_to_double, 0054 cast_to_string, 0055 string_concat, 0056 function_call, 0057 push_func_arg_marker 0058 0059 }; // instruction_type 0060 0061 instruction_type instr; 0062 cValue arg; 0063 0064 }; // instruction 0065 0066 0067 0068 0069 #endif // INSTRUCTIONS_H