fix error managment
[calc.git] / parser.h
index 90dba49323fe032e7cfd7ce184d2d174a964bbdc..80fbd984ca68fe213910df0496f3a7d112908f74 100644 (file)
--- a/parser.h
+++ b/parser.h
@@ -1,6 +1,10 @@
 #ifndef __PARSER_H__
 #define __PARSER_H__
 
+/* global variables */
+
+extern double answer;
+
 /* function type */
 
 typedef enum {
@@ -8,9 +12,13 @@ typedef enum {
     Add, Sub,
     Mul, Div, Mod,
     Pow, Sqr,
-    Cos, Sin, Atn,
+    Cos, Sin, Atan,
     Log, Exp,
-    Qui, Hel
+    Store, Recall, Disp,
+    Quit, Help,
+    Ans, E, Pi,
+    Equal, Diff, Ge, Le, Gt, Lt,
+    And, Or, Not
 } func_t;
 
 /* keyword type */
@@ -20,7 +28,7 @@ typedef struct _keyword_t {
     func_t func;
     int nbops;
     int offset;
-    int prio;
+    float prio;
 } keyword_t;
 
 /* calculus element type */
@@ -30,7 +38,7 @@ typedef struct _element_t {
     func_t func;
     int nbops;
     struct _element_t *ops[MAX_OPERANDS];
-    float value;
+    double value;
     int prio;
 } element_t;