add some coverage tests
[calc.git] / parser.h
index 409b4d43c16d4860c549d3f2af0cf63b2b5560e1..9e4c3f608f18196905f8eca679c70fae004ce369 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -5,6 +5,8 @@
 
 extern double answer;
 
+extern char format[9];
+
 /* function type */
 
 typedef enum {
@@ -12,14 +14,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, Print
 } func_t;
 
 /* keyword type */
@@ -34,11 +37,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;
@@ -55,6 +57,12 @@ 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);
+
 #endif /* __PARSER_H__ */
 
 /* vim: set ts=4 sw=4 et: */