diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2018-01-29 20:19:22 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2018-01-29 20:19:22 -0500 |
commit | b9ceb80c9caa2a4a1659615991e7daa0b1d9fb66 (patch) | |
tree | bc0720404a935018c75524555d90a320512398c6 /parser.h | |
parent | accef5f54c0a38b0de3c2dddbaf7b30c6d226541 (diff) |
rewrite; a lot better now
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -3,29 +3,32 @@ #include <variable.h> -typedef void *stack_t; +typedef variable *stack_t; typedef struct { - uint16_t status; - uint16_t vcount; variable *vars; - char **names; + char **vnames; stack_t *stack; + uint32_t stidx; } interpreter; -enum status { - READY = 0 -}; +typedef void (*func_t)(interpreter *); -typedef void (*func_t)(stack_t *); +void iinit(interpreter *); -void interpreter_init(interpreter *); +void inew_string(interpreter *, const char *, char *); +void inew_integer(interpreter *, const char *, int32_t); +void inew_float(interpreter *, const char *, float); +void inew_cfunc(interpreter *, const char *, func_t); -void interpreter_define_value(interpreter *, const char *, int32_t); -void interpreter_define_cfunc(interpreter *, const char *, func_t); +int idoline(interpreter *, const char *); -int32_t interpreter_get_value(interpreter *, const char *); +char *igetarg_string(interpreter *, uint32_t); +int igetarg_integer(interpreter *, uint32_t); +float igetarg_float(interpreter *, uint32_t); -int interpreter_doline(interpreter *, const char *); +char *iget_string(interpreter *, const char *); +int iget_integer(interpreter *, const char *); +float iget_float(interpreter *, const char *); #endif // PARSER_H_ |