#ifndef __ops_h
#define __ops_h

#include <math.h>  //fmod
#include "returnValues.h"
/*
typedef enum OPType_e { EQ = 0, NE = 3, GT = 6, LE = 8, AND = 10, OR = 12 } OpType_t;
char OP_strs[] = {"==,!=,>,<,&,|"};

#define str_op        "!~+*-/=&^<>%"


OPERATIONS
----------

Assignment:
x =    lhs assigned to rhs

Logical/Relational:
- !    true if rhs is 0, else false
x ==   is eqal to
x !=   is not equal to
x >    rhs is greater than lhs
- >=   rhs is greater or equal to lhs
x <    lhs is greater then rhs
- <=   lhs is greater or equal to lhs
x &&   lhs and rhs are not equal to zero
x ||   one of lhs or rhs is not equal to zero
 
 
Bitwise:
- ~    bitwise not rhs
x |    lhs or rhs
x &    lhs and rhs
x ^    lhs xor rhs
- <<   lhs shifted left by rhs
- >>   lhs shifted right by lhs
    
- &=   lhs assigned to lhs and with rhs
- |=   lhs assigned to lhs or with rhs
- ^=   lhs assigned to lhs xor with rhs
- >>=  lhs assigned to lhs shifted right by rhs
- <<=  lhs assigned to lhs shifted left by rhs
 
Math:
x +    lhs added to rhs
x -    rhs subtracted from lhs
- *    rhs multiplied by lhs
- /    rhs divided by lhs
- %    remaineder of rhs divided by lhs
- **   lhs to the exponenet of rhs
 
- +=   lhs assigned to lhs plus rhs    
- -=   lhs assigned to lhs minus rhs
- *=   lhs assigned to lhs times rhs
- /=   lhs assigned to lhs divided by rhs
- %=   lhs assigned to remainder of lhs divided by rhs
 
 
 const op const -> result (assigmnet denied)
 var   op const -> result (and lhs if assignment)
 const op var   -> result (assignment denied)
 var   op var   -> result (and lhs if assignment)
 
 
 
*/

// operation numbers
typedef enum OPType_e   { 
 IS = 0,     /* = */
 NE ,        /* != */
 GT ,        /* > */
 GTRE,       /* >= */
 LE ,        /* < */
 LERE,       /* <= */
 AND ,       /* && */
 OR ,        /* || */
 EQXOR ,     /* ^= */
 ADD ,       /* + */
 XOR,        /* ^ */
 EQ,         /* == */
 SUB,        /* - */  
 BOR,        /* | */  
 BAND,       /* & */  
 DIV,        /* / */
 MUL,        /* * */
 EQNOT,      /* =~ */
 MODU,       /* % */
 SHIFTL,     /* << */
 SHIFTR,     /* >> */
 END 
 } OpType_t;

//priorities
typedef enum OPStatus_e { 
 P_IS    = 10, 
 P_NE    = 10, 
 P_GT    = 10, 
 P_GTRE  = 10,
 P_LE    = 10,
 P_LERE  = 10, 
 P_AND   = 20, 
 P_OR    = 20, 
 P_EQXOR = 10, 
 P_ADD   = 30, 
 P_XOR   = 30, 
 P_EQ    = 10,
 P_SUB   = 30,
 P_BOR   = 30,
 P_BAND  = 30,
 P_DIV   = 40,
 P_MUL   = 40,
 P_EQNOT = 10,
 P_MODU  = 40,
 P_SHL   = 40,
 P_SHR   = 40,
 P_END   = 40,
 } OpStatus_t;

Status_t opIassignNotI ( long * result, long * lhs, long * rhs) ;
Status_t opIassignI    ( long * result, long * lhs, long * rhs) ;
Status_t opIeqI        ( long * result, long * lhs, long * rhs) ;
Status_t opIneqI       ( long * result, long * lhs, long * rhs) ;
Status_t opIgtI        ( long * result, long * lhs, long * rhs) ;
Status_t opIlessI      ( long * result, long * lhs, long * rhs) ; 
Status_t opIgteI       ( long * result, long * lhs, long * rhs) ;
Status_t opIlesseI     ( long * result, long * lhs, long * rhs) ; 
Status_t opIandI       ( long * result, long * lhs, long * rhs) ;
Status_t opIorI        ( long * result, long * lhs, long * rhs) ;
Status_t opIaddI       ( long * result, long * lhs, long * rhs) ;
Status_t opIbxorI      ( long * result, long * lhs, long * rhs) ;
Status_t opIsubI       ( long * result, long * lhs, long * rhs) ;
Status_t opIbandI      ( long * result, long * lhs, long * rhs) ;
Status_t opIborI       ( long * result, long * lhs, long * rhs) ;
Status_t opIdivI       ( long * result, long * lhs, long * rhs) ;
Status_t opImulI       ( long * result, long * lhs, long * rhs) ;
Status_t opImoduI      ( long * result, long * lhs, long * rhs) ;
Status_t opIshlI       ( long * result, long * lhs, long * rhs) ;
Status_t opIshrI       ( long * result, long * lhs, long * rhs) ;



Status_t opDandD       ( double * result, double * lhs, double * rhs) ;
Status_t opDorD        ( double * result, double * lhs, double * rhs) ;
Status_t opDassignD    ( double * result, double * lhs, double * rhs) ;
Status_t opDeqD        ( double * result, double * lhs, double * rhs) ;
Status_t opDneqD       ( double * result, double * lhs, double * rhs) ;
Status_t opDgtD        ( double * result, double * lhs, double * rhs) ;
Status_t opDlessD      ( double * result, double * lhs, double * rhs) ; 
Status_t opDgteD       ( double * result, double * lhs, double * rhs) ;
Status_t opDlesseD     ( double * result, double * lhs, double * rhs) ; 
Status_t opDaddD       ( double * result, double * lhs, double * rhs) ;
Status_t opDsubD       ( double * result, double * lhs, double * rhs) ;
Status_t opDdivD       ( double * result, double * lhs, double * rhs) ;
Status_t opDmulD       ( double * result, double * lhs, double * rhs) ;
Status_t opDmoduD      ( double * result, double * lhs, double * rhs) ;

Status_t opResolve(OpType_t * out, char * in ) ;

#endif
