1 /* 2 * The Doomsday Engine Project -- libcore 3 * 4 * Copyright © 2004-2017 Jaakko Keränen <jaakko.keranen@iki.fi> 5 * 6 * @par License 7 * LGPL: http://www.gnu.org/licenses/lgpl.html 8 * 9 * <small>This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU Lesser General Public License as published by 11 * the Free Software Foundation; either version 3 of the License, or (at your 12 * option) any later version. This program is distributed in the hope that it 13 * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 15 * General Public License for more details. You should have received a copy of 16 * the GNU Lesser General Public License along with this program; if not, see: 17 * http://www.gnu.org/licenses</small> 18 */ 19 20 #ifndef LIBDENG2_OPERATOR_H 21 #define LIBDENG2_OPERATOR_H 22 23 namespace de { 24 25 class String; 26 27 /** 28 * Operators. 29 * 30 * @note These are serialized as is, so don't change the existing values. 31 * 32 * @ingroup script 33 */ 34 enum Operator { 35 NONE = 0, 36 NOT, 37 IN, 38 EQUAL, 39 NOT_EQUAL, 40 LESS, 41 GREATER, 42 LEQUAL, 43 GEQUAL, 44 PLUS, 45 MINUS, 46 MULTIPLY, 47 DIVIDE, 48 MODULO, 49 PLUS_ASSIGN, 50 MINUS_ASSIGN, 51 MULTIPLY_ASSIGN, 52 DIVIDE_ASSIGN, 53 MODULO_ASSIGN, 54 DOT, 55 MEMBER, 56 CALL, 57 ARRAY, 58 DICTIONARY, 59 INDEX, 60 SLICE, 61 PARENTHESIS, 62 AND, 63 OR, 64 RESULT_TRUE, ///< Pop a result, check if it is True. 65 BITWISE_AND, 66 BITWISE_OR, 67 BITWISE_XOR, 68 BITWISE_NOT, 69 }; 70 71 String operatorToText(Operator op); 72 73 bool leftOperandByReference(Operator op); 74 75 bool isUnary(Operator op); 76 77 bool isBinary(Operator op); 78 79 } // namespace de 80 81 #endif /* LIBDENG2_OPERATOR_H */ 82