1 ////////////////////////////////////////////////////////////////////////////// 2 // This file is part of Teyjus. // 3 // // 4 // Teyjus is free software: you can redistribute it and/or modify // 5 // it under the terms of the GNU General Public License as published by // 6 // the Free Software Foundation, either version 3 of the License, or // 7 // (at your option) any later version. // 8 // // 9 // Teyjus is distributed in the hope that it will be useful, // 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 12 // GNU General Public License for more details. // 13 // // 14 // You should have received a copy of the GNU General Public License // 15 // along with Teyjus. If not, see <http://www.gnu.org/licenses/>. // 16 ////////////////////////////////////////////////////////////////////////////// 17 #ifndef OP_H 18 #define OP_H 19 20 //fixity type 21 typedef enum { 22 OP_INFIX, OP_INFIXL, OP_INFIXR, OP_PREFIX, OP_PREFIXR, OP_POSTFIX, 23 OP_POSTFIXL, OP_NONE 24 } OP_Fixity; 25 26 typedef enum { 27 OP_PREC, OP_PREC_NAME 28 } OP_PrecTypeCat; 29 30 //precedence type 31 typedef struct 32 { 33 OP_PrecTypeCat cat; 34 union 35 { 36 int prec; 37 char* name; 38 } data; 39 } OP_Prec; 40 41 OP_Prec OP_mkPrecMin1(); 42 OP_Prec OP_mkPrecMin2(); 43 OP_Prec OP_mkPrec(int prec); 44 OP_Prec OP_mkPrecMax(); 45 46 int OP_precIsMax(OP_Prec prec); 47 48 49 //code info type 50 typedef int OP_Code; 51 52 OP_Code OP_mkCodeInfoNone(); 53 OP_Code OP_mkCodeInfo(int ind); 54 55 int OP_codeInfoIsNone(OP_Code code); 56 57 #endif 58 59