X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.h;h=0b9233fa406a25834e6cb93c8acea5cc505f7272;hb=3d3e6770191a1eb48cf66898397a1a6e31b7cb89;hp=156a52648efdfa2df0b82a8e9d2218ac28a059c0;hpb=9e52bbc53676f3ba66a5ddd7c1389f997f890505;p=calc.git diff --git a/parser.h b/parser.h index 156a526..0b9233f 100644 --- 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, Code, Print, + Prog, Call, List, Edit, Del } func_t; /* keyword type */ @@ -41,10 +42,23 @@ typedef struct _element_t { struct _element_t **ops; double value; int prio; + int hidden; + char *string; } element_t; #define ERROR_OP ((element_t *)(-1)) +/* workspace type */ + +typedef struct _workspace_t { + int id; + double answer; + double *storage; + int storage_size; + element_t *root; + char *string; +} workspace_t; + /* parser function */ void delelement (element_t *root); @@ -55,6 +69,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: */