very partial program functions
[calc.git] / parser.h
index b48f6d004491d09494ecd158e2d7ca2db94a4333..4907c67699a74dc69f5655065e5165df7ae8b072 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -15,12 +15,13 @@ typedef enum {
     Cos, Sin, Tan, Acos, Asin, Atan,
     Log, Exp,
     Abs, Ceil, Floor,
-    Store, Recall, Inc, Dec, Disp,
+    Store, Recall, Inc, Dec, Disp, Mem, Clear,
     Quit, Help,
     Ans, E, Pi,
     Equal, Diff, Ge, Le, Gt, Lt,
     And, Or, Not,
-    Cond, While, Prog
+    Cond, While, Prog, Print,
+    Prog, Call, List, Edit, Del
 } func_t;
 
 /* keyword type */
@@ -41,10 +42,20 @@ typedef struct _element_t {
     struct _element_t **ops;
     double value;
     int prio;
+    int hidden;
 } element_t;
 
 #define ERROR_OP ((element_t *)(-1))
 
+/* workspace type */
+
+typedef struct _workspace_t {
+    int id;
+    double answer;
+    double *storage;
+    element_t *root;
+} workspace_t;
+
 /* parser function */
 
 void delelement (element_t *root);
@@ -61,6 +72,14 @@ 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: */