add tan, acos, asin, abs, ceil and floor functions
[calc.git] / parser.h
index 409b4d43c16d4860c549d3f2af0cf63b2b5560e1..156a52648efdfa2df0b82a8e9d2218ac28a059c0 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -12,14 +12,15 @@ typedef enum {
     Add, Sub,
     Mul, Div, Mod,
     Pow, Sqr,
-    Cos, Sin, Atan,
+    Cos, Sin, Tan, Acos, Asin, Atan,
     Log, Exp,
-    Store, Recall, Disp,
+    Abs, Ceil, Floor,
+    Store, Recall, Inc, Dec, Disp,
     Quit, Help,
     Ans, E, Pi,
     Equal, Diff, Ge, Le, Gt, Lt,
     And, Or, Not,
-    Cond
+    Cond, While, Prog
 } func_t;
 
 /* keyword type */
@@ -34,11 +35,10 @@ typedef struct _keyword_t {
 
 /* calculus element type */
 
-#define MAX_OPERANDS 10
 typedef struct _element_t {
     func_t func;
     int nbops;
-    struct _element_t *ops[MAX_OPERANDS];
+    struct _element_t **ops;
     double value;
     int prio;
 } element_t;