diff options
author | rodri <rgl@antares-labs.eu> | 2024-09-05 15:45:27 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2024-09-05 15:45:27 +0000 |
commit | 97bc549d4b8bf638946ac4ff3b066941bca9a03b (patch) | |
tree | 5bd5ca788c8e3577dda001e0454157c9408ac08f /dat.h | |
parent | 11087295a24b0a8d08897824c7ee9676026fa159 (diff) | |
download | semblance-97bc549d4b8bf638946ac4ff3b066941bca9a03b.tar.gz semblance-97bc549d4b8bf638946ac4ff3b066941bca9a03b.tar.bz2 semblance-97bc549d4b8bf638946ac4ff3b066941bca9a03b.zip |
initial compiler work.
Diffstat (limited to 'dat.h')
-rw-r--r-- | dat.h | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -0,0 +1,47 @@ +enum +{ + TDOUBLE, + TPOINT, + TVECTOR, + TNORMAL, + TQUAT, +}; + +typedef struct Var Var; +typedef struct Symbol Symbol; +typedef struct Const Const; +typedef struct Builtin Builtin; + +struct Var +{ + int type; + union { + double dval; + Point3 pval; + Quaternion qval; + }; +}; + +struct Symbol +{ + char *name; + int type; + union { + Var var; + double val; /* constant value */ + double (*fn)(double); + } u; + Symbol *next; +}; + +struct Const +{ + char *name; + double val; +}; + +struct Builtin +{ + char *name; + double (*fn)(); +}; |