752306bc53b89dd0a9b02e57bd330b64f3a3fcc8 kent Wed Aug 7 15:50:57 2019 -0700 Adding in some actual built in functions. Starting to extract bits into a strex.h interface file. diff --git src/inc/strex.h src/inc/strex.h new file mode 100644 index 0000000..828deed --- /dev/null +++ src/inc/strex.h @@ -0,0 +1,24 @@ +/* strex.h - interface to string expression language, currently used in tabToTabDir + * to describe how the output fields are filled in from input fields. */ + + +/* Parsing out something into strex */ +struct strexParse; /* A parser generated tree */ + +struct strexParse *strexParseString(char *s); +/* Parse out string expression in s and return root of tree. */ + +void strexParseDump(struct strexParse *p, int depth, FILE *f); +/* Dump out strexParse tree and children. */ + + + +/* Evaluating a parsed out strex expression */ + +typedef char* (*StrexEvalLookup)(void *symbols, char *key); +/* Callback to lookup value ov key in a symbol table */ + +char *strexEvalAsString(struct strexParse *p, void *symbols, StrexEvalLookup lookup); +/* Evaluating a strex expression on a symbol table with a lookup function for variables and + * return result as a string value. */ +