X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.h;h=27bc1e1843c2fc9f4fbd027de38a3d59b5fe39bc;hb=c22798f02269ad4ee36c8f01c76f078ba8908bfa;hp=b48f6d004491d09494ecd158e2d7ca2db94a4333;hpb=b9c1c40d714a293c6cbee5063b5e00de8ccacbe8;p=calc.git diff --git a/parser.h b/parser.h index b48f6d0..27bc1e1 100644 --- a/parser.h +++ b/parser.h @@ -13,14 +13,18 @@ typedef enum { Mul, Div, Mod, Pow, Sqr, Cos, Sin, Tan, Acos, Asin, Atan, - Log, Exp, + Ln, Log, Exp, + Erfc, Erf, 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, Arg, Call, List, Edit, Del, + Get, Length, Pop, Push, Put, Set, Show, + Max, Mean, Median, Min, Order, Prod, Sum, Variance } func_t; /* keyword type */ @@ -41,10 +45,27 @@ 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; + double *argument; + int argument_size; + element_t *root; + double *stack; + int stack_size; + char *string; +} workspace_t; + /* parser function */ void delelement (element_t *root); @@ -61,6 +82,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: */