equal
deleted
inserted
replaced
46 #define _ABSYNTAX_HH |
46 #define _ABSYNTAX_HH |
47 |
47 |
48 |
48 |
49 #include <stdio.h> // required for NULL |
49 #include <stdio.h> // required for NULL |
50 #include <vector> |
50 #include <vector> |
|
51 #include <string> |
51 |
52 |
52 /* Forward declaration of the visitor interface |
53 /* Forward declaration of the visitor interface |
53 * dclared in the visitor.hh file |
54 * declared in the visitor.hh file |
54 * We cannot include the visitor.hh file, as it will |
55 * We cannot include the visitor.hh file, as it will |
55 * include this same file first, as it too requires references |
56 * include this same file first, as it too requires references |
56 * to the abstract syntax classes defined here. |
57 * to the abstract syntax classes defined here. |
57 */ |
58 */ |
58 class visitor_c; // forward declaration |
59 class visitor_c; // forward declaration |
59 |
60 |
60 |
61 |
61 class symbol_c; // forward declaration |
62 class symbol_c; // forward declaration |
62 |
|
63 |
63 |
64 |
64 |
65 /* The base class of all symbols */ |
65 /* The base class of all symbols */ |
66 class symbol_c { |
66 class symbol_c { |
67 |
67 |
81 /* Data type of the expression/literal/etc. Filled in stage3 by narrow_candidate_datatypes_c |
81 /* Data type of the expression/literal/etc. Filled in stage3 by narrow_candidate_datatypes_c |
82 * If set to NULL, it means it has not yet been evaluated. |
82 * If set to NULL, it means it has not yet been evaluated. |
83 * If it points to an object of type invalid_type_name_c, it means it is invalid. |
83 * If it points to an object of type invalid_type_name_c, it means it is invalid. |
84 * Otherwise, it points to an object of the apropriate data type (e.g. int_type_name_c, bool_type_name_c, ...) |
84 * Otherwise, it points to an object of the apropriate data type (e.g. int_type_name_c, bool_type_name_c, ...) |
85 */ |
85 */ |
86 symbol_c *datatype; |
86 symbol_c *datatype; |
|
87 |
|
88 double *const_value_real; |
|
89 int64_t *const_value_integer; |
|
90 uint64_t *const_value_uinteger; |
|
91 bool *const_value_bool; |
87 |
92 |
88 |
93 |
89 public: |
94 public: |
90 /* default constructor */ |
95 /* default constructor */ |
91 symbol_c(int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
96 symbol_c(int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
300 #undef SYM_REF3 |
305 #undef SYM_REF3 |
301 #undef SYM_REF4 |
306 #undef SYM_REF4 |
302 #undef SYM_REF5 |
307 #undef SYM_REF5 |
303 #undef SYM_REF6 |
308 #undef SYM_REF6 |
304 |
309 |
305 |
|
306 |
|
307 #endif /* _ABSYNTAX_HH */ |
310 #endif /* _ABSYNTAX_HH */ |