diff options
author | dan <[email protected]> | 2023-06-02 16:22:29 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-06-02 16:22:29 -0400 |
commit | ac8a2fd77f7661b60cf2b272090ece67f65951db (patch) | |
tree | d45442d8bcf5c40febb85fc35d02c6c4f1d3684e /optable.h | |
parent | 558b0646c5580454dd35a6bdee07bcc711db134e (diff) | |
download | forth-ac8a2fd77f7661b60cf2b272090ece67f65951db.tar.gz forth-ac8a2fd77f7661b60cf2b272090ece67f65951db.tar.bz2 forth-ac8a2fd77f7661b60cf2b272090ece67f65951db.zip |
refactor: always output via buffer
Diffstat (limited to 'optable.h')
-rw-r--r-- | optable.h | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/optable.h b/optable.h deleted file mode 100644 index 811da9f..0000000 --- a/optable.h +++ /dev/null @@ -1,66 +0,0 @@ -#include <stdio.h> -#include <stdbool.h> -#include "stack.h" - -#ifndef OPTABLE_H -#define OPTABLE_H - -#define OPTABLE_MAX_SIZE 1024 -#define DEFINED_FUNC_MAX_LENGTH 1024 -#define WORD_LEN_LIMIT 255 - -typedef struct optable optable; -typedef struct wordop wordop; - -typedef void (*stackop)(stack *); -typedef void (*directiveop)(stack *, int len, char* line, int* i, optable* optable); - -extern char* outputbuffer; -extern int outputline; - -typedef struct { - bool isliteral; - union { - wordop* wordop; - stackitem literal; - }; -} compileditem; - -typedef enum { - directive = 0, - builtin = 1, - script = 2, - compiled = 3, -} optype; - -struct wordop { - char* word; - optype optype; - union { - directiveop directive; - stackop op; - struct { - char* script; - int scriptlen; - }; - struct { - compileditem* oplist; - int oplistlen; - }; - }; -}; - -struct optable { - int len; - wordop* optable; -}; - -/** - * getop returns the first wordop in the optable which is called by the word given as a parameter - * if none exist, returns 0 - */ -wordop* optable_getop(optable* optable, char *word); - -optable* optable_new(); - -#endif //OPTABLE_H |