add Fibonacci sequence
[calc.git] / parser.h
index 619ebac68b87c2b8a9f447d60608ffa7218fae0b..734d818f173f4bc1a1ca39ac01de405c804df77a 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 {
@@ -10,8 +14,12 @@ typedef enum {
     Pow, Sqr,
     Cos, Sin, Atan,
     Log, Exp,
+    Store, Recall, Inc, Dec, Disp,
     Quit, Help,
-    E, Pi
+    Ans, E, Pi,
+    Equal, Diff, Ge, Le, Gt, Lt,
+    And, Or, Not,
+    Cond, While, Prog
 } func_t;
 
 /* keyword type */
@@ -21,16 +29,15 @@ typedef struct _keyword_t {
     func_t func;
     int nbops;
     int offset;
-    int prio;
+    float 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];
+    struct _element_t **ops;
     double value;
     int prio;
 } element_t;