summaryrefslogtreecommitdiff
path: root/src/lib/aplwc_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/aplwc_internal.h')
-rw-r--r--src/lib/aplwc_internal.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/lib/aplwc_internal.h b/src/lib/aplwc_internal.h
index 52ecd2e..155508d 100644
--- a/src/lib/aplwc_internal.h
+++ b/src/lib/aplwc_internal.h
@@ -21,16 +21,41 @@ struct memory {
struct aplwc {
enum aplwc_rc last_error;
- char last_error_msg[64];
struct memory memory;
};
-/* errors.c */
-const char *rc_to_string(enum aplwc_rc);
+struct aplwc_line {
+ struct aplwc *aplwc;
+ struct string *text;
+ struct token_list *tokens;
+};
+
+struct string {
+ size_t bytes;
+ size_t chars;
+ uint8_t *utf8;
+};
+
+struct token_list {
+ size_t length;
+};
+
+/* eval.c */
+void eval_line(struct aplwc_line *);
/* memory.c */
struct memory memory_init(uint8_t *, size_t);
struct aplwc *memory_alloc_aplwc(struct memory *);
+struct aplwc_line *memory_alloc_aplwc_line(struct memory *);
+struct string *memory_alloc_string(struct memory *, size_t);
void memory_free_aplwc(struct memory *, struct aplwc *);
+void memory_free_aplwc_line(struct memory *, struct aplwc_line *);
+void memory_free_string(struct memory *, struct string *);
+
+/* string.c */
+struct string *chars_to_string(struct aplwc *, const char *);
+
+/* syntax.c */
+struct token_list *scan_line(struct aplwc *, struct string *);
#endif /* APLWC_INTERNAL_H */