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

4
.gitignore vendored
View file

@ -2,4 +2,6 @@ src/lex.yy.c
src/parser.tab.c src/parser.tab.c
src/parser.tab.h src/parser.tab.h
sloth sloth
vgcore* vgcore*
.vscode
.vscode/*

View file

@ -34,6 +34,22 @@ struct Variable {
double value; 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 // Variable Functions
struct Variable* make_variable(char* id, double value); struct Variable* make_variable(char* id, double value);
void set_value(struct Variable* var, double value); void set_value(struct Variable* var, double value);