Gyoji Compiler
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Gyoji::frontend::namespaces::NS2Entity Class Reference

Entity living inside a namespace. More...

#include <ns2.hpp>

Public Types

enum  EntityType { ENTITY_TYPE_IDENTIFIER , ENTITY_TYPE_TYPE , ENTITY_TYPE_CLASS , ENTITY_TYPE_NAMESPACE , ENTITY_TYPE_LABEL }
 

Public Member Functions

const std::stringget_name () const
 
const EntityTypeget_type () const
 

Detailed Description

Entity living inside a namespace.

A namespace entity is anything that might live inside a namespace. This may be an identifier, a type, a class, or another namespace. Note that classes and namespaces also may contain namespaces of their own so that they can be nested.

Member Enumeration Documentation

◆ EntityType

Enumerator
ENTITY_TYPE_IDENTIFIER 

The named element is some concrete object that is not a type.

ENTITY_TYPE_TYPE 

The named element is a type For example, a typedef may appear here.

ENTITY_TYPE_CLASS 

The named element is a class that is an entity itself, but also spawns its own namespace.

ENTITY_TYPE_LABEL 

This is a label used by a goto statement. It may be declared by either a 'goto' or 'label' statement and is a different type of identifier, but needs to still be unique in the namespace of a function.

Member Function Documentation

◆ get_name()

const std::string & NS2Entity::get_name ( ) const

Returns the 'simple' name that is a leaf-node in a namespace. The namespace manages only the simple entity name and type, but carries no other semantic information. This exists to provide a unique fully-qualified name for each entity that needs a name. The semantics of the object being named are managed elsewhere in the context it is needed.

◆ get_type()

const NS2Entity::EntityType & NS2Entity::get_type ( ) const

The type of object being named. This may be a TYPE or an IDENTIFIER. If it is a TYPE, the specific type information is carried elsewhere.


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