diff options
author | dan <[email protected]> | 2023-05-29 15:26:26 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-05-29 15:26:26 -0400 |
commit | c2138b3ba1d49ff93bdebe9b76aca7c356b46689 (patch) | |
tree | 4c53e16cca23852d8eef427edbffb1c0a43f70d2 /optable.h | |
parent | b72c271d8731e1f67fdef29cd64726dfce893fe7 (diff) | |
download | forth-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.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 |