diff --git a/.gitignore b/.gitignore index e1f6e81..83c4ea0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ src/lex.yy.c src/parser.tab.c src/parser.tab.h sloth -vgcore* \ No newline at end of file +vgcore* +.vscode +.vscode/* \ No newline at end of file diff --git a/src/node.h b/src/node.h index 3e6efef..e607b1c 100644 --- a/src/node.h +++ b/src/node.h @@ -34,6 +34,22 @@ struct Variable { double value; }; +typedef union typeval { + long num; + double dec; +} TypeVal; + +struct Value { + int type; + TypeVal value; +}; + +// Value functions +int get_int(struct Value* val); +double get_double(struct Value* val); +void set_int(struct Value* val); +void set_double(struct Value* val); + // Variable Functions struct Variable* make_variable(char* id, double value); void set_value(struct Variable* var, double value);