Archived
1
0
Fork 0

Modified gitignore file and added the Value Type definition.

This commit is contained in:
Brandon Rozek 2018-09-19 18:44:42 -04:00
parent 1bf170d70c
commit 0ddbe79d25
2 changed files with 19 additions and 1 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ src/parser.tab.c
src/parser.tab.h
sloth
vgcore*
.vscode
.vscode/*

View file

@ -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);