Regra Expression adicionada, mas nao totalmente testada.
[toypasc.git] / base.h
blobed63272b934a2c7dc141ea6d330438a13bf878ef
1 #ifndef BASE_H
2 #define BASE_H
4 #define VOID(var) ((void *) &var)
6 typedef enum {
7 FALSE = 0,
8 TRUE
9 } bool;
11 typedef enum TypeEnum {
12 NONE_TYPE = -1,
13 INTEGER,
14 BOOLEAN,
15 CHAR,
16 PROCEDURE,
17 FUNCTION
18 } Type;
20 typedef union {
21 int integer;
22 bool boolean;
23 char character;
24 } Value;
26 Type type_get_from_lexeme(const char *lexeme);
28 void value_print(Value *value, Type type);
29 void value_get(Value *value, Type type, void *val);
30 void value_set(Value *value, Type type, void *val);
31 void value_set_from_int(Value *value, int val);
32 void value_set_from_bool(Value *value, bool val);
33 void value_set_from_char(Value *value, char val);
35 #endif // BASE_H