cppannotations/annotations/yo/concrete/unrestricted/semantic/semantic.h
Frank B. Brokken 777b182edd Moved all files but 'excluded', 'sf', and 'sourcetar' to ./annotations
This allowed me to standardize the sourcetar and sf/* scripts: the base
    directory (containing ./git) is now empty, except for maintenance scripts,
    while the source files and build scripts of the annotations are stored in
    a subdirectory of their own.
2013-05-29 20:44:08 +02:00

36 lines
658 B
C++

#ifndef INCLUDED_SEMANTIC_
#define INCLUDED_SEMANTIC_
#include <utility>
#include <string>
union Semantic
{
friend std::ostream &operator<<(std::ostream &out, Semantic const &obj);
std::pair<int, int> d_int;
std::pair<int, std::string> d_str;
public:
enum Type
{
INT,
IDENTIFIER
};
Semantic();
Semantic(Type type, char const *txt);
Semantic(Semantic const &other); // 2
~Semantic();
Semantic &operator=(Semantic const &rhs);
void swap(Semantic &other);
};
inline Semantic::Semantic()
:
d_int {INT, 0}
{}
#endif