Soft'N'Design Software
/
projects
/
calc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix converage tests
[calc.git]
/
parser.h
diff --git
a/parser.h
b/parser.h
index 9e4c3f608f18196905f8eca679c70fae004ce369..0b9233fa406a25834e6cb93c8acea5cc505f7272 100644
(file)
--- a/
parser.h
+++ b/
parser.h
@@
-5,8
+5,6
@@
extern double answer;
extern double answer;
-extern char format[9];
-
/* function type */
typedef enum {
/* function type */
typedef enum {
@@
-17,12
+15,13
@@
typedef enum {
Cos, Sin, Tan, Acos, Asin, Atan,
Log, Exp,
Abs, Ceil, Floor,
Cos, Sin, Tan, Acos, Asin, Atan,
Log, Exp,
Abs, Ceil, Floor,
- Store, Recall, Inc, Dec, Disp,
+ Store, Recall, Inc, Dec, Disp,
Mem, Clear,
Quit, Help,
Ans, E, Pi,
Equal, Diff, Ge, Le, Gt, Lt,
And, Or, Not,
Quit, Help,
Ans, E, Pi,
Equal, Diff, Ge, Le, Gt, Lt,
And, Or, Not,
- Cond, While, Prog, Print
+ Cond, While, Code, Print,
+ Prog, Call, List, Edit, Del
} func_t;
/* keyword type */
} func_t;
/* keyword type */
@@
-43,10
+42,23
@@
typedef struct _element_t {
struct _element_t **ops;
double value;
int prio;
struct _element_t **ops;
double value;
int prio;
+ int hidden;
+ char *string;
} element_t;
#define ERROR_OP ((element_t *)(-1))
} element_t;
#define ERROR_OP ((element_t *)(-1))
+/* workspace type */
+
+typedef struct _workspace_t {
+ int id;
+ double answer;
+ double *storage;
+ int storage_size;
+ element_t *root;
+ char *string;
+} workspace_t;
+
/* parser function */
void delelement (element_t *root);
/* parser function */
void delelement (element_t *root);
@@
-63,6
+75,14
@@
char **generate_completion_list ();
void free_completion_list (char **list);
void free_completion_list (char **list);
+/* print function */
+
+void set_format (char *prompt, int precision);
+
+void free_format ();
+
+double print (double value);
+
#endif /* __PARSER_H__ */
/* vim: set ts=4 sw=4 et: */
#endif /* __PARSER_H__ */
/* vim: set ts=4 sw=4 et: */