comparison src/expr.h @ 76:2fe5fd7d65a3

Checkpointing object target implementation
author lost
date Thu, 08 Jan 2009 02:57:24 +0000
parents d5fe306f1ab1
children 718998b673ee
comparison
equal deleted inserted replaced
75:92eb93bffa28 76:2fe5fd7d65a3
95 value which will be a constant. Otherwise, the stack will contain the 95 value which will be a constant. Otherwise, the stack will contain the
96 expression with all operations that can be evaluated completely evaluated. 96 expression with all operations that can be evaluated completely evaluated.
97 You must call lwasm_expr_stack_free() on the result when you are finished 97 You must call lwasm_expr_stack_free() on the result when you are finished
98 with it. 98 with it.
99 */ 99 */
100 __expr_E__ lwasm_expr_stack_t *lwasm_expr_eval(const char *inp, const char **outp, int (*sfunc)(char *sym, void *state, int *val), void *state); 100 __expr_E__ lwasm_expr_stack_t *lwasm_expr_eval(const char *inp, const char **outp, lwasm_expr_stack_t *(*sfunc)(char *sym, void *state), void *state);
101 101
102 // simplify expression 102 // simplify expression
103 __expr_E__ int lwasm_expr_reval(lwasm_expr_stack_t *s, int (*sfunc)(char *sym, void *state, int *val), void *state); 103 __expr_E__ int lwasm_expr_reval(lwasm_expr_stack_t *s, lwasm_expr_stack_t *(*sfunc)(char *sym, void *state), void *state);
104 104
105 // useful macros 105 // useful macros
106 // is the expression "simple" (one term)? 106 // is the expression "simple" (one term)?
107 #define lwasm_expr_is_simple(s) ((s) -> head == (s) -> tail) 107 #define lwasm_expr_is_simple(s) ((s) -> head == (s) -> tail)
108 108