Gyoji Compiler
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Gyoji::mir::Symbol Class Reference

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 Typeget_type () const
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ Symbol()

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::~Symbol ( )

Move along, nothing to see here.

Move along, nothing to see here.

Member Function Documentation

◆ get_name()

std::string Symbol::get_name ( ) const

Returns the name of the symbol.

◆ get_type()

const Type * Symbol::get_type ( ) const

Returns a pointer to the immutable type of the symbol.


The documentation for this class was generated from the following files: