| 1 |
#include "semantic.ih" |
| 2 |
|
| 3 |
Semantic::Semantic(Type type, char const *txt) |
| 4 |
{ |
| 5 |
d_int.first = static_cast<int>(type); |
| 6 |
|
| 7 |
if (type == IDENTIFIER) |
| 8 |
new (&d_str.second) string{ txt }; |
| 9 |
else |
| 10 |
{ |
| 11 |
istringstream in(txt); |
| 12 |
in >> d_int.second; |
| 13 |
} |
| 14 |
} |