X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.h;h=9ce4fd098695f8b0b3f497a82eec664ed375ec66;hb=e2a309f921968691af1566000dd694f191eca857;hp=734d818f173f4bc1a1ca39ac01de405c804df77a;hpb=124da7fdcc2dabecd99034d31e9cd32bea0e9da9;p=calc.git diff --git a/parser.h b/parser.h index 734d818..9ce4fd0 100644 --- a/parser.h +++ b/parser.h @@ -1,48 +1,17 @@ #ifndef __PARSER_H__ #define __PARSER_H__ +#include "element.h" + /* global variables */ extern double answer; -/* function type */ - -typedef enum { - Val = 0, Sig, - Add, Sub, - Mul, Div, Mod, - Pow, Sqr, - Cos, Sin, Atan, - Log, Exp, - Store, Recall, Inc, Dec, Disp, - Quit, Help, - Ans, E, Pi, - Equal, Diff, Ge, Le, Gt, Lt, - And, Or, Not, - Cond, While, Prog -} func_t; - -/* keyword type */ - -typedef struct _keyword_t { - char *keyword; - func_t func; - int nbops; - int offset; - float prio; -} keyword_t; - -/* calculus element type */ - -typedef struct _element_t { - func_t func; - int nbops; - struct _element_t **ops; - double value; - int prio; -} element_t; - -#define ERROR_OP ((element_t *)(-1)) +/* completion functions */ + +char **generate_completion_list (); + +void free_completion_list (char **list); /* parser function */