From 83b321d862472f31c0c9f7feca8360ad5bfe8a75 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 31 Jul 2012 15:16:04 +0000 Subject: An initial import of the teyjus source code in the C runtime for GF. The two runtime are still not connected but the source code compiles. --- src/runtime/c/teyjus/system/operators.h | 91 +++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/runtime/c/teyjus/system/operators.h (limited to 'src/runtime/c/teyjus/system/operators.h') diff --git a/src/runtime/c/teyjus/system/operators.h b/src/runtime/c/teyjus/system/operators.h new file mode 100644 index 000000000..9f016ef5b --- /dev/null +++ b/src/runtime/c/teyjus/system/operators.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +//Copyright 2008 +// Andrew Gacek, Steven Holte, Gopalan Nadathur, Xiaochu Qi, Zach Snow +////////////////////////////////////////////////////////////////////////////// +// This file is part of Teyjus. // +// // +// Teyjus is free software: you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation, either version 3 of the License, or // +// (at your option) any later version. // +// // +// Teyjus is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with Teyjus. If not, see . // +////////////////////////////////////////////////////////////////////////////// +#ifndef OPERATORS_H +#define OPERATORS_H + +//#include + +/* Fixity types */ +typedef enum +{ + OP_INFIX = 0, + OP_INFIXL = 1, + OP_INFIXR = 2, + OP_NONE = 3, + OP_PREFIX = 4, + OP_PREFIXR = 5, + OP_POSTFIX = 6, + OP_POSTFIXL = 7 +} OP_FixityType; + + +typedef enum { + OP_WHOLE_TERM, + OP_LEFT_TERM, + OP_RIGHT_TERM +} OP_TermContext; + +#define OP_MAXPREC 255 +#define OP_MINPREC 0 + +#define OP_LAM_FIXITY OP_PREFIXR +#define OP_LAM_PREC -1 + +#define OP_APP_FIXITY OP_INFIXL +#define OP_APP_PREC 257 + +//usful ? +/* +#define OP_CCOMMA_FIXITY OP_infixr +#define OP_CCOMMA_PREC -2 + + + + + +#define OP_LT_FIXITY OP_infix +#define OP_LT_PREC 130 + +#define OP_LE_FIXITY OP_infix +#define OP_LE_PREC 130 + +#define OP_GT_FIXITY OP_infix +#define OP_GT_PREC 130 + +#define OP_GE_FIXITY OP_infix +#define OP_GE_PREC 130 + +#define OP_UM_FIXITY OP_prefix +#define OP_UM_PREC 256 //? + +#define OP_PLUS_FIXITY OP_infixl +#define OP_PLUS_PREC 150 + +#define OP_MINUS_FIXITY OP_infixl +#define OP_MINUS_PREC 150 + +#define OP_TIMES_FIXITY OP_infixl +#define OP_TIMES_PREC 160 + +#define OP_COMMA_FIXITY OP_infixl +#define OP_COMMA_PREC 110 +*/ + +#endif // OPERATORS_H -- cgit v1.2.3