#ifndef __PARSER_H__
#define __PARSER_H__
+/* global variables */
+
+extern double answer;
+
/* function type */
typedef enum {
- Val = 0,
+ Val = 0, Sig,
Add, Sub,
Mul, Div, Mod,
Pow, Sqr,
- Cos, Sin, Atn,
+ Cos, Sin, Atan,
Log, Exp,
- Sig
+ Store, Recall, Disp,
+ Quit, Help,
+ Ans, E, Pi,
+ Equal, Diff, Ge, Le, Gt, Lt,
+ And, Or, Not
} func_t;
/* keyword type */
func_t func;
int nbops;
int offset;
- int prio;
+ float prio;
} keyword_t;
/* calculus element type */
func_t func;
int nbops;
struct _element_t *ops[MAX_OPERANDS];
- float value;
+ double value;
int prio;
} element_t;
/* parser function */
+void delelement (element_t *root);
+
element_t *parser (char *str, char **next, int prio);
void print_element (element_t *root, int level);