Modified gitignore file and added the Value Type definition.
This commit is contained in:
parent
1bf170d70c
commit
0ddbe79d25
2 changed files with 19 additions and 1 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -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/*
|
16
src/node.h
16
src/node.h
|
@ -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);
|
||||||
|
|
Reference in a new issue