diff options
Diffstat (limited to 'src/parse.h')
| -rw-r--r-- | src/parse.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/parse.h b/src/parse.h new file mode 100644 index 0000000..27ce444 --- /dev/null +++ b/src/parse.h @@ -0,0 +1,40 @@ +#ifndef PARSE +#define PARSE + +/* keyword hashes */ +#define VAR_H 2317739966u +#define DEFINE_H 1788839250 + +typedef enum SymbolProvince { + NO_PROVINCE, + KEY_REF, + LITERAL +} prov_t; +typedef enum LiteralType { + NO_TYPE, + INT, + FLOAT, + STRING +} litType_t; +typedef struct Symbol { + prov_t province; + litType_t litType; + void* name; + struct Symbol** args; + int argCount; +} sym_t; +typedef struct SymbolSet { + sym_t** symbols; + int count; +} symset_t; + +int symtoi(sym_t* symbol); +float symtof(sym_t* symbol); +char* symtos(sym_t* symbol); +void symbol_add_arg(sym_t* symbol, sym_t* arg); +void symset_add_symbol(symset_t* symbolSet, sym_t* symbol); +symset_t* parse_symbols(char** str); +sym_t* parse_symbol_final(char* str); +void write_symbol_visual(sym_t* symbol, int offset); + +#endif |
