Gyoji Compiler
|
A symbol defined globally inside a namespace. More...
#include <symbols.hpp>
Public Member Functions | |
Symbol (std::string _name, const Type *_type) | |
~Symbol () | |
Move along, nothing to see here. | |
std::string | get_name () const |
const Type * | get_type () const |
A symbol defined globally inside a namespace.
This class holds a symbol which exists in the global space of a translation unit. For example, all global variables and references to functions are defined as symbols in the symbol table. The symbol table consists of a name that is unique in the global namespace and the associated type as either a value type or function-pointer type (basically anything except void).
Symbol::Symbol | ( | std::string | _name, |
const Type * | _type | ||
) |
Creates a new symbol in the symbol table. Names are assumed to be globally unique and care must be taken when adding symbols to ensure that they do not conflict since this would pose a problem for linkage of the generated binary.
Symbol::~Symbol | ( | ) |
Move along, nothing to see here.
Move along, nothing to see here.
std::string Symbol::get_name | ( | ) | const |
Returns the name of the symbol.
const Type * Symbol::get_type | ( | ) | const |
Returns a pointer to the immutable type of the symbol.