aboutsummaryrefslogtreecommitdiffstats
path: root/optable.h
diff options
context:
space:
mode:
authordan <[email protected]>2023-05-29 15:26:26 -0400
committerdan <[email protected]>2023-05-29 15:26:26 -0400
commitc2138b3ba1d49ff93bdebe9b76aca7c356b46689 (patch)
tree4c53e16cca23852d8eef427edbffb1c0a43f70d2 /optable.h
parentb72c271d8731e1f67fdef29cd64726dfce893fe7 (diff)
downloadforth-c2138b3ba1d49ff93bdebe9b76aca7c356b46689.tar.gz
forth-c2138b3ba1d49ff93bdebe9b76aca7c356b46689.tar.bz2
forth-c2138b3ba1d49ff93bdebe9b76aca7c356b46689.zip
feat: add jit-compiled optype ; add more new commands
Diffstat (limited to 'optable.h')
-rw-r--r--optable.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/optable.h b/optable.h
index b55b38e..e84ad31 100644
--- a/optable.h
+++ b/optable.h
@@ -12,10 +12,19 @@
typedef void (*stackop)(stack *);
typedef void (*directiveop)(stack *, int len, char* line, int* i);
+typedef struct {
+ bool isliteral;
+ union {
+ stackop stackop;
+ stackitem literal;
+ };
+} compileditem;
+
typedef enum {
directive = 0,
builtin = 1,
script = 2,
+ compiled = 3,
} optype;
typedef struct {
@@ -28,6 +37,10 @@ typedef struct {
char* script;
int scriptlen;
};
+ struct {
+ compileditem* oplist;
+ int oplistlen;
+ };
};
} wordop;
@@ -37,4 +50,6 @@ typedef struct {
*/
wordop* getop(char *word);
+void optable_init();
+
#endif //OPTABLE_H