X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=parser.h;h=9ce4fd098695f8b0b3f497a82eec664ed375ec66;hb=e2a309f921968691af1566000dd694f191eca857;hp=90dba49323fe032e7cfd7ce184d2d174a964bbdc;hpb=031d7bba7849b5b5ec7d1110f830175cc3b65b44;p=calc.git diff --git a/parser.h b/parser.h index 90dba49..9ce4fd0 100644 --- a/parser.h +++ b/parser.h @@ -1,40 +1,17 @@ #ifndef __PARSER_H__ #define __PARSER_H__ -/* function type */ - -typedef enum { - Val = 0, Sig, - Add, Sub, - Mul, Div, Mod, - Pow, Sqr, - Cos, Sin, Atn, - Log, Exp, - Qui, Hel -} func_t; - -/* keyword type */ - -typedef struct _keyword_t { - char *keyword; - func_t func; - int nbops; - int offset; - int prio; -} keyword_t; - -/* calculus element type */ - -#define MAX_OPERANDS 10 -typedef struct _element_t { - func_t func; - int nbops; - struct _element_t *ops[MAX_OPERANDS]; - float value; - int prio; -} element_t; - -#define ERROR_OP ((element_t *)(-1)) +#include "element.h" + +/* global variables */ + +extern double answer; + +/* completion functions */ + +char **generate_completion_list (); + +void free_completion_list (char **list); /* parser function */