clear feature
[calc.git] / parser.h
index 95bfa2fa4715510b3e2789a14f22d0098ae12994..2e3e6d464c6ffba87fab1c90f62ce41f5f9bf453 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -12,11 +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, Mem, Clear,
     Quit, Help,
-    Ans, E, Pi
+    Ans, E, Pi,
+    Equal, Diff, Ge, Le, Gt, Lt,
+    And, Or, Not,
+    Cond, While, Prog, Print
 } func_t;
 
 /* keyword type */
@@ -26,18 +30,18 @@ typedef struct _keyword_t {
     func_t func;
     int nbops;
     int offset;
-    int prio;
+    float prio;
 } 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;
+    int hidden;
 } element_t;
 
 #define ERROR_OP ((element_t *)(-1))
@@ -52,6 +56,20 @@ void print_element (element_t *root, int level);
 
 double evaluate_element (element_t *root, char mask);
 
+/* completion functions */
+
+char **generate_completion_list ();
+
+void free_completion_list (char **list);
+
+/* print function */
+
+void set_format (char *prompt, int precision);
+
+void free_format ();
+
+double print (double value);
+
 #endif /* __PARSER_H__ */
 
 /* vim: set ts=4 sw=4 et: */